This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Bugs for JNI on Solaris
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- To: java-patches at gcc dot gnu dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Wed, 13 Feb 2002 12:35:29 +0100
- Subject: Re: Bugs for JNI on Solaris
- Reply-to: martin dot kahlert at infineon dot com
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.