Hi, 
I am using the JNI invocation API in a C (not C++) application. Calling java methods 
works. But when the program calls exit() it hangs in __syscall_sigsuspend(). All 
threads (native ones, creates by the JVM after JNI_CreateJavaVM()) remain in the 
process list. This is the stack of the main thread:
(gdb) bt
#0  0x4017af74 in __syscall_sigsuspend ()
#1  0x4019f4cc in __DTOR_END__ ()
#2  0x4010061d in pthread_exit_process (retcode=0, arg=0x0) at restart.h:32
#3  0x401256aa in exit (status=0) at exit.c:52
#4  ...


I think this in not a problem of my application, as the same effect occurs with 
appletviewer:
$ rm -rf $HOME/.hotjava
$ appletviewer &    # the licence window appears
                    # press [accept] button (nothing happens)
                    # press it again (window disappears)
                    # appletviewer ends with a usage message
$ ps                # lists 9 threads             
27370  p8 S    0:00 sh /usr/lib/java/bin/../bin/i686/native_threads/appletviewer
27390  p8 S    0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27391  p8 S    0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27392  p8 S N  0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27393  p8 S    0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27394  p8 S    0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27395  p8 S N  0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27396  p8 S N  0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27397  p8 S    0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet
27398  p8 S N  0:00 /usr/lib/java/bin/../bin/i686/native_threads/java sun/applet


here are 2 of the stacks, all are similar to each other and 
to the stack of my program:


$ gdb /usr/lib/java/bin/../bin/i686/native_threads/java
(gdb) atta 27390
Attaching to program `/usr/lib/java/bin/../bin/i686/native_threads/java', process 27390
Reading symbols from /usr/lib/java/bin/../lib/i686/native_threads/libjava.so...
done.
Reading symbols from /lib/libpthread.so.0...done.
Reading symbols from /lib/libm.so.6...done.
Reading symbols from /lib/libdl.so.2...done.
Reading symbols from /usr/lib/java/bin/../lib/i686/native_threads/libawt.so...
done.
Reading symbols from /usr/X11R6/lib/libXpm.so.4...done.
Reading symbols from /usr/X11R6/lib/libXt.so.6...done.
Reading symbols from /usr/X11R6/lib/libICE.so.6...done.
Reading symbols from /usr/X11R6/lib/libSM.so.6...done.
Reading symbols from /usr/X11R6/lib/libXext.so.6...done.
Reading symbols from /usr/X11R6/lib/libX11.so.6...done.
Reading symbols from /usr/X11R6/lib/libXp.so.6...done.
Reading symbols from /lib/libc.so.6...done.
Reading symbols from /lib/ld-linux.so.2...done.
Reading symbols from /lib/libnss_files.so.1...done.
Reading symbols from /lib/libnss_nis.so.1...done.
Reading symbols from /lib/libnsl.so.1...done.
Reading symbols from /lib/libnss_dns.so.1...done.
Reading symbols from /lib/libresolv.so.2...done.
0x40281f74 in __syscall_sigsuspend ()
(gdb) bt
#0  0x40281f74 in __syscall_sigsuspend ()
#1  0x402a64cc in __DTOR_END__ ()
#2  0x40077bef in pthread_join (thread_id=1025, thread_return=0xbffff4c8)
    at restart.h:49
#3  0x4005c598 in java_main ()
    at ../../../../src/genunix/java/native_threads/src/threads_md.c:1201
#4  0x8061dc6 in main (argc=2, argv=0xbffff5a4, envp=0xbffff5b0)
    at ../../../../src/genunix/java/javai/java.c:23
(gdb) deta
Detaching from program: /usr/lib/java/bin/../bin/i686/native_threads/java proces
s 27390
    
(gdb) atta 27392
(gdb) bt         
#0  0x40281f74 in __syscall_sigsuspend ()
#1  0x402a64cc in __DTOR_END__ ()
#2  0x40077383 in pthread_cond_wait (cond=0x81988bc, mutex=0x8198890)
    at restart.h:49
#3  0x4005c656 in condvarWait ()
    at ../../../../src/genunix/java/native_threads/src/condvar_md.c:191
#4  0x4005b5c1 in sysMonitorWait ()
    at ../../../../src/genunix/java/native_threads/src/monitor_md.c:128
#5  0x4005c1cb in WaitToDie ()
    at ../../../../src/genunix/java/native_threads/src/threads_md.c:364
#6  0x40057c17 in thread_java_main ()
    at ../../../../src/genunix/java/javai/javai.c:142
#7  0x4005c4d8 in java_start ()
    at ../../../../src/genunix/java/native_threads/src/threads_md.c:1200
#8  0x40078106 in pthread_start_thread (arg=0xbf9ffea4) at manager.c:165



I am using DLD Distribution Version 4.17.0.4, blackdown jdk1.1.7v3, 
THREADS_FLAG=native, libc-2.0.7.so, ld-2.0.7.so, libpthread-0.7.so 

There is a warning from ldconfig -D: /lib/libpthread-0.7.so has inconsistent soname 
(libpthread.so.0), I don't know, if this can be ignored. 

Can anybody help me ? 


Regards
Volker


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to