MySQL crash on remote access

Kevin D. Clark kclark at CetaceanNetworks.com
Mon Jan 20 09:13:32 EST 2003


"Ted Roche" <tedroche at tedroche.com> writes:

> I've installed RedHat 8.0 and all of it's updates onto a wireless laptop,
> including MySQL. This is a prototype machine inside the firewall, so no
> firewall software installed.

...
> Searching Google for this brought up a closed Bugzilla report on the Red Hat
> site
> (http://216.239.57.100/search?q=cache:HtegkiFgqk0C:bugzilla.redhat.com/bugzi
> l
> la/show_bug.cgi%3Fid%3D75128+mysqld+process+hanging&hl=en&ie=UTF-8).

Bad wrap, BTW.

> Changing the thread-stack variable seemed to have no effect, but adding the
> hostname of the calling machine to the local /etc/hosts file did cure the
> problem, from that one machine. Other machines, not listed in the hosts
> file, continue to crash MySQL.
>
> So. I suspect the problem is a network configuration issue, where MySQL is
> crashing on trying to resolve the hostname of the incoming request. I am a
> Linux newbie, and not a networking heavyweight, so I'd appreciate some
> pointers on how hostname resolution works and what I might try to, er,
> resolve the problem. Thanks in advance!

It looks to me like the MySQL code sets its thread-stacks to be too
small, which causes some part of the MySQL server to crash when
calling gethostbyname().  It seems probable that on your system
gethostbyname() is doing a DNS lookup to get information about the
given host (this takes a fair amount of stack space).  But when you
add a host locally to your /etc/hosts file, a DNS lookup isn't
performed (this likely takes up much less stack space than a DNS
lookup).  The file that governs how your system looks up host
information is /etc/nsswitch.conf, and the entry you want to look for
is "hosts".

It seems likely that the "knob" to change the "thread-stack variable"
isn't hooked up to anything.  This isn't unsurprising, but it is a
MySQL bug.

I've looked at this bug report and I don't understand how RedHat
closed this bug -- there's no clear resolution here.

How should you fix this?  The following things come to mind:

1:  If you paid RedHat for support, pester them.

2:  If you know *all* of the hosts that can ever connect to your
    MySQL server, add them to your /etc/hosts file.  Remember:  this
    is a temporary kludge, and remember what can happen if a host that
    doesn't exist in your /etc/hosts file tries to connect to your
    MySQL server....

3:  You might try compiling MySQL from source as well.  I'll bet that
    the mainline MySQL code (probably even newer than RedHat's
    version) has fixed this bug.  Otherwise, addressing a bug like
    this would be straightforward (hint:  pthread_attr_setstacksize())

Hope this helps,

--kevin
-- 
Kevin D. Clark / Cetacean Networks / Portsmouth, N.H. (USA)
cetaceannetworks.com!kclark (GnuPG ID: B280F24E)
alumni.unh.edu!kdc




More information about the gnhlug-discuss mailing list