From nobody@FreeBSD.ORG Mon Jul 12 19:00:43 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 97F1E14C4A; Mon, 12 Jul 1999 19:00:43 -0700 (PDT)
Message-Id: <19990713020043.97F1E14C4A@hub.freebsd.org>
Date: Mon, 12 Jul 1999 19:00:43 -0700 (PDT)
From: nara@magewar.com
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: thread library bug
X-Send-Pr-Version: www-1.0

>Number:         12617
>Category:       kern
>Synopsis:       thread library bug
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jul 12 19:10:01 PDT 1999
>Closed-Date:    Thu Aug 12 13:08:19 PDT 1999
>Last-Modified:  Thu Aug 12 13:10:49 PDT 1999
>Originator:     Jiho Kim
>Release:        3.2
>Organization:
Mari Telecom
>Environment:
FreeBSD arch9.magewar.com 3.2-RELEASE FreeBSD 3.2-RELEASE #0: Mon May 24 05:44:59 PDT 1999     root@arch4a.magewar.com:/usr/src/sys/compile/ARCHMAGE  i386
>Description:
i used gdb on mysql and find quite interesting result.
here is log from gdb.
 
arch9# gdb /usr/local/libexec/mysqld mysqld.core
GNU gdb 4.18
Copyright 1998 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 "i386-unknown-freebsd"...
(no debugging symbols found)...
Core was generated by `mysqld'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libc_r.so.3...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libcrypt.so.2...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libstdc++.so.2...(no debugging symbols found)...
done.
Reading symbols from /usr/lib/libm.so.2...(no debugging symbols found)...done.
Reading symbols from /usr/lib/libc.so.3...(no debugging symbols found)...done.
Reading symbols from /usr/libexec/ld-elf.so.1...(no debugging symbols found)...
done.
#0  0x281531f1 in _mutex_notify_priochange () from /usr/lib/libc_r.so.3
(gdb) up
#1  0x28152323 in pthread_mutex_lock () from /usr/lib/libc_r.so.3
(gdb) up
#2  0x28162aa9 in localtime_r () from /usr/lib/libc_r.so.3
(gdb) up
#3  0x8064d18 in Field_timestamp::val_str ()
(gdb) up
#4  0x804b88a in Item_field::str ()
(gdb) 
 
it seems to me that there is VERY SERIOUS problem in libc_r and thread library.
it was fine in RELEASE-3.1, but, in RELEASE-3.2, it isn't.
 
 
Jiho Kim
nara@magewar.com
http://archmage.magewar.com/archmage
>How-To-Repeat:
do heavy load on mysql 

>Fix:


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: deischen 
State-Changed-When: Wed Aug 4 04:52:59 PDT 1999 
State-Changed-Why:  
Statically allocated mutexes and condition variables were 
not properly initialized.  This was fixed in -current at 
the time the PR was submitted, but was not commited to 
-stable until recently. 

I have tested localtime_r and it works as expected (no SIGSEGV). 
I will close this PR in a week or so if I don't hear back from 
the originator. 
State-Changed-From-To: feedback->closed 
State-Changed-By: deischen 
State-Changed-When: Thu Aug 12 13:08:19 PDT 1999 
State-Changed-Why:  
No response during feedback state and my testing shows the problem has 
been fixed. 
>Unformatted:
