php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30481 Segmentation Fault when using MySQL
Submitted: 2004-10-19 17:45 UTC Modified: 2005-03-25 01:35 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: nickj at despammed dot com Assigned: georg (profile)
Status: Not a bug Package: MySQL related
PHP Version: 5.0.2 OS: FreeBSD 4.7-RELEASE-p27
Private report: No CVE-ID: None
 [2004-10-19 17:45 UTC] nickj at despammed dot com
Description:
------------
OK Guys. I'm a Windows man with little experience of UNIX type environments, but I will try to give you as much information as possible.

I am running PHP 5.0.2 compiled with MySQL 4.1.5(gamma) as so:

./configure --with-apxs --enable-calendar --enable-sockets --with-gd --with-gd-dir=/usr/local/include --enable-gd-native-ttf --with-freetype --with-freetype-dir=/usr/local/include/freetype2 --with-jpeg --with-jpeg-dir=/usr/local/include --with-zlib --with-zlib-dir=/usr/local/include --without-png --with-mysql=/usr/local/lib/mysql --enable-debug

The MySQL client libraries are the same version as the server. I'm also using Apache 1.3 if that's relevant.

All my PHP scripts using MySQL work as expected. However, when I try browsing for data using phpMyAdmin, I get an empty document. Apache reports a segmentation fault.

From all the evidence, including the bt, this all seems very similar to bug #26208, but I am running a version of MySQL which should have fixed the problem.

I am sure there's plenty more information you need from me. Tell me what you need, and I will try to provide it.

Reproduce code:
---------------
Apologies, but phpMyAdmin has some massive libraries I don't really want to sift through. Just try browsing a table with any version of phpMyAdmin (I have tried quite a few before I traced the problem to a segmentation fault).

If you really need the code, I will try and sort through all the script and distill it into a few lines :(

Expected result:
----------------
The contents of a table should be displayed, but seg fault occurs as described

Actual result:
--------------
#0  0x81b427a in add_property_string_ex (arg=0x8576e0c, key=0x81fb993 "def",
    key_len=4, str=0xb <Error reading address 0xb: Bad address>, duplicate=1)
    at /installs/php-5.0.2/Zend/zend_API.c:1134
#1  0x80b2962 in zif_mysql_fetch_field (ht=2, return_value=0x8576e0c,
    this_ptr=0x0, return_value_used=1)
    at /installs/php-5.0.2/ext/mysql/php_mysql.c:2250
#2  0x81eb06f in zend_do_fcall_common_helper (execute_data=0xbfbf6064,
    opline=0x848272c, op_array=0x847d000)
    at /installs/php-5.0.2/Zend/zend_execute.c:2713
#3  0x81eb7ee in zend_do_fcall_handler (execute_data=0xbfbf6064,
    opline=0x848272c, op_array=0x847d000)
    at /installs/php-5.0.2/Zend/zend_execute.c:2843
#4  0x81cfd1f in execute (op_array=0x847d000)
    at /installs/php-5.0.2/Zend/zend_execute.c:1400
#5  0x81eb178 in zend_do_fcall_common_helper (execute_data=0xbfbfe444,
    opline=0x839e19c, op_array=0x831020c)
    at /installs/php-5.0.2/Zend/zend_execute.c:2740
#6  0x81eb5a2 in zend_do_fcall_by_name_handler (execute_data=0xbfbfe444,
    opline=0x839e19c, op_array=0x831020c)
    at /installs/php-5.0.2/Zend/zend_execute.c:2825
#7  0x81cfd1f in execute (op_array=0x831020c)
    at /installs/php-5.0.2/Zend/zend_execute.c:1400
#8  0x81b13d2 in zend_execute_scripts (type=8, retval=0x0, file_count=3)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-19 19:03 UTC] georg@php.net
Looks like some BC break in MYSQL_FIELD structure inside 
libmysql. 
 
Could please also provide the table definition (SHOW 
CREATE TABLE) ? 
 [2004-10-19 19:56 UTC] nickj at despammed dot com
Hi Georg. Thanks for your quick response.

I don't think the table structure is that important. This error occurs on all tables of different types, on a wide variety of different dbs. Executing SHOW CREATE TABLE commands via phpMyAdmin causes the seg fault again, but if you really want an example of one of my tables, I can get one or two definitions directly via the mysql prompt.

Cheers
 [2004-10-22 17:54 UTC] nickj at despammed dot com
Sorted. Apologies. Wrong client library linked in. PHP is blameless.
 [2004-10-22 18:56 UTC] georg@php.net
Even if the wrong client library is used, it should not 
crashed. Discussed this with my MySQL colleagues before, 
probably we have to change the FIELD structure to provide 
BC. 
 
Changing Status to assigned - not sure if a possible fix 
will go in to ext/mysql or libmysql 
 [2005-03-25 01:35 UTC] sniper@php.net
Mysql bugs are fidex in Mysql..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC