From grog@lemis.com  Wed May 24 04:40:32 2006
Return-Path: <grog@lemis.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8F3CC16A421
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 24 May 2006 04:40:32 +0000 (UTC)
	(envelope-from grog@lemis.com)
Received: from ext-gw.lemis.com (ext-gw.lemis.com [150.101.14.10])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 88F1943D49
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 24 May 2006 04:40:29 +0000 (GMT)
	(envelope-from grog@lemis.com)
Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135])
	by ext-gw.lemis.com (Postfix) with ESMTP id 74BC2131E1F;
	Wed, 24 May 2006 14:10:28 +0930 (CST)
Received: by wantadilla.lemis.com (Postfix, from userid 1004)
	id 5B55686F5B; Wed, 24 May 2006 14:10:28 +0930 (CST)
Message-Id: <20060524044028.GF84305@wantadilla.lemis.com>
Date: Wed, 24 May 2006 14:10:28 +0930
From: Greg 'groggy' Lehey <grog@FreeBSD.org>
To: Pavel Merdin <fbug1@merdin.com>
Cc: freebsd-gnats-submit@FreeBSD.org
In-Reply-To: <200604061531.k36FV8kZ031554@www.freebsd.org>
Subject: Re: pthread segmentation fault
References: <200604061531.k36FV8kZ031554@www.freebsd.org>

>Number:         97769
>Category:       amd64
>Synopsis:       Re: amd64/95418: pthread segmentation fault
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    grog
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 24 04:50:16 GMT 2006
>Closed-Date:    Wed May 24 19:37:19 GMT 2006
>Last-Modified:  Wed May 24 19:37:19 GMT 2006
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 --Pgaa2uWPnPrfixyx
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Thursday,  6 April 2006 at 15:31:08 +0000, Pavel Merdin wrote:
 >
 >> Description:
 > The pthread library forces mysql 4.1.18-log to crash with a message like:
 > Feb 19 14:26:00 kernel: pid 33539 (mysqld), uid 1001: exited on signal 11
 >
 > It happens when mysql is heavily used.
 >
 > Program received signal SIGSEGV, Segmentation fault.
 > 0x0000000800d13aff in _thr_gc (curthread=0x925000)
 >     at /usr/src/lib/libpthread/thread/thr_kern.c:1343
 > 1343                    TAILQ_INSERT_HEAD(&worklist, kseg, kg_qe);
 > Current language:  auto; currently c
 > No locals.
 >
 > 0x800d13afb <_thr_gc+1467>:     lea    0x20(%rbx),%rdx
 > 0x800d13aff <_thr_gc+1471>:     mov    %rdx,0x28(%rax)
 
 This appears to be another manifestation of the bug reported as MySQL
 BUG#19496 at http://bugs.mysql.com/bug.php?id=19496.  As you state,
 libraries compiled without optimization don't fail.  On the other
 hand, newer libraries compiled with optimization but with the patch
 described in PR 95127 also do not fail.  I'm assuming therefore:
 
 1.  This is a real code bug, not a compiler bug.
 2.  Compiling without optimization drives it into hiding.
 
 Could you please apply the following patch (to
 /usr/src/lib/libpthread/thread/thr_kern.c) and let me know whether the
 bug still occurs?  You'll need to reinstall the library
 (/usr/src/lib/libpthread/libpthread.so.2) or install it elsewhere and
 use LD_LIBRARY_PATH to point to it.
 
 --- thr_kern.c  3 Jan 2006 15:34:27 -0000       1.120
 +++ thr_kern.c  16 Feb 2006 01:33:36 -0000      1.121
 @@ -1337,6 +1337,7 @@
 
         if (free_kseg_count <= MAX_CACHED_KSEGS)
                 return;
 +       TAILQ_INIT(&worklist);
         crit = _kse_critical_enter();
         KSE_LOCK_ACQUIRE(curthread->kse, &kse_lock);
         while (free_kseg_count > MAX_CACHED_KSEGS) {
 
 Greg
 --
 See complete headers for address and phone numbers.
 
 --Pgaa2uWPnPrfixyx
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (FreeBSD)
 
 iD8DBQFEc+O8IubykFB6QiMRAtznAJ4wg4rgMZU7JmKXTmNG6PxDFZtt2gCfbBza
 WdUzl38Xg+jujBKEgW40cB8=
 =kTSc
 -----END PGP SIGNATURE-----
 
 --Pgaa2uWPnPrfixyx--
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Wed May 24 19:36:20 UTC 2006 
State-Changed-Why:  
Misfiled followup to amd64/95418; content migrated. 


Responsible-Changed-From-To: gnats-admin->grog 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Wed May 24 19:36:20 UTC 2006 
Responsible-Changed-Why:  

http://www.freebsd.org/cgi/query-pr.cgi?pr=97769 
>Unformatted:
