Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Dec 2007 18:25:33 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        "Arno J. Klaassen" <arno@heho.snv.jussieu.fr>
Cc:        nate@yogotech.com, java@freebsd.org, julian@freebsd.org, davidxu@freebsd.org
Subject:   Re: cvs commit: src/lib/libkse/thread thr_kern.c
Message-ID:  <Pine.GSO.4.64.0712011824130.11446@sea.ntplx.net>
In-Reply-To: <wphcj2plsx.fsf@heho.snv.jussieu.fr>
References:  <200711301716.lAUHGEV1064334@repoman.freebsd.org> <wpprxrto0s.fsf@heho.snv.jussieu.fr> <Pine.GSO.4.64.0711301659060.5465@sea.ntplx.net> <wpwsrz9uyr.fsf@heho.snv.jussieu.fr> <Pine.GSO.4.64.0711301849310.6581@sea.ntplx.net> <wphcj2plsx.fsf@heho.snv.jussieu.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 1 Dec 2007, Arno J. Klaassen wrote:

> Daniel Eischen <deischen@freebsd.org> writes:
>
>>> Arno J. Klaassen wrote:
>>>
>>> [ ... ]
>>> That gives :
>>>
>>> #0  0x000000080075d151 in _pthread_sigmask (how=3, set=0x813cc6e10, oset=0x0)
>>>    at /files/bsd/src7/lib/libkse/thread/thr_sigmask.c:52
>>> #1  0x000000080075d103 in _sigprocmask (how=3, set=0x813cc6e10, oset=0x0)
>>>    at /files/bsd/src7/lib/libkse/thread/thr_sigprocmask.c:49
>>> #2  0x000000080076c423 in _kse_single_thread (curthread=0x813cc6c00)
>>>    at /files/bsd/src7/lib/libkse/thread/thr_kern.c:361
>>> #3  0x0000000800758f29 in _fork ()
>>>    at /files/bsd/src7/lib/libkse/thread/thr_fork.c:101
>>> #4  0x0000000801e43158 in jdk_fork_wrapper ()
>>>    at ../../../src/solaris/native/java/lang/UNIXProcess_md.c:437
>>>
>>> Hope this is better
>>
>> Yes, this would seem to be a kernel problem, as _get_curthread()
>> seems to be returning garbage.
>
> (gdb) p curthread
> $1 = (struct pthread *) 0x0
>
>
>> This is a libkse MD function,
>> that relies on %gs (for i386/amd64) to point to something
>> that was initialized in the parent.
>>
>> Julian, David, got any ideas?
>
> I can publish ti full java_g.core if helpful.

You could of course try this hack to work-around the problem:

Index: thr_kern.c
===================================================================
RCS file: /home/ncvs/src/lib/libkse/thread/thr_kern.c,v
retrieving revision 1.127
diff -u -r1.127 thr_kern.c
--- thr_kern.c	30 Nov 2007 17:16:14 -0000	1.127
+++ thr_kern.c	1 Dec 2007 23:23:42 -0000
@@ -361,6 +361,13 @@
  	curthread->kse->k_kcb->kcb_kmbx.km_curthread = NULL;
  	curthread->attr.flags |= PTHREAD_SCOPE_SYSTEM;

+	/*
+	 * This shouldn't be necessary.  It sometimes gets corrupted
+	 * after a fork() in SMP.
+	 */
+	_kcb_set(curthread->kse->k_kcb);
+	_tcb_set(curthread->kse->k_kcb, curthread->tcb);
+
  	/* After a fork(), there child should have no pending signals. */
  	sigemptyset(&curthread->sigpend);


-- 
DE



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0712011824130.11446>