#19010 [NEW]: debug build segfaults on property assignment
| From: | tater at potatoe dot com | Date: | Wed, 21 Aug 2002 07:02:49 +0000 |
| Subject: | #19010 [NEW]: debug build segfaults on property assignment | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-17412@lists.php.net to get a copy of this message | ||
From: tater@potatoe.com
Operating system: Mac OS X 10.1.5 / Darwin 5.5
PHP version: 4CVS-2002-08-21
PHP Bug Type: Zend Engine 2 problem
Bug description: debug build segfaults on property assignment
A particular sequence of object creations and property assignment segfaults
in ZE2 with --enable-debug.
I verified this on latest CVS, with a vanilla "configure --enable-debug"
build, running the CLI version.
This causes the segfault:
php -r 'class x { var $y; function z(){}} $a = new x; $a->y=1; $b = new x;
$b->y=2; echo "all ok\n";'
Just swapping two statements in there makes it work fine:
php -r 'class x { var $y; } $a = new x; $a->y=1; $b = new x; $b->y=2; echo
"all ok\n";'
This is what I can see in gdb:
Program received signal EXC_BAD_ACCESS, Could not access memory.
0x0017532c in _efree (ptr=0x5a5a5a5a, __zend_filename=0x1cf824
"/usr/local/book/php4/Zend/zend_object_handlers.c", __zend_lineno=88,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at
/usr/local/book/php4/Zend/zend_alloc.c:219
219 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0 0x0017532c in _efree (ptr=0x5a5a5a5a, __zend_filename=0x1cf824
"/usr/local/book/php4/Zend/zend_object_handlers.c", __zend_lineno=88,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at
/usr/local/book/php4/Zend/zend_alloc.c:219
#1 0x001a8ae0 in zend_std_write_property (object=0x5a36d8,
member=0x5a222c, value=0x5a25a8) at
/usr/local/book/php4/Zend/zend_object_handlers.c:88
#2 0x001b6384 in zend_assign_to_object (result=0x5a21f4, op1=0x5a220c,
op2=0x5a2224, value=0x5a25a8, Ts=0xbffff1e8) at
/usr/local/book/php4/Zend/zend_execute.c:304
#3 0x001af460 in execute (op_array=0x5a1978) at
/usr/local/book/php4/Zend/zend_execute.c:1520
#4 0x00185eb8 in zend_eval_string (str=0xbffffc45 "class x { var $y;
function z(){}} $a = new x; $a->y=1; $b = new x; $b->y=2; echo \"all
ok\\n\";", retval_ptr=0x0, string_name=0x1d076c "Command line code") at
/usr/local/book/php4/Zend/zend_execute_API.c:729
#5 0x001b9090 in main (argc=3, argv=0xbffffb78) at
/usr/local/book/php4/sapi/cli/php_cli.c:725
#6 0x00002714 in _start ()
#7 0x00002544 in start ()
--
Edit bug report at http://bugs.php.net/?id=19010&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19010&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19010&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19010&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19010&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19010&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19010&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19010&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19010&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19010&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19010&r=globals