gcj, gdb warnings & jni method signatures
Rutger Ovidius
r_ovidius@eml.cc
Sun Sep 19 02:39:00 GMT 2004
Friday, September 17, 2004, 5:08:44 PM, you wrote:
>>>>>> "Rutger" == Rutger Ovidius <r_ovidius@eml.cc> writes:
Rutger>> Thanks for the pointer. I put in some more printf debug lines and it
Rutger>> led me to the find_symbol function in natRuntime.cc (specifically, the
Rutger>> call to lt_dlsym)
TT> So there isn't a buffer overflow? Or maybe it only is diagnosed later
TT> on? All I can really suggest is putting a breakpoint in find_symbol
TT> and seeing whether things look ok. You could also try stepping
TT> through lt_dlsym to see whether it is doing an invalid free.
TT> Tom
Hi,
I've tried doing as you've suggested, but I don't immediately notice
anything wrong. The warning comes up as soon as the ltdl.c call to
GetProcAddress() is made (in sys_wll_sym()).
I made a simple stand-alone example. If I make the method
name shorter, or longer it works without warning. If I remove the
__Ljava_lang_String_2 from the jni function signature there is no
warning. If I add an fprintf right before the
memcpy ((buf + long_start + 1 + 1), long_nm_sv, sizeof (long_nm_sv));
in jni.cc, it doesn't show a warning. But, these might all be flukes
for all I know.
Maybe one day I'll get lucky and figure it out.
Attached is my exciting sample (for posterity)..
gcj -fjni -g --main=O O.java -o otest.exe
gcc -shared -I\j2sdk1.4.1_02\include\win32\ -I\j2sdk1.4.1_02\include\ foo.c -o foo.dll
gdb otest ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: O.java
Type: text/java
Size: 542 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040919/7ccc1282/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.c
Type: application/octet-stream
Size: 180 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20040919/7ccc1282/attachment.obj>
More information about the Java
mailing list