Bug 74943 - mysqld segfaults on remote connections
mysqld segfaults on remote connections
Status: CLOSED DUPLICATE of bug 77467
Product: Red Hat Linux
Classification: Retired
Component: mysql (Show other bugs)
i686 Linux
high Severity medium
: ---
: ---
Assigned To: Patrick Macdonald
David Lawrence
: the_undying_bug (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2002-10-02 18:59 EDT by Prasad Ullal
Modified: 2007-03-26 23:57 EDT (History)
23 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-11-28 21:38:19 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Prasad Ullal 2002-10-02 18:59:19 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 

Description of problem:
When remote connections are attempted to the mysql server (version 3.23.52) it 
segfaults and is restarted by safe_mysqld. On the remote side the client 
complains of 'Lost connection during query'.

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

How reproducible:

Steps to Reproduce:
1.Start the server: /etc/init.d/mysqld start
2.Create an account for remote access
3.From the remote machine try to connect to the server.

Actual Results:  The server dies and is restarted by safe_mysqld. At any given 
time only one instance of mysqld remains running.

Expected Results:  A normal connection.

Additional info:
Comment 1 Need Real Name 2002-10-03 09:33:36 EDT
I've the SAME problem.
MySQL work with replication and local socket connections, but if i connect from a remote
host i get the same error.

davidegiunchi (at) libero.it
Comment 2 Andreas Thienemann 2002-10-06 09:20:03 EDT
Verified here.

Same problem on a box running the null beta...
Comment 3 Andreas Thienemann 2002-10-06 12:58:20 EDT
An strace of the mysqld process shows that it is segfaulting after setting some

fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0  
accept(3, {sin_family=AF_INET, sin_port=htons(45766),
sin_addr=inet_addr("")}}, [16]) = 7  
fcntl64(3, F_SETFL, O_RDWR)             = 0  
getsockname(7, {sin_family=AF_INET, sin_port=htons(3306),
sin_addr=inet_addr("")}}, [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)                              = 1033923183  
write(6, "\200\300\2@\0\0\0\0\340\2547\0100\377\16\10\220o>\10\5"..., 148) = 148  
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
select(5, [3 4], NULL, NULL, NULL)      = ? ERESTARTNOHAND (To be restarted)  
--- SIGSEGV (Segmentation fault) ---
Comment 4 David Martos 2002-10-07 17:34:51 EDT
I have the same problem connecting from a remote server.
Comment 5 Robert Greimel 2002-10-08 04:54:28 EDT
Same here. Worked fine under 7.x but after upgrade to 8.0 remote connections to
mysqld crash the daemon with a segfault. Downgrading mysqld to the version used
in 7.3 did NOT help and the same problem was observed with remote connections.
Comment 6 Andreas Thienemann 2002-10-08 07:14:16 EDT
mysqld does work when started with the parameter --skip-name-resolve or 
the "skip-name-resolv" entry is added to the mysqld part of /etc/my.cnf.

Thus I'd assume the problem is in the shared resolver libs, as it makes no 
difference if a known good mysqld from RH 7.3 is installed.

Problem with the above mentioned workaround is that the GRANT tables in mysqld 
only work with IPs and not with hostnames anymore. Thus users have to be 
allowed access with numerical IPs.
Comment 7 Prasad Ullal 2002-10-09 01:45:50 EDT
Thought I'd change the priority to high: MySQL is still popular with many 
admins but RedHat has seems to have given it a back seat (PostGRE gets 
installed if you select the default 'SQL server' in the installer).

Anyhow, this is apparently a glibc problem... something to do with the resolver 
function. It seems downgrading to the version prior to the glibc-2.2.5-
40 'fixes' the issue. Checkout the bug #75297.
Comment 8 StK 2002-10-09 05:00:46 EDT
Connecting though a ssl-tunnel is possible!
Comment 9 Datadink 2002-10-11 21:07:47 EDT
Same problem here.  Stock RedHat 8.0 install done from scratch.  Besides the 
2013 - Lost connection to MySQLserver during query error., I am also getting 
SQL syntax errors on pages that used to work under RedHat 7.3 (You have an 
error in your SQL syntax near '' at line 1).  I have heard that it may be a 
query error but these same pages worked fine in the previous version.  Any help 
would be appreciated.
Comment 10 Paulo Barreto 2002-10-17 17:21:57 EDT
...andreas was correct about the --skip-name-resolve parameter, and that give 
me an idea...

