php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56268 Segfault with multiple get
Submitted: 2005-01-16 20:31 UTC Modified: 2005-01-17 13:38 UTC
From: chris-php at bolt dot cx Assigned:
Status: Closed Package: memcache (PECL)
PHP Version: 4_3 CVS-2005-01-16 (stable) OS: Linux 2.4
Private report: No CVE-ID: None
 [2005-01-16 20:31 UTC] chris-php at bolt dot cx
Description:
------------
Bug 31332 (http://bugs.php.net/bug.php?id=31332) hit me hard, so when it was resolved, I upgraded to PHP 4.3 CVS 200501162130 and now PHP crashes, apparently in the PECL extension. Since the crash appears to be caused by the fix for bug 31332, but it also only happens for the new multi get support, I'm reporting it both here and to PHP's bug database.

Reproduce code:
---------------
<?
$mc = memcache_connect("localhost", 11211, 1);
var_dump($mc->set("test", array("hello")));
var_dump($mc->get(array("test")));
/*
one thing to note:
var_dump($mc->get("test"));
works fine.
*/
?>


Expected result:
----------------
bool(true)
array(1) {
  ["test"]=>
  array(1) {
    [0]=>
    string(5) "hello"
  }
}


Actual result:
--------------
bool(true)
Segmentation fault (core dumped)


Program received signal SIGSEGV, Segmentation fault.
0x403f86d6 in _zval_ptr_dtor (zval_ptr=0x84433c8)
    at /home/chris/php4-STABLE-200501162130/Zend/zend_execute_API.c:287
287             (*zval_ptr)->refcount--;
(gdb) bt
#0  0x403f86d6 in _zval_ptr_dtor (zval_ptr=0x84433c8)
    at /home/chris/php4-STABLE-200501162130/Zend/zend_execute_API.c:287
#1  0x403b55f9 in var_destroy (var_hashx=0x1)
    at /home/chris/php4-STABLE-200501162130/ext/standard/var_unserializer.c:132
#2  0x4061d201 in mmc_exec_retrieval_cmd_multi (mmc=0x83d4d48, keys=0x844341c,
    result=0xbfff77b4) at /root/memcache-1.4/memcache.c:906
#3  0x4061e7ef in zif_memcache_get (ht=808530489, return_value=0x844347c,
    this_ptr=0x84433c4, return_value_used=1)
    at /root/memcache-1.4/memcache.c:1581
#4  0x4041031e in execute (op_array=0x83421bc)
    at /home/chris/php4-STABLE-200501162130/Zend/zend_execute.c:1648
#5  0x4041009f in execute (op_array=0x8344c34)
    at /home/chris/php4-STABLE-200501162130/Zend/zend_execute.c:1692
#6  0x4041009f in execute (op_array=0x82145c4)
    at /home/chris/php4-STABLE-200501162130/Zend/zend_execute.c:1692
#7  0x40411731 in execute (op_array=0x820f844)
    at /home/chris/php4-STABLE-200501162130/Zend/zend_execute.c:2218
#8  0x40400d70 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /home/chris/php4-STABLE-200501162130/Zend/zend.c:900
#9  0x403d7148 in php_execute_script (primary_file=0xbffff7b0)
    at /home/chris/php4-STABLE-200501162130/main/main.c:1739
#10 0x4041447e in apache_php_module_main (r=0x8203b0c, display_source_mode=0)
    at /home/chris/php4-STABLE-200501162130/sapi/apache/sapi_apache.c:54
#11 0x40414fca in send_php (r=0x8203b0c, display_source_mode=0, filename=0x0)
    at /home/chris/php4-STABLE-200501162130/sapi/apache/mod_php4.c:621
#12 0x40415173 in send_parsed_php (r=0x8203b0c)
    at /home/chris/php4-STABLE-200501162130/sapi/apache/mod_php4.c:636
#13 0x0808b5cb in ap_invoke_handler ()
#14 0x080a0b3b in ap_some_auth_required ()
#15 0x080a0f96 in ap_internal_redirect ()
#16 0x0806250a in ap_get_server_built ()
#17 0x0808b5cb in ap_invoke_handler ()
#18 0x080a0b3b in ap_some_auth_required ()
#19 0x080a0b9a in ap_process_request ()
#20 0x08097b20 in ap_child_terminate ()
#21 0x08097dae in ap_child_terminate ()
#22 0x08097e54 in ap_child_terminate ()
#23 0x08098514 in ap_child_terminate ()
#24 0x08098d4c in main ()
#25 0x401afd06 in __libc_start_main () from /lib/libc.so.6


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-17 03:18 UTC] tony2001 at phpclub dot net
Yup, it seems you're right and the last fixes for serialize() are causing this problem. 
I'll look into it shortly, thanks.
 [2005-01-17 07:51 UTC] tony2001 at phpclub dot net
Do `make clean` and then rebuild PHP (and memcache too) from scratch.
It should work after that.
 [2005-01-17 13:36 UTC] chris-php at bolt dot cx
Closing...
 [2005-01-17 13:38 UTC] chris-php at bolt dot cx
Could have sworn I did a clean build of everything. Thanks, works great now.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC