php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47743 crash upon communication with mysql through unix socket
Submitted: 2009-03-21 18:30 UTC Modified: 2009-04-08 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: electro at vgr dot pl Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.3CVS-2009-03-21 (snap) OS: Mandriva 2009 x64 cooker
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: electro at vgr dot pl
New email:
PHP Version: OS:

 

 [2009-03-21 18:30 UTC] electro at vgr dot pl
Description:
------------
apache 2.2.11 with php compiled as module crashes upon reading from unix socket while communicating with mysql (5.1.32, pdo driver). It happens only in some specific circumstances but I haven't been able to trace it so far. What is important is that php crashes always in the same point in my application which I confirmed by stracing apache.
Configure Command 	 './configure' '--prefix=/usr/local/php5' '--with-libdir=lib64' '--with-apxs2=/usr/sbin/apxs' '--with-curl' '--with-iconv' '--with-libxml-dir' '--with-mysql' '--with-openssl' '--with-pdo-mysql' '--with-pear' '--with-pcre-regex' '--with-zlib' '--disable-all' '--disable-cgi' '--disable-ipv6' '--enable-dom' '--enable-embedded-mysqli' '--enable-libxml' '--enable-memory-limit 

Reproduce code:
---------------
haven't been able to trace the bug to some specific code yet, but watching strace output I can see that php crashes always in the same moment. I will try to extract specific code that makes php crash.

Actual result:
--------------
socket(PF_FILE, SOCK_STREAM, 0)         = 34
fcntl(34, F_SETFL, O_RDONLY)            = 0
fcntl(34, F_GETFL)                      = 0x2 (flags O_RDWR)
fcntl(34, F_GETFL)                      = 0x2 (flags O_RDWR)
fcntl(34, F_SETFL, O_RDWR|O_NONBLOCK)   = 0
connect(34, {sa_family=AF_FILE, path="/var/lib/mysql/mysql.sock"...}, 110) = 0
fcntl(34, F_SETFL, O_RDWR)              = 0
setsockopt(34, SOL_SOCKET, SO_RCVTIMEO, "\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0"..., 16) = 0
setsockopt(34, SOL_SOCKET, SO_SNDTIMEO, "\2003\341\1\0\0\0\0\0\0\0\0\0\0\0\0"..., 16) = 0
setsockopt(34, SOL_IP, IP_TOS, [8], 4)  = -1 EOPNOTSUPP (Operation not supported)
setsockopt(34, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
poll([{fd=34, events=POLLIN}], 1, 30000) = 1 ([{fd=34, revents=POLLIN}])
read(34, "4\0\0\0\n5.1.32\0\231)\0\0t7U&ZsT-\0\377\367\300\2\0\0\0\0"..., 16384) = 56
stat("/usr/share/mysql/charsets/Index.xml", {st_mode=S_IFREG|0644, st_size=18261, ...}) = 0
open("/usr/share/mysql/charsets/Index.xml", O_RDONLY) = 35
read(35, "<?xml version='1.0' encoding=\"utf"..., 18261) = 18261
close(35)                               = 0
write(34, "A\0\0\1\215\242\3\0\0\0\0@\10\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 69) = 69
read(34, "\1\0\0\2\376"..., 16384)      = 5
write(34, "\t\0\0\3OUGUSPI]\0"..., 13)  = 13
read(34, "\7\0\0\4\0\0\0\2\0\0\0"..., 16384) = 11
poll([{fd=34, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(34, "\17\0\0\0\3SET NAMES utf8"..., 19) = 19
read(34, "\7\0\0\1\0\0\0\2\0\0\0"..., 16384) = 11
poll([{fd=34, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout)
write(34, "\224\0\0\0\3SELECT `id`,`name`,`comment`"..., 152) = 152
read(34, "\1\0\0\1\0071\0\0\2\3def\5Lazer\tRightType\tRig"..., 16384) = 480
--- SIGSEGV (Segmentation fault) @ 0 (0) ---


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-22 00:16 UTC] johannes@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

A backtrace would be nice and please add the code. Additionally: Do you really need --enable-embedded-mysqli which links in a MySQL Server into PHP?
 [2009-03-24 08:21 UTC] electro at vgr dot pl
I compiled the newest php snapshot without --enable-memory-limit and --enable-embedded-mysqli. Segmentation fault still occured. Then I recompiled with --enable-debug. Curiously, segmentation fault did NOT happen this time. So I can't submit a backtrace. would a core file without --enable-debug be of any help?
I also tested my php code on similar Mandriva cooker system, but 32-bit instead of 64. Segmentation fault does not occur.
 [2009-03-31 07:45 UTC] jani@php.net
So what exactly are you using to connect to mysql now, mysql PDO 
driver or what? We need a reproduce script. And can you reproduce 
this crash with PHP 5.2.9 ?
 [2009-04-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, 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".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC