#16272 [Com]: SegFault in MySQL

From: Date: Wed, 07 Aug 2002 17:42:17 +0000
Subject: #16272 [Com]: SegFault in MySQL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16195@lists.php.net to get a copy of this message
 ID:               16272
 Comment by:       db@dbinteractive.com
 Reported By:      jweiss@greyzone.com
 Status:           No Feedback
 Bug Type:         MySQL related
 Operating System: Linux 2.4.x
 PHP Version:      4.1.2
 New Comment:

I don't know if my uneducated comment will really contribute to the
understanding of this bug, but I'll offer it up anyway:

I encountered the same problem with the exact same Apache/PHP/MySQL
setup as b0nfire@fdns.net. When I changed the connection type from
persistent (using mysql_pconnect) to a regular MySQL connection (using
mysql_connect), the problem went away--the script worked fine and no
further segfaults appeared in the http error log.

If others find the same results, then it may be safe to assume the
problem is limited to persistent connections only.


Previous Comments:
------------------------------------------------------------------------

[2002-07-26 01:00:10] php-bugs@lists.php.net

No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".

------------------------------------------------------------------------

[2002-06-25 13:27:51] sniper@php.net

Please try this snapshot:

http://snaps.php.net/php4-latest.tar.gz


------------------------------------------------------------------------

[2002-06-25 08:27:32] b0nfire@fdns.net

We are experiencing similar problems on our slack 8.0 box:

apache 1.3.26
php 4.1.2
mysql 3.23.49a

We initially saw the follow apache logs:

[Tue Jun 25 05:44:31 2002] [notice] child pid 4503 exit signal
Segmentation fault (11)
[Tue Jun 25 06:11:08 2002] [notice] child pid 17668 exit signal
Segmentation fault (11)

Which similar logs are generated with a pre 1.3.26 apache DOS attack
script...  but since 1.3.26 is apparently patched this should not be a
factor..

We also have a small built in wrapper that reports any connection
failure attempts.. We have not seen any in months and since upgrading
php we have started to see them more frequently... 

One note though is that all of our crashes thusfar have all occurred on
1 peticular script that processes file uploads.  This script has worked
flawlessly for many months..

Sorry no backtrace so far.. I'll try and grab one..

------------------------------------------------------------------------

[2002-04-18 15:23:25] jweiss@greyzone.com

I would like to thank fcaprioli for the additional input;
unfortunately, it does not resolve our problem. If you look at the code
snippet that I submitted earlier, you can see that we already include
the link ID in our query: i.e.,
"$res=mysql_db_query($this->dbase,$query,$dbLink)", where $dbLink is
the link ID. So basically, we're where we were before: stuck with
intermittent failures.

------------------------------------------------------------------------

[2002-04-11 07:20:28] fcaprioli@inwind.it

I was affected by the same bug, but I've found a workaround.
On linux 2.4.18, glibc 2.2.3 and MySQL 3.23.49, apache 1.3.24 with php
4.1.2 statically compiled (mysql external driver,
--with-mysql=mysql_install_dir)

by explicitly indicating the link id, mysql seems to work fine. So

$conn = mysql_pconnect("host","username","pass");
mysql_select_db("db1");
$query = mysql_query("SELECT * FROM xxx")
while ($row = mysql_fetch_array($query)) do_stuff();

would randomly segfault apache, while

$conn = mysql_pconnect("host","username","pass");
mysql_select_db("db1",$conn);
$query = mysql_query("SELECT * FROM xxx",$conn)
while ($row = mysql_fetch_array($query)) do_stuff();

works without problem.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/16272

-- 
Edit this bug report at http://bugs.php.net/?id=16272&edit=1



Thread (22 messages)

« previous php.bugs (#16195) next »