- To: bugs@gnu.org
- Subject: libc/836: There appears to be a bug in the sigmask handling in Linuxthreads.
- From: wtjones@widowmaker.com
- Date: Sun, 25 Oct 1998 20:41:44 -0500
- Reply-To: wtjones@widowmaker.com
- Resent-Cc: gnats-admin@gnu.org
- Resent-Reply-To: bugs@gnu.org, wtjones@widowmaker.com
- Resent-To: libc-gnats@gnu.org
>Number: 836
>Category: libc
>Synopsis: There appears to be a bug in the sigmask handling in Linuxthreads.
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: libc-gnats
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Sun Oct 25 20:50:01 EST 1998
>Last-Modified:
>Originator: wtjones@widowmaker.com
>Organization:
net
>Release: glibc-2.0.7-19
>Environment:
Red Hat Linux release 5.1 (Manhattan)
Kernel 2.0.35 on an alpha
gcc version egcs-2.90.29 980515 (egcs-1.0.3 release)
>Description:
Running mySQL version 3.22.9-beta database server (http://www.tcx.se) on alpha
under Red Hat Linux 5.1. Server randomly "locks up". Response from mySQL
developer and output from gdb follows:
It dies in the following command:
pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
This means that there is a bug in the sigmask handling in Linuxthreads
on Alpha Linux. Can you forward a bug about this to some Alpha-linux
developer!
William> #3 0x1200f0f40 in thr_alarm (alrm=0x11ffff368, sec=28800) at
William> thr_alarm.c:163
William> 163 pthread_sigmask(SIG_SETMASK,&old_mask,NULL);
William> (gdb) info locals
William> alarm_data = (ALARM *) 0x1202e47d8
William> now = 909193289
William> old_mask = {__val = {537018373, 0 <repeats 15 times>}}
William> reschedule = 1 '\001'
William> _db_func_ = 0x0
William> _db_file_ = 0x0
William> _db_level_ = 536869952
William> _db_framep_ = (char **) 0x100000000
The above shows that 'old_mask' is ok and this isn't a bug in the call!
The bug probably happens when one changes the signal mask at the same
time the master thread handles a signal (wild guess).
I thought this might be related to
"PR number 798...Possible pthreads bug with glibc-2.0.7"
Thanks in advance,
wtj
>How-To-Repeat:
Build mySQL 3.22.9-beta on alpha as follows:
`CC=gcc CFLAGS="-fomit-frame-pointer" CXX=gcc CXXFLAGS="-fomit-frame-pointer -fel
ide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysq
l --with-mysqld-ldflags=-all-static --with-debug`
Debug as...
%gdb libexec/mysqld
(gdb)run --one-thread
Starting program: ./sql/mysqld --one-thread
Program received signal SIGUSR1, User defined signal 1.
__sigsuspend () at ../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42
../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42: No such file or directory.
Current language: auto; currently asm
(gdb) c
Continuing.
Program received signal SIGUSR1, User defined signal 1.
__sigsuspend () at ../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42
../sysdeps/unix/sysv/linux/alpha/sigsuspend.S:42: No such file or directory.
(gdb) c
Continuing.
./sql/mysqld: ready for connections
Now, in another shell, repeatedly execute
`bench/run-all-tests --lock-tables --small-test` until gdb says...
Program received signal SIGSEGV, Segmentation fault.
0x120139408 in __osf_sigprocmask () at __osf_sigprocmask:2
__osf_sigprocmask:2: No such file or directory.
(gdb) bt
#0 0x120139408 in __osf_sigprocmask () at __osf_sigprocmask:2
#1 0x120117240 in __sigprocmask (how=3, set=0x20024005, oset=0x0)
at ../sysdeps/unix/sysv/linux/alpha/sigprocmask.c:43
#2 0x12011214c in pthread_sigmask (how=3, newmask=0x20024005, oldmask=0x0)
at signals.c:45
#3 0x1200f2180 in thr_alarm (alrm=0x11ffff418, sec=3) at thr_alarm.c:163
#4 0x120045548 in my_real_read (net=0x1202e4020, complen=0x11ffff450)
at net_serv.c:460
#5 0x120045ad4 in my_net_read (net=0x1202e4020) at net_serv.c:576
#6 0x120054b94 in check_connections ()
#7 0x1200553e0 in handle_one_connection ()
#8 0x12004e5f0 in create_new_thread ()
#9 0x12004f088 in handle_connections_sockets ()
#10 0x12004e118 in main ()
(gdb)
May take as many as six executions of `run-all-tests...` but it WILL FAIL
>Fix:
>Audit-Trail:
>Unformatted: