Bug 74943 - mysqld segfaults on remote connections
Summary: mysqld segfaults on remote connections
Keywords:
Status: CLOSED DUPLICATE of bug 77467
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mysql
Version: 8.0
Hardware: i686
OS: Linux
high
medium
Target Milestone: ---
Assignee: Patrick Macdonald
QA Contact: David Lawrence
URL:
Whiteboard:
: the_undying_bug (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-10-02 22:59 UTC by Prasad Ullal
Modified: 2007-03-27 03:57 UTC (History)
23 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-11-29 02:38:19 UTC
Embargoed:


Attachments (Terms of Use)

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

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:
Always

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 13:33:36 UTC
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 13:20:03 UTC
Verified here.

Same problem on a box running the null beta...

Comment 3 Andreas Thienemann 2002-10-06 16:58:20 UTC
An strace of the mysqld process shows that it is segfaulting after setting some
socketoptions...

fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0  
accept(3, {sin_family=AF_INET, sin_port=htons(45766),
sin_addr=inet_addr("193.197.10.99")}}, [16]) = 7  
fcntl64(3, F_SETFL, O_RDWR)             = 0  
getsockname(7, {sin_family=AF_INET, sin_port=htons(3306),
sin_addr=inet_addr("217.67.231.219")}}, [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  
rt_sigprocmask(SIG_SETMASK, NULL, [HUP QUIT PIPE TERM TSTP RTMIN], 8) = 0  
write(6, "\200\300\2@\0\0\0\0\340\2547\0100\377\16\10\220o>\10\5"..., 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) ---

Comment 4 David Martos 2002-10-07 21:34:51 UTC
I have the same problem connecting from a remote server.

Comment 5 Robert Greimel 2002-10-08 08:54:28 UTC
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 11:14:16 UTC
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 05:45:50 UTC
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 09:00:46 UTC
Connecting though a ssl-tunnel is possible!

Comment 9 Datadink 2002-10-12 01:07:47 UTC
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 21:21:57 UTC
...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 10:43:47 UTC
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 11:37:33 UTC
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 17:44:49 UTC
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 21:27:22 UTC
confirmed here.

GREAT!

Comment 15 Need Real Name 2002-10-26 06:19:52 UTC
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 16:42:33 UTC
Here's another my.cnf fix that seems to work (under [mysqld]):

set-variable=max_allowed_packet=16M
set-variable=thread_stack=1M

Prasad

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

Florus

Comment 18 Need Real Name 2002-11-11 20:27:58 UTC
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


my.cnf
mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
set-variable=max_allowed_packet=16M
set-variable=thread_stack=1M

[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


Comment 19 Joern 2002-11-14 09:22:17 UTC
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 14:27:00 UTC
js, 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-29 02:38:12 UTC
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 12:27:25 UTC

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

Comment 23 boyet 2003-01-24 21:23:14 UTC
*** 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.