Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Aug 2003 00:20:39 +0300
From:      Alexey Zelkin <phantom@FreeBSD.org.ua>
To:        threads@freebsd.org
Subject:   jdk14 & libc_r / fork()
Message-ID:  <20030825002039.A25487@phantom.cris.net>

next in thread | raw e-mail | index | archive | help
hi,

I have hit into a problem recently while trying to reproduce
some deadlocks in jdk14 port.  Problem details are simple --
JDK calls fork() and got frozen because of storm of unhandled
(i.e. ignored SIGBUSes).  I have checked that SIGBUS ignorance
is not a problem, but reason of SIGBUS is.

Some investigations shown that while doing of libc_r's wrapper
for fork() we try to cleanup pthread's stacks.  Since we are
using custom stacks in JVM (malloc()'ed ones) libc_r attempts
to free() them.  Most times everything goes right, but sometimes
(very rarely) SIGBUS is being generated while free()'ing of stacks.

more details: it's RELENG_4
from trace (sorry, i accidiently deleted complete trace), but
from memory can restore following points:

libc_r/uthread/uthread_fork.c:154 -- <free() called here>
[..]
libc/stdlib/malloc.c:606 -- <KABOOM here>

Any ideas on reasons ?

PS: BTW, it's looks very similar to "red zone" violation in protection,
but since problem appears after __sys_fork() call - it should not be
a problem.  Am I right ?



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