>Description:
I'm seeing random hung reads() after a mysql insert that appears to be
related to a sig alarm race condition.  The basic workflow of this program
is

while (1)
   recvfrom() /* few hundred packets a sec */
   parse packet
   insert into sql

However, once per second a sig alarm is generated which does house keeping
and what-not.   This will work for minutes or hours, but eventually the
read(3, ...) blocks , which is the mysql socket.  When this occurs you just
see the repeated sig alarms being catch, but immediately returning to that
read() which never returns.  Note there is still hundreds of udp packets
coming in but never able to be read because the never-returing read(3,) on
the mysql sock.

Normal syscalls resemble:

write(3, "\1\1\0\0\3INSERT INTO call_logging.de"..., 261) = 261
read(3, "\3\0\0\1", 4)                  = 4
read(3, "\0\1\0", 3)                    = 3
recvfrom(5, "...") = 398

When the condition occurs:

read(3, 0x814a6b0, 4)                   = ? ERESTARTSYS (To be restarted)
--- SIGALRM (Alarm clock) ---
time(NULL)                              = 1014267832
rt_sigaction(SIGALRM, {SIG_IGN}, {0x4002fa10, [ALRM], SA_RESTART|0x4000000}, 8)
= 0
alarm(1)                                = 0
rt_sigaction(SIGALRM, {0x4002fa10, [ALRM], SA_RESTART|0x4000000}, {SIG_IGN}, 8)
= 0
sigreturn()                             = ? (mask now [])
read(3, 0x814a6b0, 4)                   = ? ERESTARTSYS (To be restarted)
--- SIGALRM (Alarm clock) ---
time(NULL)                              = 1014267833
rt_sigaction(SIGALRM, {SIG_IGN}, {0x4002fa10, [ALRM], SA_RESTART|0x4000000}, 8)
= 0
alarm(1)                                = 0
rt_sigaction(SIGALRM, {0x4002fa10, [ALRM], SA_RESTART|0x4000000}, {SIG_IGN}, 8)
= 0
sigreturn()                             = ? (mask now [])
read(3, 0x814a6b0, 4)                   = ? ERESTARTSYS (To be restarted)
--- SIGALRM (Alarm clock) ---

>Fix:
Have to restart entire program to get it working again.

>Submitter-Id:  [EMAIL PROTECTED]
>MySQL support: none
>Synopsis:      sig alarm hangs read
>Severity:      critical
>Priority:      high
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.49 (Official MySQL Binary)
>Server: /usr/local/mysql/bin/mysqladmin  Ver 8.23 Distrib 3.23.49, for pc-linux-gnu 
>on i686
Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Server version          3.23.49
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /tmp/mysql.sock
Uptime:                 17 hours 21 min 38 sec

Threads: 2  Questions: 3721598  Slow queries: 2  Opens: 227  Flush tables: 1  Open 
tables: 7 Queries per second avg: 59.547
>Environment:
        
System: Linux mmlog2 2.4.9-21smp #1 SMP Thu Jan 17 14:01:48 EST 2002 i686 unknown
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs
gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)
Compilation info: CC='gcc'  CFLAGS='-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch 
-Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec 
-Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -mcpu=pentiumpro 
-O3 -fno-omit-frame-pointer'  CXX='gcc'  CXXFLAGS='-Wimplicit -Wreturn-type 
-Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat 
-Wimplicit-function-dec -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings 
-Woverloaded-virtual -Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy 
-Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -mcpu=pentiumpro -O3 
-fno-omit-frame-pointer'  LDFLAGS=''
LIBC: 
lrwxrwxrwx    1 root     root           13 Feb 19 06:53 /lib/libc.so.6 -> libc-2.2.4.so
-rwxr-xr-x    1 root     root      1283964 Dec  8 07:14 /lib/libc-2.2.4.so
-rw-r--r--    1 root     root     27314296 Dec  8 07:02 /usr/lib/libc.a
-rw-r--r--    1 root     root          178 Dec  8 07:02 /usr/lib/libc.so
Configure command: ./configure --prefix=/usr/local/mysql --enable-assembler 
--with-extra-charsets=complex --enable-thread-safe-client 
--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static 
--with-other-libc=/usr/local/mysql-glibc '--with-comment=Official MySQL Binary' 
--prefix=/usr/local/mysql --with-extra-charset=complex --enable-thread-safe-client 
--enable-local-infile 'CFLAGS=-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch 
-Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec 
-Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -mcpu=pentiumpro 
-O3 -fno-omit-frame-pointer' 'CXXFLAGS=-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch 
-Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-function-dec 
-Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual 
-Wextern-inline -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor 
-felide-constructors -fno-exceptions -fno-rtti -mcpu=pentiumpro !
-O3 -fno-omit-frame-pointer' CXX=gcc


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to