cvs commit: src/lib/libkse/thread thr_kern.c

Arno J. Klaassen arno at heho.snv.jussieu.fr
Fri Nov 30 13:35:36 PST 2007


Hello,

Daniel Eischen <deischen at freebsd.org> writes:

> deischen    2007-11-30 17:16:14 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     lib/libkse/thread    thr_kern.c 
>   Log:
>   Initialize the current thread and signal locks so that sigaction()
>   will work after a fork().


I spotted this patch wrt my .exec() problems.

Quick recall : I get strange exceptions in java-code doing quite
a lot of .exec() calls, but only on 2x2way SMP, not on UP or
single CPU SMP.

I get these problems under releng_6 as well, but 'my' only
2x2way SMP box is a production server I cannot test on.

Seeing this patch, I retested on a 2x2 SMP box running releng_7(amd64)
libmapping libthr.so.3 to libkse.so.3 for /usr/local/jdk1.5.0/bin/java_g.

I use the attached test-program (adapted after gentile remarks of Nate
Williams; I hope there's not yet another program error in it but it
does run flawlessly with libthr).

Running it like "/usr/local/jdk1.5.0/bin/java_g Test_cmd /tmp 0 "
it will produce a java_g.core after a number of iterations
with exit status 139.

Both with and without the above patch applied (to releng_7) the
gdb trace shows (I recompiled libkse with -g as well, but no
line-numbers showing up ) :

 gdb -core java_g.core /usr/local/jdk1.5.0/bin/java_g 
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
Core was generated by `java_g'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libz.so.4...done.
Loaded symbols for /lib/libz.so.4
Reading symbols from /usr/lib/libkse.so.3...done.
Loaded symbols for /usr/lib/libkse.so.3
Reading symbols from /lib/libc.so.7...done.
Loaded symbols for /lib/libc.so.7
Reading symbols from /usr/local/jdk1.5.0/jre/lib/amd64/server/libjvm_g.so...done.
Loaded symbols for /usr/local/jdk1.5.0/jre/lib/amd64/server/libjvm_g.so
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libm.so.5...done.
Loaded symbols for /lib/libm.so.5
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /usr/local/jdk1.5.0/jre/lib/amd64/native_threads/libhpi_g.so...done.
Loaded symbols for /usr/local/jdk1.5.0/jre/lib/amd64/native_threads/libhpi_g.so
Reading symbols from /usr/local/jdk1.5.0/jre/lib/amd64/libverify_g.so...done.
Loaded symbols for /usr/local/jdk1.5.0/jre/lib/amd64/libverify_g.so
Reading symbols from /usr/local/jdk1.5.0/jre/lib/amd64/libjava_g.so...done.
Loaded symbols for /usr/local/jdk1.5.0/jre/lib/amd64/libjava_g.so
Reading symbols from /usr/local/jdk1.5.0/jre/lib/amd64/libzip_g.so...done.
Loaded symbols for /usr/local/jdk1.5.0/jre/lib/amd64/libzip_g.so
Reading symbols from /libexec/ld-elf.so.1...done.
Loaded symbols for /libexec/ld-elf.so.1
#0  0x000000080075d151 in pthread_sigmask () from /usr/lib/libkse.so.3
[New Thread 0x800b20800 (runnable)]
[New Thread 0x800b1e800 (sleeping)]
[New Thread 0x800b1e000 (sleeping)]
[New Thread 0x800b1dc00 (runnable)]
[New Thread 0x800b1d800 (sleeping)]
[New Thread 0x800b1d400 (sleeping)]
[New Thread 0x800b1d000 (sleeping)]
[New Thread 0x800b1cc00 (sleeping)]
[New Thread 0x800b1c800 (sleeping)]
[New Thread 0x800b1c000 (sleeping)]
[New Thread 0x800b1bc00 (LWP 100313)]
[New Thread 0x800b19400 (sleeping)]
[New LWP 100288]
(gdb) where
#0  0x000000080075d151 in pthread_sigmask () from /usr/lib/libkse.so.3
#1  0x000000080075d103 in sigprocmask () from /usr/lib/libkse.so.3
#2  0x000000080076c423 in pthread_kill () from /usr/lib/libkse.so.3
#3  0x0000000800758f29 in fork () from /usr/lib/libkse.so.3
#4  0x0000000801e43158 in jdk_fork_wrapper ()
    at ../../../src/solaris/native/java/lang/UNIXProcess_md.c:437
#5  0x0000000801e43570 in Java_java_lang_UNIXProcess_forkAndExec (
    env=0x812a6f198, process=0x7ffffedf1608, prog=0x7ffffedf1600, 
    argBlock=0x7ffffedf15f8, argc=2, envBlock=0x0, envc=0, path=0x0, 
    redirectErrorStream=0 '\0', stdin_fd=0x7ffffedf15c8, 
    stdout_fd=0x7ffffedf15c0, stderr_fd=0x7ffffedf15b8)
    at ../../../src/solaris/native/java/lang/UNIXProcess_md.c:595
#6  0x0000000805086be0 in ?? ()
#7  0x0000000800000000 in ?? ()
#8  0x0000000000000000 in ?? ()
#9  0x00007fff00000000 in ?? ()
#10 0x00007ffffedf15c8 in ?? ()
#11 0x00007ffffedf15c0 in ?? ()
#12 0x00007ffffedf15b8 in ?? ()
#13 0x00007ffffedf1550 in ?? ()
#14 0x00007ffffedf157c in ?? ()
#15 0x00007ffffedf1560 in ?? ()
#16 0x0000000800e4ae4d in ThreadLocalStorage::pd_raw_thread_id ()
    at threadLS_bsd_amd64.hpp:37


Kernel-config is stripped GENERIC with the following extras :

options CLK_USE_I8254_CALIBRATION

options COMPAT_LINUX32
options LINPROCFS
options LINSYSFS


options         SCHED_ULE
options IPI_PREEMPTION
options NO_ADAPTIVE_MUTEXES
options MUTEX_DEBUG


I hope this is of use, and if so, feel free to ask me for more info/tests.

Best,

Arno


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Test_cmd.java
Type: application/octet-stream
Size: 6270 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-java/attachments/20071130/eb6be641/Test_cmd.obj


More information about the freebsd-java mailing list