penberg/jato — Issue #20: JRuby crashes with GNU Classpath 0.98
Author: penberg
Created: 2011-11-29 09:14:47+00:00
State: open

Charlie Nutter reports the following breakage with GNU Classpath 0.98:

~/jato $ ./jato -jar ../jruby/lib/jruby.jar -e "puts 1"
vm/class.c:931: warning: vm_class_resolve_name_and_type not implemented
[main] SIGSEGV at EIP 0806d782 while accessing memory address 04c48213.
[main] Registers:
[main] eax: 04c481c7 ebx: 08ded380 ecx: 00000001 edx: a78bd9c0
[main] esi: 08ded380 edi: a78bd9c0 ebp: bf9f7504 esp: bf9f74cc
[main] Code: 7b 20 01 75 26 83 78 20 01 75 45 83 ec 0c 53 e8 5b ff ff
ff 89 1c 24 89 45 d4 e8 50 ff ff ff 83 c4 10 8b 5d d4 eb bf 39 c3 74
09 <8b> 40 4c 85 c0 75 f5 eb 1e b0 01 8b 96 d8 00 00 00 8d 4a 01 83
[main] Native and Java stack trace:
[main] [<0806d782>] native :
./jato(vm_class_is_assignable_from_slow+0x63) [0x806d782]
[main] [<08061907>] native : vm_class_is_assignable_from+3c
(/home/headius/jato/include/vm/class.h:229)
[main] [<08061eab>] native : throw_from_jit+50
(/home/headius/jato/jit/exception.c:363)
[main] [<0807f07e>] native : throw_exception+32
(/home/headius/jato/sys/linux-x86/exception.c:51)
[main] [] jit : $Proxy0.optional(Unknown Source)
[main] [] jit :
org/jruby/anno/JavaMethodDescriptor.(JavaMethodDescriptor.java:80)
[main] [] jit :
org/jruby/RubyModule$MethodClumper.clump(RubyModule.java:624)
[main] [] jit :
org/jruby/anno/TypePopulator$DefaultTypePopulator.populate(TypePopulator.java:62)
[main] [] jit :
org/jruby/RubyModule.defineAnnotatedMethodsIndividually(RubyModule.java:718)
[main] [] jit :
org/jruby/RubyModule.defineAnnotatedMethods(RubyModule.java:606)
[main] [] jit :
org/jruby/RubyModule.createModuleClass(RubyModule.java:150)
[main] [] jit : org/jruby/Ruby.initRoot(Ruby.java:1176)
[main] [] jit : org/jruby/Ruby.init(Ruby.java:1104)
[main] [] jit : org/jruby/Ruby.newInstance(Ruby.java:250)
[main] [] jit : org/jruby/Main.internalRun(Main.java:239)
[main] [] jit : org/jruby/Main.run(Main.java:221)
[main] [] jit : org/jruby/Main.run(Main.java:205)
[main] [] jit : org/jruby/Main.main(Main.java:185)
[main] [<0805f710>] native : do_main_class+13e
(/home/headius/jato/vm/jato.c:1081)
[main] [<0805fcc7>] native : ./jato(main+0x55f) [0x805fcc7]
[main] [<00253e36>] native :
/lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe6) [0x253e36]
[main] [<0805e500>] native : ./jato() [0x805e500]
Aborted

The issue here is that GNU Classpath throws IncompleteAnnotationException:

> [main] trace exception: exception object 0xe3e5780
> (java/lang/annotation/IncompleteAnnotationException) thrown
> [main] message : 0x0 null
> [main] from : 0xa793c922:
> sun/reflect/annotation/AnnotationInvocationHandler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;
> [main] (AnnotationInvocationHandler.java:373)
> [main] action : unwind to 0xa793c58d: $Proxy0.optional()I
> [main] (UNKNOWN:-1)
> [main] trace exception: exception object 0xe3e5780
> (java/lang/annotation/IncompleteAnnotationException) thrown
> [main] message : 0x0 null
> [main] from : 0xa793c58c: $Proxy0.optional()I
> [main] (UNKNOWN:-1)
> [main] action : jump to handler at 0xa793c622
> [main] (UNKNOWN:-1)

We need to investigate whether this is a GNU Classpath bug or not. The failure to report the exception properly is a known separate issue:

https://github.com/penberg/jato/issues/16