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]

Re: Bugs for JNI on Solaris


Hi!
I think, Tom changed a bit too much of my patch:
env->locals->next = env->locals;
env->locals = NULL;
only produces a memory leak (and an infinite linked list inside the leak) 
and the following for loop gives a SegFault.
Perhaps the original lines would be better.

If i understand the code correctly, there is no env->locals set up at this time
where the next pointer of the created frame could/should point to.
We set up a leading locals frame here.

Here is the patch for the patch:

2002-02-13  Martin Kahlert  <martin.kahlert@infineon.com>
        * jni.cc (_Jv_JNI_AttachCurrentThread): env->locals assigned correctly

--- jni.cc.old	Wed Feb 13 12:18:55 2002
+++ jni.cc	Wed Feb 13 12:18:22 2002
@@ -2134,8 +2134,7 @@
 
   env->locals->marker = MARK_SYSTEM;
   env->locals->size = FRAME_SIZE;
-  env->locals->next = env->locals;
-  env->locals = NULL;
+  env->locals->next = NULL;
 
   for (int i = 0; i < env->locals->size; ++i)
     env->locals->vec[i] = NULL;


Hopefully i did not miss the point here.
Bye
Martin.

-- 
The early bird catches the worm. If you want something else for       
breakfast, get up later.


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