Bug #67644 [Asn]: Memory corruption & crash during ob_start function callback
| From: | jocelyn dot fournier at gmail dot com | Date: | Sun, 31 Aug 2014 12:00:34 +0000 |
| Subject: | Bug #67644 [Asn]: Memory corruption & crash during ob_start function callback | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-187357@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67644&edit=1
ID: 67644
User updated by: jocelyn dot fournier at gmail dot com
Reported by: jocelyn dot fournier at gmail dot com
Summary: Memory corruption & crash during ob_start function
callback
Status: Assigned
Type: Bug
Package: Reproducible crash
Operating System: Mac OS X
PHP Version: 5.4.30
Assigned To: mike
Block user comment: N
Private report: N
New Comment:
Ok, so the register_shutdown + ob_start approach is the best way to do this, as long as we are sure
register_shutdown is called before ob_start (which should always be the case).
I cannot use ob_flush() because my lib is loaded on auto_prepend_file.
Previous Comments:
------------------------------------------------------------------------
[2014-08-31 01:35:00] stas@php.net
BTW, if you add a flush at the end of the script, this also fixes the issue.
------------------------------------------------------------------------
[2014-08-31 00:45:04] stas@php.net
Looking at the library, I see that it runs a lot of code from __destruct function which is called on
shutdown. This is usually not the best idea as the services the object needs to run his code may be
already partially shut down. I'll still see if it can be handled better, but I'm not sure
if this code will actually work properly in this way.
------------------------------------------------------------------------
[2014-08-29 14:42:59] jocelyn dot fournier at gmail dot com
I've just modified the code on https://github.com/jocel1/php5.4-crash to not
require a working AMQP server.
------------------------------------------------------------------------
[2014-08-29 07:50:12] stas@php.net
It would help a lot if there was a reproducing case that does not require running rabbitmq server.
You say you have different cases reproducing it, can any of them be cut down so that actual amqp
server is not needed to reproduce?
------------------------------------------------------------------------
[2014-08-24 17:14:11] jocelyn dot fournier at gmail dot com
Hi,
Any progress on this issue ?
Using register_shutdown_function() + ob_start() as a workaround doesn't work for all the cases.
Indeed, I are have cases where ob_start() is called before register_shutdown_function(), even with
the PHP_OUTPUT_HANDLER_REMOVABLE flag in ob_start().
Thanks,
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=67644
--
Edit this bug report at https://bugs.php.net/bug.php?id=67644&edit=1