Bug #67644 [Csd->ReO]: Memory corruption & crash during ob_start function callback

From: Date: Tue, 02 Sep 2014 21:20:20 +0000
Subject: Bug #67644 [Csd->ReO]: Memory corruption & crash during ob_start function callback
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187392@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 Updated by: stas@php.net Reported by: jocelyn dot fournier at gmail dot com Summary: Memory corruption & crash during ob_start function callback -Status: Closed +Status: Re-Opened 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: had to revert the fix, breaks tests. Will look more into it. Previous Comments: ------------------------------------------------------------------------ [2014-09-02 21:19:44] stas@php.net Automatic comment on behalf of stas Revision: http://git.php.net/?p=php-src.git;a=commit;h=fe551c089a7d309e3fa08513f1d1e287141cd202 Log: Revert "Fix bug #67644 - Memory corruption & crash during ob_start function callback" ------------------------------------------------------------------------ [2014-09-02 19:33:25] stas@php.net Automatic comment on behalf of stas Revision: http://git.php.net/?p=php-src.git;a=commit;h=53fa6c5b6b5b09059ba54c8912d0c0aef57aa4ff Log: Fix bug #67644 - Memory corruption & crash during ob_start function callback ------------------------------------------------------------------------ [2014-08-31 12:00:34] jocelyn dot fournier at gmail dot com 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. ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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

« previous php.bugs (#187392) next »