Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jan 2008 16:13:02 -0500 (EST)
From:      Daniel Eischen <eischen@vigrid.com>
To:        Landon Fuller <landonf@bikemonkey.org>
Cc:        freebsd-threads@freebsd.org
Subject:   Re: threads/119920: fork broken in libpthread
Message-ID:  <Pine.GSO.4.64.0801291611130.12689@sea.ntplx.net>
In-Reply-To: <488DBC6A-CF33-4E50-B1BB-C396C8957F92@bikemonkey.org>
References:  <200801240850.m0O8o2JQ023500@freefall.freebsd.org> <4798564B.7070500@elischer.org> <Pine.GSO.4.64.0801240957550.16059@sea.ntplx.net> <488DBC6A-CF33-4E50-B1BB-C396C8957F92@bikemonkey.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 29 Jan 2008, Landon Fuller wrote:

>
> On Jan 24, 2008, at 07:08, Daniel Eischen wrote:
>
>> On Thu, 24 Jan 2008, Julian Elischer wrote:
>> 
>>> Gary Stanley wrote:
>>>> The following reply was made to PR threads/119920; it has been noted by
>>>> GNATS.
>>>> 
>>>> From: Gary Stanley <gary@velocity-servers.net>
>>>> To: bug-followup@FreeBSD.org
>>>> Cc:  Subject: Re: threads/119920: fork broken in libpthread
>>>> Date: Thu, 24 Jan 2008 03:24:47 -0500
>>>> 
>>>> I also have this problem, see threads/118715
>>>>  I was able to grab some ktrace info, but most of the time the process 
>>>> is
>>>> stuck, and ktrace doesn't display any data.
>>>> _______________________________________________
>>>> freebsd-threads@freebsd.org mailing list
>>>> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
>>>> To unsubscribe, send any mail to 
>>>> "freebsd-threads-unsubscribe@freebsd.org"
>>> 
>>> dan what IS the fix for this?  I assume you must have fixed it in 
>>> -current/7
>> 
>> You want cvs diff -u -r1.126 -r1.128 src/lib/libkse/thread/thr_kern.c.
>> The WARNS'ify diffs are not necessary, so it should look something
>> like shown below.  Probably an MFC of all of libkse (minus jasone's
>> malloc changes) should be done to -7 and -6.
>
> There appears to be a remaining issue I'm still seeing locally, with the 
> above patch; I wasn't able to reproduce this on 6.2:
>
> #0  0x0000000800648b13 in mutex_lock_common (curthread=0x0, m=0x8007616e8, 
> abstime=0x0) at /usr/src/lib/libpthread/thread/thr_mutex.c:503
> #1  0x000000080064ac25 in _pthread_mutex_lock (m=0x8007616e8) at 
> /usr/src/lib/libpthread/thread/thr_mutex.c:868
> #2  0x000000080063e9ce in _spinlock (lck=0x8009ac200) at 
> /usr/src/lib/libpthread/thread/thr_spinlock.c:97
> #3  0x00000008007eafc3 in pubrealloc (ptr=0x0, size=24, func=0x8008802b7 " in 
> malloc():") at /usr/src/lib/libc/stdlib/malloc.c:1090
> #4  0x00000008007eb1e1 in malloc (size=24) at 
> /usr/src/lib/libc/stdlib/malloc.c:1150
> #5  0x000000080065ab8c in _lockuser_init (lu=0x52e068, priv=0x52e000) at 
> /usr/src/lib/libpthread/sys/lock.c:99

There is a bug somewhere else or something is stomping
on the thread's lockuser.  It is allocated once when the
thread is created and should never be null thereafter.
Hence, it should never be malloc'd and the reinit should
be sufficient.

-- 
DE



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