This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcj trunk - getAnnotations NullPointerException / segmentation fault


Hanno Meyer-Thurow writes:
 > Hi list,
 > with latest fixes to Annotation code and String.format(...) patch I get
 > a NullPointerException / segmentation fault by running JUnit-4.2 tests.
 > 
 > I do not think that I get a testcase this time. So, if you are interested get
 > JUnit-4.2 source from http://downloads.sourceforge.net/junit/junit4.2.zip
 > and run 'ant dist' to compile and run tests.
 > 
 > To run the tests alone do:
 > 
 > 	gij -classpath . org.junit.runner.JUnitCore org.junit.tests.AllTests
 > 
 > 1) initializationError0(org.junit.tests.AllTests)
 > java.lang.NullPointerException
 >    at $Proxy0.annotationType(Unknown Source:0)
 >    at java.lang.Class.getAnnotations(Class.java:1277)
 >    at java.lang.Class.getAnnotation(Class.java:1255)
 >    at org.junit.internal.requests.ClassRequest.getRunnerClass(ClassRequest.java:32)
 >    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:20)
 >    at org.junit.internal.requests.ClassesRequest.getRunner(ClassesRequest.java:21)
 >    at org.junit.runners.Suite.<init>(Suite.java:50)
 >    at org.junit.runners.Suite.<init>(Suite.java:36)
 >    at java.lang.reflect.Constructor.newInstance(natConstructor.cc:92)
 >    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:23)
 >    at org.junit.internal.requests.ClassesRequest.getRunner(ClassesRequest.java:21)
 >    at org.junit.runner.JUnitCore.run(JUnitCore.java:109)
 >    at org.junit.runner.JUnitCore.run(JUnitCore.java:100)
 >    at org.junit.runner.JUnitCore.runMain(JUnitCore.java:81)
 >    at org.junit.runner.JUnitCore.main(JUnitCore.java:44)
 > 
 > Though, before I see only the segmentation fault I have to fix gdb:
 > 
 > 	http://sourceware.org/ml/gdb-patches/2007-01/msg00561.html
 > 
 > Then, it throws a segmentation fault at:
 > 
 > Program received signal SIGSEGV, Segmentation fault.
 > 0x00002b4aaac672ad in run_proxy (cif=0x2b4aad527fa0, rvalue=0x7fff01798510, args=0x7fff01798390, user_data=0x2b4aad527f70)
 >     at libjava/java/lang/reflect/natVMProxy.cc:318
 > 318	    = _Jv_NewObjectArray (self->meth->parameter_types->length, &Object::class$, NULL);
 > 
 > I set a breakpoint there and see it stopping there 60+ times before it
 > throws the segmentation fault.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208654144 (LWP 19618)]
0x01670942 in run_proxy (cif=0x334898, rvalue=0xbfe946bc, 
    args=0xbfe94670, user_data=0x334880)
    at /home/aph/gcc/trunk/libjava/java/lang/reflect/natVMProxy.cc:318
(gdb) p self->meth->parameter_types
$4 = (JArray<java::lang::Class*> *) 0x0
(gdb) 

Interestingly, this SEGV doesn't happen with compiled code, only
interpreted.  I'm investigating.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]