ID: 26281 Updated by: [EMAIL PROTECTED] Reported By: tater at potatoe dot com -Status: Closed +Status: Assigned Bug Type: Strings related -Operating System: OS X 10.2 +Operating System: * -PHP Version: 5CVS-2003-11-16 (dev) +PHP Version: 5CVS-2003-11-29 (dev) -Assigned To: +Assigned To: iliaa New Comment:
This still crashes, here's the backtrace: [Switching to Thread 16384 (LWP 12818)] 0x0831ac74 in _zval_ptr_dtor (zval_ptr=0xbfffd680, __zend_filename=0x8571ae0 "/usr/src/web/php/php5/Zend/zend_execute.c", __zend_lineno=197) at /usr/src/web/php/php5/Zend/zend_execute_API.c:352 352 (*zval_ptr)->refcount--; (gdb) bt #0 0x0831ac74 in _zval_ptr_dtor (zval_ptr=0xbfffd680, __zend_filename=0x8571ae0 "/usr/src/web/php/php5/Zend/zend_execute.c", __zend_lineno=197) at /usr/src/web/php/php5/Zend/zend_execute_API.c:352 #1 0x083514f7 in zend_switch_free (opline=0x40e48e80, Ts=0xbfffd610) at /usr/src/web/php/php5/Zend/zend_execute.c:197 #2 0x0834d76a in zend_switch_free_handler (execute_data=0xbfffd7a0, op_array=0x40e488b4) at /usr/src/web/php/php5/Zend/zend_execute.c:3070 #3 0x083481e9 in execute (op_array=0x40e488b4) at /usr/src/web/php/php5/Zend/zend_execute.c:1269 #4 0x08326c78 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /usr/src/web/php/php5/Zend/zend.c:1016 #5 0x082e585b in php_execute_script (primary_file=0xbffffba0) at /usr/src/web/php/php5/main/main.c:1625 #6 0x083602e3 in main (argc=2, argv=0xbffffc34) at /usr/src/web/php/php5/sapi/cli/php_cli.c:910 Previous Comments: ------------------------------------------------------------------------ [2003-11-18 19:39:18] [EMAIL PROTECTED] This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ [2003-11-16 23:06:18] tater at potatoe dot com Description: ------------ a switch() statement testing a string offset, like 'switch($string{0})', crashes after executing the matching case or default block. this only happens if there is at least one case. workarounds: assign offset to another variable first, or put it in quotes like "{$string{0}}". This breaks a lot of PEAR code, btw. Reproduce code: --------------- $x = 'abc'; switch ($x{0}) { default: print "default - works\n"; } switch ($x{0}) { case 'a': print "case 'a' - bus error\n"; } print "done\n"; Expected result: ---------------- default - works case 'a' - bus error done Actual result: -------------- default - works case 'a' - bus error Bus error -------------------- backtrace: (gdb) run bug.php Starting program: /usr/local/book/php/bin/php bug.php [Switching to process 5410 thread 0xb03] Reading symbols for shared libraries . done Reading symbols for shared libraries ............ done default - works case 'a' - bus error Program received signal EXC_BAD_ACCESS, Could not access memory. 0x00229f8c in _zval_dtor (zvalue=0xbb4c10, __zend_filename=0x2c2a24 "/Users/tater/book/php-src/Zend/zend_execute.c", __zend_lineno=203) at /Users/tater/book/php-src/Zend/zend_variables.c:44 44 CHECK_ZVAL_STRING_REL(zvalue); (gdb) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26281&edit=1