...I solved the problem adding the ip and hostname of the remote machine 
to /etc/hosts where mysqld is running.

This is strange because DNS resolution is working fine in both server and 
client computers. 

Comment 11 Andreas Thienemann 2002-10-18 06:43:47 EDT
Yes, adding the host to /etc/hosts is another possible workaround. But this does
not work well if you get updates from dynamic hosts.

Also, AFAIK, the lookup of host from the hosttable is different than doing the
same lookup via reverse DNS. This is also the reason why localhost connections
work, as localhost is usually defined in /etc/hosts.

To RedHat: Could we please get a bit of feedback about this? Status is still NEW
and we have seen several people commenting about this 2 week old BugReport.
Additionally I heard about several people who have this problem on their
productive servers now, which is a bad thing [tm].
Comment 12 Lars Andre Landas 2002-10-18 07:37:33 EDT
This problem is even bigger on RedHat 7.3 with the latest glibc installed. The
problem don't show up before you restart the mysql-server. This problem can be
hard to track down, if you don't restart the mysql deamon several weeks after
you updatet your system.

Another concern:
Shouldn't it be safe to run up2date?
Comment 13 Bryan White 2002-10-18 13:44:49 EDT
For what it's worth...
Updating glibc and nscd to a version from rawhide solved the problem on my
boxes.  Version from rawhide that I got was 2.3-2. 

Comment 14 Andreas Thienemann 2002-10-18 17:27:22 EDT
confirmed here.

Comment 15 Need Real Name 2002-10-26 02:19:52 EDT
I have recently installed 2 machines with RedHat 8.0 - stock install. On the 
one machine, connecting remotely worked fine. However, on the 2nd machine, I 
can't get it to work, and have resorted to using skip-name-resolve instead.

I have checked the versions of glibc and they are the same on both machines. 
The only difference I can think of at the moment is hardware and drivers - one 
is a P4, the other a P3. The P4 has onboard lan, the P3 has a cheap accton card.
Comment 16 Prasad Ullal 2002-10-30 11:42:33 EST
Here's another my.cnf fix that seems to work (under [mysqld]):


Comment 17 Florus Both 2002-11-11 08:47:20 EST
I did the last suggested additions to my.cnf and that solved this problem for 

Comment 18 Need Real Name 2002-11-11 15:27:58 EST
i'm still having the same problem with remote connection

mysqld log
021111 11:34:03  /usr/libexec/mysqld: Normal shutdown

021111 11:34:03  InnoDB: Starting shutdown...
A mysqld process already exists at  Mon Nov 11 11:34:04 PST 2002
021111 11:34:05  InnoDB: Shutdown completed
021111 11:34:05  /usr/libexec/mysqld: Shutdown Complete

021111 11:34:05  mysqld ended



Comment 19 Joern 2002-11-14 04:22:17 EST
Hi there,

I don't know, if the problem I have has the same reason. I installed redhat 
8.0 on a P4 Machine (Dell Inspiron Notebook) with PHP and MYSQL. I also put 
phpmyadmin on the machine. Calling PHPINFO(); does not show any MySQL support 
and starting phpmyadmin over the localhost shows errors (Cannot load MySQL 
extension). After looking in the usr/lib/php4, there's no mysql.so located.

Any idea or suggestions ? I'm a linux newbie and its hard for me to find any 
help on this....
Comment 20 Chris Ricker 2002-11-14 09:27:00 EST
js@alphasystems.com, you have a different problem.  RH comes with MySQL support
for PHP, but it's not installed by default.  Install the php-mysql-4.2.2-8.0.5
rpm on your system (it's on one of your CDs), restart apache, and you should be
all set.
Comment 21 aguszainal 2002-11-28 21:38:12 EST
yeap....i had the same problem with both my redhat 8.0 machines...hopefully a 
bugfix will come asap sinces one of them is the production server.
Comment 22 Joe Orton 2002-12-12 07:27:25 EST

*** This bug has been marked as a duplicate of 77467 ***
Comment 23 boyet 2003-01-24 16:23:14 EST
*** Bug 82582 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.