[Bug 198246] bug only pertains to code executed via -r arg to cli php

marmida michael at frood.org
Wed Mar 26 21:19:02 GMT 2008

Two things:

- the bug does not effect scripts executed via 'php filename'; this only hits php -r with the contained code.
- the bug does stop shutdown handlers from being executed properly.

I've attached a file that should reproduce the error.  If run as 'php
test_cli_error.php', it should execute cleanly; if the contents of that
file are copied out of the script (minus php tags) you should get the
zend_mm_heap_corrupted exit without the output from the shutdown

Because this only impacts code evaluated via the -r option, it may not
be worth investigating further.

Here is a sample shell session:

marmida at marmida-desktop:~$ php -r "class TestException extends Exception {} 
function a() { print('shutdown' . chr(10)); }
throw new TestException('hello world');

Fatal error: Uncaught exception 'TestException' with message 'hello world' in Command line code:4
Stack trace:
#0 {main}
  thrown in Command line code on line 4
zend_mm_heap corrupted
marmida at marmida-desktop:~$ php test_cli_error.php

Fatal error: Uncaught exception 'TestException' with message 'hello world' in /home/marmida/test_cli_error.php:6
Stack trace:
#0 {main}
  thrown in /home/marmida/test_cli_error.php on line 6
marmida at marmida-desktop:~$  

** Attachment added: "sample driver for -r execution to get zend_mm_heap_corrupted"

php cli crashes on uncaught derived exception
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in ubuntu.

More information about the Ubuntu-server-bugs mailing list