php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23466 Segmentation fault or misbehaving ob_start on PHP5.0.0-dev
Submitted: 2003-05-03 11:34 UTC Modified: 2003-05-19 08:33 UTC
From: php at fuer-et dot de Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-05-03 (dev) OS: Linux, Red Hat 8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: php at fuer-et dot de
New email:
PHP Version: OS:

 

 [2003-05-03 11:34 UTC] php at fuer-et dot de
<?php
class Foo {
    function bar($str)
    {   
        return $str.'bar';
    }
}
function baz($str) {
    return $str."baz\n";
}
$foo = new Foo;
ob_start('baz');
ob_start(array(&$foo, 'bar'));
print 'foo';
?>

This script fails to add 'bar' to the string on every machine when using PHP5, and it segfaults on mine.

et@edea:~$ /usr/local/sources/php-4.3.1/sapi/cli/php test.php 
foobarbaz
et@edea:~$ /usr/local/sources/unstable/php5-200305031330/sapi/cli/php test.php 
Segmentation fault (core dumped)


Backtrace is:

(gdb) bt
#0  0x0816d425 in zend_hash_index_find (ht=0x0, h=0, pData=0x0)
    at /home/et/sources/unstable/php5-200305031330/Zend/zend_hash.c:979
#1  0x08160a02 in call_user_function_ex (function_table=0x828d128, object_pp=0x0, function_name=0x4026d0b4, 
    retval_ptr_ptr=0xbfffe4e0, param_count=2, params=0xbfffe4e8, no_separation=1, symbol_table=0x0)
    at /home/et/sources/unstable/php5-200305031330/Zend/zend_execute_API.c:555
#2  0x081467c9 in php_end_ob_buffer (send_buffer=1 '\001', just_flush=0 '\0')
    at /home/et/sources/unstable/php5-200305031330/main/output.c:241
#3  0x0814693b in php_end_ob_buffers (send_buffer=0 '\0')
    at /home/et/sources/unstable/php5-200305031330/main/output.c:335
#4  0x0813bc8c in php_request_shutdown (dummy=0x0) at /home/et/sources/unstable/php5-200305031330/main/main.c:1091
#5  0x08181368 in main (argc=2, argv=0xbfffec64) at /home/et/sources/unstable/php5-200305031330/sapi/cli/php_cli.c:1006
#6  0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6
(gdb) 

config.nice:
#! /bin/sh
#
# Created by configure

'./configure' \
'--enable-bcmath' \
'--with-gmp' \
'--with-mysql' \
'--with-pgsql' \
'--enable-calendar' \
'--with-apxs=/opt/apache/1.3.27/bin/apxs' \
'--with-zlib' \
'--with-bz2' \
'--with-config-file-path=/home/et' \
'--with-openssl' \
'--enable-debug' \
"$@"

I know the config file path is odd, i just use the machine for developing and i'm the only one working on it ;)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-05 15:02 UTC] moriyoshi@php.net
related to bug #23489

 [2003-05-08 01:37 UTC] php at fuer-et dot de
Works.
But i had no problems with PHP4 before, anyway...
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jun 05 04:01:26 2025 UTC