[MacRuby] #394: Unrecognized runtime type _NSRange=II
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- The following code worked under earlier builds of MacRuby and oddly, on 32-bit Snowy. {{{ def control(control, textView: view, completions: completions, forPartialWordRange: range, indexOfSelectedItem: index) puts "called completions #{range}" target = view.textStorage.string[range.location, range.length] completion_list_for(target, Strings::AutocompletionsFor[:keywords]) end }}} Now, it is called as the delegate method, but generates the console error: {{{ 2009-10-19 15:09:43.595 IStockCocoa[8362:a0f] unrecognized runtime type `{_NSRange=II}' }}} Further info: {{{ $ macruby -v MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64] }}} MacOS 10.6.1 -- Ticket URL: <http://www.macruby.org/trac/ticket/394> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): Could you provide a test case or a small Xcode project that reproduces this problem? We have specs testing NSRange and they all pass. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:1> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by cwdinfo@…): Replying to [comment:1 lsansonetti@…]:
Could you provide a test case or a small Xcode project that reproduces this problem? We have specs testing NSRange and they all pass.
I added a small Xcode project that produces the exception on my machine. This is a fresh machine (just wiped and installed Snowy 2 days ago) so I don't think it's had a chance to get any bad habits ... yet :) To repro the bug, build, then type a few characters in the textfield. Press ESC to trigger the delegate method. That's when the unrecognized runtime type exception occurs. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:2> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): Thanks for the example. Looks like the exception is being raised inside the method resolver. {{{ (gdb) bt #0 rb_exc_raise (mesg=8592694976) at eval.c:312 #1 0x000000010003df86 in rb_raise (exc=8590153248, fmt=<value temporarily unavailable, due to optimizations>) at error.c:1120 #2 0x00000001001321fd in RoxorCompiler::convert_type (this=0x103800800, type=0x7fff5fbfdd00 "{_NSRange=II}") at compiler.cpp:6575 #3 0x000000010014ee5c in RoxorCompiler::compile_objc_stub (this=0x103800800, ruby_func=0x10140f060, ruby_imp=0x101100b00, arity=@0x104ab8fa8, types=<value temporarily unavailable, due to optimizations>) at compiler.cpp:6800 #4 0x000000010017dbd8 in RoxorCore::resolve_method (this=0x102054200, klass=0x200225520, sel=0x7fff83f48988, func=0x10140f060, arity=@0x104ab8fa8, flags=0, imp=0x101100b00, m=0x0) at vm.cpp:1569 #5 0x000000010017e62b in RoxorCore::resolve_methods (this=0x102054200, map=0x104ab9020, klass=0x200225520, sel=0x7fff83f48988) at vm.cpp:1610 #6 0x000000010017ef67 in rb_vm_resolve_method (klass=0x200225520, sel=0x7fff83f48988) at vm.cpp:1658 #7 0x000000010017ef8c in resolveInstanceMethod_imp (self=<value temporarily unavailable, due to optimizations>, sel=<value temporarily unavailable, due to optimizations>, name=<value temporarily unavailable, due to optimizations>) at vm.cpp:4102 #8 0x00007fff88a18b57 in _class_resolveMethod () #9 0x00007fff88a1e199 in lookUpMethod () }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:3> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): It's a bug in BridgeSupport, this informal protocol method doesn't contain 64-bit annotations. {{{ <method type='@32@0:4@8@12@16{_NSRange=II}20^i28' selector='control:textView:completions:forPartialWordRange:indexOfSelectedItem:'/> }}} In 64-bit, NSRange fields are QQ, not II. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:4> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: Committed temporary workaround in r2865. Thanks for the report. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:5> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Comment(by cwdinfo@…): There is a new problem with this. I'm attaching a new file. The range passed in is bad. Build, run, type some characters, press esc. The numbers reported for length and location are wrong. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:6> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: Keywords: | -------------------------------+-------------------------------------------- Changes (by lsansonetti@…): * status: closed => reopened * resolution: fixed => Comment: You're right, reopening. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:7> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: Keywords: | -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): Looks like yet another ABI issue. llvm-gcc compiles the code as: {{{ define internal %struct.Foo* @"\01-[Foo control:textView:completions:forPartialWordRange:indexOfSelectedItem:]"(%struct.Foo* %self, %struct.objc_selector* %_cmd, %struct.NSControl* %control, %struct.NSTextView* %textView, %struct.Foo* %words, %struct.NSRange* byval %charRange, i64* %index) ssp { }}} In this case, the NSRange structure should be passed 'byval'. MacRuby doesn't (since sizeof(NSRange) is <= 128bit) but in this case the number of arguments seem to trigger something. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:8> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: reopened Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: Keywords: | -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): Page 21 of the x86_64 ABI (http://www.x86-64.org/documentation/abi.pdf) says: {{{ If there are no registers available for any eightbyte of an argument, the whole argument is passed on the stack. If registers have already been assigned for some eightbytes of such an argument, the assignments get reverted. }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:9> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Changes (by lsansonetti@…): * status: reopened => closed * resolution: => fixed Comment: Should be fixed by r2903. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:10> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Comment(by cwdinfo@…): I am still getting a bad range passed into the complete method. The result of typing ABC<ESC> is: {{{ text field is abc called completions #<NSRange:0x2002bbee0> = 0 140734799798096 }}} This is on the 2009-10-28 nightly build. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:11> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): As of r2908 I get the following output: {{{ text field is arf called completions #<NSRange:0x2003bcaa0> = 3 0 "{0, 3}" }}} For the following code: {{{ def control(control, textView: view, completions: completions, forPartialWordRange: range, indexOfSelectedItem: index) puts "text field is #{@textField.stringValue}" puts "called completions #{range} = #{range.length} #{range.location}" p NSStringFromRange(range) ['foo', 'bar', 'foobar'] end }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:12> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Comment(by cwdinfo@…): Same code and I get: {{{ text field is qbc called completions #<NSRange:0x200368ae0> = 0 140734799798096 "{140734799798096, 0}" }}} I can only get RUBY_VERSION, so I don't know exactly what version of MacRuby I'm running -- just the most recent nightly build on Snow Leopard 10.6.1 x86_64. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:13> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Comment(by mattaimonetti@…): I tried your second example using trunk form today and everything worked for me: {{{ text field is macruby is awesome called completions #<NSRange:0x200383b00> = 7 11 }}} So, I believe this is fixed on trunkt. Feel free to give another try and reopen this ticket if needed. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:14> MacRuby <http://macruby.org/>
#394: Unrecognized runtime type _NSRange=II -------------------------------+-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | -------------------------------+-------------------------------------------- Comment(by lsansonetti@…): Maybe the fix didn't get into the nightly build, I will test with the latest one tomorrow. -- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:15> MacRuby <http://macruby.org/>
On Oct 28, 2009, at 11:25 PM, MacRuby wrote:
#394: Unrecognized runtime type _NSRange=II ------------------------------- +-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------- +--------------------------------------------
Comment(by lsansonetti@…):
Maybe the fix didn't get into the nightly build, I will test with the latest one tomorrow.
-- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:15> MacRuby <http://macruby.org/>
It got into the most recent nightly build. Thanks so much. Is there a way to compare the version number against the one packaged for the nightly build?
On Oct 29, 2009, at 10:25 AM, s.ross wrote:
On Oct 28, 2009, at 11:25 PM, MacRuby wrote:
#394: Unrecognized runtime type _NSRange=II ------------------------------- +-------------------------------------------- Reporter: cwdinfo@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | ------------------------------- +--------------------------------------------
Comment(by lsansonetti@…):
Maybe the fix didn't get into the nightly build, I will test with the latest one tomorrow.
-- Ticket URL: <http://www.macruby.org/trac/ticket/394#comment:15> MacRuby <http://macruby.org/>
It got into the most recent nightly build. Thanks so much.
Excellent :)
Is there a way to compare the version number against the one packaged for the nightly build?
We define the MACRUBY_REVISION constant that you could use. $ macruby -e "p MACRUBY_REVISION" "svn revision 2915 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk " If MacRuby was built from Git (I think that's what the nightly build does), the constant will have the full Git line (with the sha1 signature). Laurent
Hi Laurent, On Oct 29, 2009, at 12:26 PM, Laurent Sansonetti wrote:
$ macruby -e "p MACRUBY_REVISION" "svn revision 2915 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk"
If MacRuby was built from Git (I think that's what the nightly build does), the constant will have the full Git line (with the sha1 signature).
Apparently not:
prabhaka$ macruby -e "p MACRUBY_REVISION" "unknown revision"
-enp
On Oct 29, 2009, at 12:39 PM, Ernest N. Prabhakar, Ph.D. wrote:
Hi Laurent,
On Oct 29, 2009, at 12:26 PM, Laurent Sansonetti wrote:
$ macruby -e "p MACRUBY_REVISION" "svn revision 2915 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk "
If MacRuby was built from Git (I think that's what the nightly build does), the constant will have the full Git line (with the sha1 signature).
Apparently not:
prabhaka$ macruby -e "p MACRUBY_REVISION" "unknown revision"
Where does your version of MacRuby come from? :-) Laurent
Hi Laurent, On Oct 29, 2009, at 12:42 PM, Laurent Sansonetti wrote:
On Oct 29, 2009, at 12:39 PM, Ernest N. Prabhakar, Ph.D. wrote:
Hi Laurent,
On Oct 29, 2009, at 12:26 PM, Laurent Sansonetti wrote:
$ macruby -e "p MACRUBY_REVISION" "svn revision 2915 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk"
If MacRuby was built from Git (I think that's what the nightly build does), the constant will have the full Git line (with the sha1 signature).
Apparently not:
prabhaka$ macruby -e "p MACRUBY_REVISION" "unknown revision"
Where does your version of MacRuby come from? :-)
I'm pretty sure this was the latest nightly, installed using: -enp
On Oct 29, 2009, at 12:48 PM, Ernest N. Prabhakar, Ph.D. wrote:
Hi Laurent,
On Oct 29, 2009, at 12:42 PM, Laurent Sansonetti wrote:
On Oct 29, 2009, at 12:39 PM, Ernest N. Prabhakar, Ph.D. wrote:
Hi Laurent,
On Oct 29, 2009, at 12:26 PM, Laurent Sansonetti wrote:
$ macruby -e "p MACRUBY_REVISION" "svn revision 2915 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk "
If MacRuby was built from Git (I think that's what the nightly build does), the constant will have the full Git line (with the sha1 signature).
Apparently not:
prabhaka$ macruby -e "p MACRUBY_REVISION" "unknown revision"
Where does your version of MacRuby come from? :-)
I'm pretty sure this was the latest nightly, installed using:
Git will require an extra Attribute to properly do version substitution. See the section on "export-subst" in the Pro Git book: http://progit.org/book/ch7-2.html - Josh
On Oct 29, 2009, at 12:54 PM, Josh Ballanco wrote:
On Oct 29, 2009, at 12:48 PM, Ernest N. Prabhakar, Ph.D. wrote:
Hi Laurent,
On Oct 29, 2009, at 12:42 PM, Laurent Sansonetti wrote:
On Oct 29, 2009, at 12:39 PM, Ernest N. Prabhakar, Ph.D. wrote:
Hi Laurent,
On Oct 29, 2009, at 12:26 PM, Laurent Sansonetti wrote:
$ macruby -e "p MACRUBY_REVISION" "svn revision 2915 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk "
If MacRuby was built from Git (I think that's what the nightly build does), the constant will have the full Git line (with the sha1 signature).
Apparently not:
prabhaka$ macruby -e "p MACRUBY_REVISION" "unknown revision"
Where does your version of MacRuby come from? :-)
I'm pretty sure this was the latest nightly, installed using:
Git will require an extra Attribute to properly do version substitution. See the section on "export-subst" in the Pro Git book: http://progit.org/book/ch7-2.html
This used to work before when we were using Git by default (albeit a different repository). Vincent probably knows what's going wrong here :) Laurent
prabhaka$ macruby -e "p MACRUBY_REVISION" "unknown revision"
Where does your version of MacRuby come from? :-)
I'm pretty sure this was the latest nightly, installed using:
Git will require an extra Attribute to properly do version substitution. See the section on "export-subst" in the Pro Git book: http://progit.org/book/ch7-2.html
This used to work before when we were using Git by default (albeit a different repository). Vincent probably knows what's going wrong here :)
It works on git: % macruby -e "p MACRUBY_REVISION" "git commit 35e069811a44e9346b00cfbcccedc24ae7cce48f" I'm not using export-subst, but when their is a .svn directory I'm calling "svn info" and if there is a .git directory I'm reading .git/ HEAD. "unknown revision" should only appear if there is neither a .svn nor a .git directory. I haven't looked at the scripts that build the nightlies but does it do a svn export or something similar? If that's the case, could we switch to a normal checkout?
participants (6)
-
Ernest N. Prabhakar, Ph.D.
-
Josh Ballanco
-
Laurent Sansonetti
-
MacRuby
-
s.ross
-
Vincent Isambart