This is the mail archive of the java-patches@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]

[REVIVED: PATCH PR42811,4.5 regression] java.lang.ExceptionInInitializerError in ecj1


On 06/02/2010 06:29, Dave Korn wrote:
> On 05/02/2010 22:26, Dave Korn wrote:
> 
>> libjava/ChangeLog:
>>
>> 	PR java/42811
>> 	* configure.ac (libgcj_spec_lgcj_override): Add undefined reference
>> 	to arbitrary symbol in noncore library.
>> 	(libgcj_spec_lgcj_bc_override): Likewise.
>>
>>   I'm taking this for a bootstrap-and-test cycle on i686-pc-cygwin.  Does it
>> seem like a reasonable approach?
> 
>   It caused a regression:
> 
>> FAIL: events output

  I've now tracked this regression down to a use of uninitialised memory in
the core vm code(*), which appears to be entirely unrelated to (and presumably
entirely accidentally exposed by) this patch.  So, I'm reviving it.  I'm
running a full testsuite now for the combined patch, but I've already verified
this regression no longer appears.

libjava/ChangeLog:

	PR java/42811
	* configure.ac (libgcj_spec_lgcj_override): Add undefined reference
	to arbitrary symbol in noncore library.
	(libgcj_spec_lgcj_bc_override): Likewise.
	configure: Regenerate.
	* jvmti.cc (_Jv_GetJVMTIEnv): Fix use of uninitialised memory
	exposed by the above change.

  Bootstrapped on i686-pc-cygwin; currently running check-target-libjava only.
 Assuming no regressions this time, OK for head?

    cheers,
      DaveK
-- 
(*) - http://gcc.gnu.org/ml/java/2010-02/msg00002.html

Index: libjava/configure.ac
===================================================================
--- libjava/configure.ac	(revision 156730)
+++ libjava/configure.ac	(working copy)
@@ -244,9 +244,13 @@ if test "$enable_libgcj_sublibs" = yes ; then
   # tag "_bc" onto the end of it when we use it to generate the
   # spec, but that's an ugly thing to do when there are multiple
   # words in the string and you're relying on the ordering to
-  # append the correct one.
-  libgcj_spec_lgcj_override="-lgcj-noncore -lgcj"
-  libgcj_spec_lgcj_bc_override="-lgcj-noncore -lgcj_bc"
+  # append the correct one.  Note that we add an arbitrary undef
+  # from libgcj-noncore to ensure the library is actually linked
+  # and loaded, as there aren't static dependencies to tell us
+  # which classes will be loaded at runtime, so we need to ensure
+  # that all the class data (.jcr sections) are present and initialised.
+  libgcj_spec_lgcj_override="-lgcj-noncore -u__ZN3org4ietf4jgss10GSSManagerC1Ev -lgcj"
+  libgcj_spec_lgcj_bc_override="-lgcj-noncore -u__ZN3org4ietf4jgss10GSSManagerC1Ev -lgcj_bc"
 fi
 
 
Index: libjava/jvmti.cc
===================================================================
--- libjava/jvmti.cc	(revision 156730)
+++ libjava/jvmti.cc	(working copy)
@@ -2210,6 +2210,7 @@ _Jv_GetJVMTIEnv (void)
 {
   _Jv_JVMTIEnv *env
     = (_Jv_JVMTIEnv *) _Jv_MallocUnchecked (sizeof (_Jv_JVMTIEnv));
+  memset (env, 0, sizeof (_Jv_JVMTIEnv));
   env->p = &_Jv_JVMTI_Interface;
   struct jvmti_env_list *element
     = (struct jvmti_env_list *) _Jv_MallocUnchecked (sizeof (struct jvmti_env_list));

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