Bug 75290

Summary: remote access crashes mysqld with seg fault
Product: [Retired] Red Hat Linux Reporter: Joe Christy <joe.christy>
Component: mysqlAssignee: Patrick Macdonald <patrickm>
Status: CLOSED DUPLICATE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.3CC: acox, adler, claudio.rossi, elliotp, elsenbeck, gbailey, herrold, holger, jn, joe.christy, mk, pacman128, rdieter, trevor, vhansen, yiango
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-11-04 05:49:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joe Christy 2002-10-06 22:15:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020827

Description of problem:
Remote access to mysqld [mysql-server-3.23.49-3] crashes server.
Curiously, this only occurs with glibc-2.2.5-40, not with glibc-2.2.5-39. Cf.
bug 75128, where jakub claims that this is a mysql bug, not a glibc bug.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.On sever machine w/ mysql-server-3.23.49-3 & glibc-2.2.5-40, start mysql,
attach with mysql client as privileged user and:

mysql> use mysql
mysql> GRANT ALL PRIVILEGES ON test.* TO tester@<client-machine>;

2.On any client machine (not necessarily even running Linux):

%  mysql --host=<server-machine> --user tester

	

Actual Results:  On client machine:

% mysql --host=<server-machine> --user tester
ERROR 2013: Lost connection to MySQL server during query

In server machine's mysqld.log:

Number of processes running now: 1
mysqld process hanging, pid <NNNNN> - killed
021006 <HH:MM:SS>  mysqld restarted



Expected Results:  %  mysql --host=<server-machine> --user tester
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 3.23.49

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Additional info:

One mysqld thread dies, and safe_mysqld kills the others.

strace of thread which dies reveals:

select(5, [3 4], NULL, NULL, NULL)      = 1 (in [3])
fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
accept(3, {sin_family=AF_INET, sin_port=htons(33104),
sin_addr=inet_addr("10.10.10.16")}}, [16]) = 7
fcntl64(3, F_SETFL, O_RDWR)             = 0
getsockname(7, {sin_family=AF_INET, sin_port=htons(3306),
sin_addr=inet_addr("10.10.10.130")}}, [16]) = 0
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
setsockopt(7, SOL_IP, IP_TOS, [8], 4)   = 0
setsockopt(7, SOL_TCP, TCP_NODELAY, [1], 4) = 0
time(NULL)                              = 1033940661
rt_sigprocmask(SIG_SETMASK, NULL, [HUP QUIT PIPE TERM TSTP RTMIN], 8) = 0
write(6, "\240P\4@\0\0\0\0\340\2279\10@\240\r\10\250\24>\10\5P\10"..., 148) = 148
rt_sigprocmask(SIG_SETMASK, NULL, [HUP QUIT PIPE TERM TSTP RTMIN], 8) = 0
rt_sigsuspend([HUP QUIT PIPE TERM TSTP] <unfinished ...>
--- SIGRTMIN (Real-time signal 0) ---
<... rt_sigsuspend resumed> )           = -1 EINTR (Interrupted system call)
sigreturn()                             = ? (mask now [HUP QUIT PIPE TERM TSTP
RTMIN])
select(5, [3 4], NULL, NULL, NULL)      = ? ERESTARTNOHAND (To be restarted)
--- SIGSEGV (Segmentation fault) ---

Something similar apparently happens with Red Hat 8.0, cf. bug 74943

!!! For my site, this is a security problem as it kills mysql logging inside my
firewall from the snort IDS sensor I have running outside my firewall. Please
fix this ASAP.

Comment 1 Aran Cox 2002-10-10 16:07:59 UTC
This bug is the same as 75297.  

I also experienced this on a uni-processor system.  However, I did not have to
do an ldconfig or reboot to fix it.  I simply downgraded to glibc-2.2.5-39 and
restarted mysql.  

Remote connections kill mysql, but local connections (TCP or UNIX socket) do not
cause MySQL to die.

Comment 2 Vegard Hanssen 2002-10-14 16:00:25 UTC
I have the same problem on almost RH7.0-8.0 versions with the latest  
mysql/glibc.  
  
glibc-2.2.4-30 and mysql-3.23.36-1 on RH7.1  
glibc-2.2.4-18.7.0.7 and mysql-3.23.32-1.7 on RH7.0  
glibc-2.2.93-5 and mysql-3.23.52-3 on RH8.0  
glibc-2.2.5-40 and mysql-3.23.49-3 on RH7.3

Comment 3 Joe Orton 2002-12-12 12:29:23 UTC

*** This bug has been marked as a duplicate of 77467 ***

Comment 4 Salvatore Giudice 2004-02-09 20:29:13 UTC
For all who stumble upon this problem, here's the solution:

start mysql with:
/usr/local/bin/safe_mysqld --thread-stack=192K &