php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31161 segfault when using phpMyAdmin
Submitted: 2004-12-17 22:33 UTC Modified: 2005-02-14 01:00 UTC
Votes:6
Avg. Score:4.2 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:1 (25.0%)
From: phpbugs at majiclab dot com Assigned:
Status: No Feedback Package: MySQLi related
PHP Version: 5CVS-2004-12-17 (dev) OS: SuSE 9.1
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: phpbugs at majiclab dot com
New email:
PHP Version: OS:

 

 [2004-12-17 22:33 UTC] phpbugs at majiclab dot com
Description:
------------
I decided to start a new bug, but I already posted this same comment in bug #30653.  Sorry if this causes confusion, but I thought it might be better to start a new bug after I realized that so many things had changed (different OS, different PHP version (4 vs. 5), etc.)  As well, I forgot my configure line (found at very bottom of post)...

I have some websites that run fine, with DB connection through mysqli. 
However, browsing to the phpMyAdmin page causes a segfault.  I am using
phpMyAdmin-2.6.0-pl3.  Previously, before it would segfault, phpMyAdmin
would not even let me login, returning me this error: "SELECT VERSION()
as version", empty result set returned (or something like that).  So I
have never had phpMyAdmin working at all, but it never segfaulted
before.

I am really confused, and hopefully a somewhat serious bug can be found
of this, as I have been having several random segfault parties (times
where certain code segfaults for no apparent reason).

A little more info:

I am running a AMD 64 3200+, 512MB RAM, SuSE 9.1 (kernel-2.6.4,
glibc-2.3.3)

Thanks for any help/fixes!

-Andrew

'./configure' '--prefix=/usr/local/php5' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-libxml-dir=/usr/local/lib' '--with-zlib' '--with-zlib-dir=/usr/local/lib' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--enable-sockets' '--enable-exif'

Reproduce code:
---------------
Not sure.  If anybody wants me to debug phpMyAdmin to try to make this process easier, then I can try that... but I'm hoping the backtrace might be enough.  This information might be valuable:

phpMyAdmin acutally works enough to ask me for my username/password.  If I enter the wrong username/password, it works fine, as in it keeps asking me for u/p.  However, once I enter the *correct* u/p, it then segfaults.  I will provide some pseudo code of the PMA_DBI_postConnect() function called after a succesful connect:

<?php
if (!defined('PMA_MYSQL_INT_VERSION')) {
    // this is where it used to not work before (SELECT VERSION() as version)
    $result = query("SELECT VERSION() as version");
    if ($result IS valid) {
        fetch_row();
        parse the version number;
    }

    if (mysql > 4.1) {  // true for me!
        change lang and charset options based on user info;
        call SET NAMES and SET CHARACTER SET; // if provided
    } else { // not true for me
        include phpmyadmin charset_conversion library;
    }
}
?>

Expected result:
----------------
phpMyAdmin to not cause a segfault, at least give me the other error
from before... (SELECT VERSION() as version returned empty result set) NOT segfault


Actual result:
--------------
zend_object_store_get_object (zobject=0x0) at
/usr/local/src/php5-STABLE-200412171930/Zend/zend_objects_API.c:202
202             return
EG(objects_store).object_buckets[handle].bucket.obj.object;

And I have the following backtrace:

#0  zend_object_store_get_object (zobject=0x0) at
/usr/local/src/php5-STABLE-200412171930/Zend/zend_objects_API.c:202
#1  0x0000002a9636005c in php_mysqli_fetch_into_hash (ht=Variable "ht"
is not available.
) at /usr/local/src/php5-STABLE-200412171930/ext/mysqli/mysqli.c:624
#2  0x0000002a9636a08f in zif_mysqli_fetch_array (ht=Variable "ht" is
not available.
) at
/usr/local/src/php5-STABLE-200412171930/ext/mysqli/mysqli_nonapi.c:189
#3  0x0000002a964965c4 in zend_do_fcall_common_helper
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2711
#4  0x0000002a964967d8 in zend_do_fcall_handler (execute_data=Variable
"execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2843
#5  0x0000002a964a04fe in execute (op_array=Variable "op_array" is not
available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:1400
#6  0x0000002a96496109 in zend_do_fcall_common_helper
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2740
#7  0x0000002a964967d8 in zend_do_fcall_handler (execute_data=Variable
"execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2843
#8  0x0000002a964a04fe in execute (op_array=Variable "op_array" is not
available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:1400
#9  0x0000002a96496109 in zend_do_fcall_common_helper
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2740
#10 0x0000002a964969c1 in zend_do_fcall_by_name_handler
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2825
#11 0x0000002a964a04fe in execute (op_array=Variable "op_array" is not
available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:1400
#12 0x0000002a96496109 in zend_do_fcall_common_helper
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2740
#13 0x0000002a964967d8 in zend_do_fcall_handler (execute_data=Variable
"execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2843
#14 0x0000002a964a04fe in execute (op_array=Variable "op_array" is not
available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:1400
#15 0x0000002a96496109 in zend_do_fcall_common_helper
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2740
#16 0x0000002a964969c1 in zend_do_fcall_by_name_handler
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:2825
#17 0x0000002a964a04fe in execute (op_array=Variable "op_array" is not
available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:1400
#18 0x0000002a964912fd in zend_include_or_eval_handler
(execute_data=Variable "execute_data" is not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:3565
#19 0x0000002a964a04fe in execute (op_array=Variable "op_array" is not
available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend_execute.c:1400
#20 0x0000002a9646812d in zend_execute_scripts (type=Variable "type" is
not available.
) at /usr/local/src/php5-STABLE-200412171930/Zend/zend.c:1069
#21 0x0000002a964307ff in php_execute_script (primary_file=Variable
"primary_file" is not available.
) at /usr/local/src/php5-STABLE-200412171930/main/main.c:1628
#22 0x0000002a964a0c44 in php_handler (r=Variable "r" is not available.
) at
/usr/local/src/php5-STABLE-200412171930/sapi/apache2handler/sapi_apache2
.c:537
#23 0x0000000000445631 in ap_run_handler (r=0x0) at config.c:151
#24 0x0000000000448479 in ap_invoke_handler (r=0x7535a0) at
config.c:363
#25 0x000000000042d2de in ap_process_request (r=0x7535a0) at
http_request.c:246
#26 0x0000000000428688 in ap_process_http_connection (c=0x746700) at
http_core.c:250
#27 0x00000000004503b1 in ap_run_process_connection (c=0x0) at
connection.c:42
#28 0x0000000000444600 in child_main (child_num_arg=Variable
"child_num_arg" is not available.
) at prefork.c:609
#29 0x0000000000444784 in make_child (s=0x5d0e88, slot=0) at
prefork.c:649
#30 0x000000000044485c in startup_children (number_to_start=5) at
prefork.c:721
#31 0x0000000000444f1c in ap_mpm_run (_pconf=Variable "_pconf" is not
available.
) at prefork.c:940
#32 0x000000000044aae0 in main (argc=Variable "argc" is not available.
) at main.c:617

I have been having somewhat random segfaults in other locations as well.
 I don't know if this will assist or is related at all, but I would
often get segfaults if I threw a new CException (a class extending
Exception) inside or nested inside a __destruct.  I don't know if this
is an "intentional" behavior, but I changed my code to not call those
functions/etc. from a __destruct.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-17 22:39 UTC] phpbugs at majiclab dot com
I am also running MySQL 4.1.7.
 [2005-02-06 16:27 UTC] georg@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.0-win32-latest.zip

Please also try if disabling the query cache solves this 
problem. 
 [2005-02-14 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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 18:01:29 2024 UTC