Re: Segfault in ob_*() callback
| From: | (Marcus Börger) | Date: | Sun, 01 Sep 2002 15:48:01 +0000 |
| Subject: | Re: Segfault in ob_*() callback | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-87689@lists.php.net to get a copy of this message | ||
At 17:10 01.09.2002, Zeev Suraski wrote:
At 17:51 01/09/2002, Marcus Börger wrote:After reading again: It seems i mixed it up myself in first answer.At 15:25 01.09.2002, Zeev Suraski wrote:I actually mixed it up with just_flush.At 16:10 01/09/2002, Marcus Börger wrote:My first thoughts were that there is no need to call the user functions when cleaning the output. So could you explain why?The problem is that in function PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS_DC) the user function is called wether or not send_buffer is zero. (Zero means flush here and means the function must not be called, as far as i can tell by now).It should be called either way.
You may be right about send_buffer, even though it's debatable. You may want to perform some processing even if the buffer gets canceled, but I guess that wouldn't be good programming. However, either way, this should not be causing any problems if the handler and buffering layer are coded properly. Calling the handler should not cause a crash regardless of whether the buffer ends up getting sent or not.I checked it and what happens is that the call to user function of cause calls the user function again which then calls php_end_ob_buffer. The problem here again is that in ob handlers no ob_xxx() function can be called. Since i also agree that relying on a handler beeing called upon cleaning is no good idea i suggest we disable calling the user function and such for that case. Could you please check - i am looking for other the problems in the output code and havin problems with all the versions since some of my patches were removed.