php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1666 ereg_replace causes a segfault
Submitted: 1999-07-06 01:18 UTC Modified: 1999-07-07 13:18 UTC
From: rsteffen at ia dot net Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.11 OS: Red Hat Linux 6.0
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: rsteffen at ia dot net
New email:
PHP Version: OS:

 

 [1999-07-06 01:18 UTC] rsteffen at ia dot net
The following script causes PHP 3.0.11 to segfault predictably.

<HTML>
<?
        $string1 = "This is a test";
        echo( "$string1<BR>" );
 
        $string2  = ereg_replace( " is", " was", $string1 );
        echo( "$string2<BR>" );
 
?>
</HTML>

Commenting out the ereg_replace stops the segfault. Works fine on 3.0.9 and 3.0.8. I can't find a copy of 3.0.10
to try it there.

Configuration:
PHP is compiled as an Apache module with the following
config:

./configure --prefix=/usr \
        --with-apxs=/usr/sbin/apxs \
        --with-config-file-path=/usr/lib \
        --enable-debug=no \
        --enable-safe-mode \
        --with-exec-dir=/usr/bin \
        --with-system-regex \
        --with-imap=imap-4.5/c-client \
        --with-sybase-ct=/opt/sybase \
        --with-ldap=yes \
        --enable-track-vars \
        --enable-debugger \
        --enable-sysvsem \
        --enable-sysvshm \
        --with-yp \
        --with-zlib \
        --with-db2 \
        --with-gdbm                                                             

I am working on a stack trace, but apache isn't cooperating tonight.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-06 09:36 UTC] andrey at cvs dot php dot net
There isn't anything that would cause it to fail.  I can't reproduce this.
 [1999-07-07 13:18 UTC] rasmus at cvs dot php dot net
There is a bug in the hsregex detection code in the apxs install in 3.0.11.
Undo this change:

http://cvs.php.net/cvsweb.cgi/configure.in.diff?r1=1.412&r2=1.413&f=h

then run autoconf and rebuild PHP
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 06:01:38 2025 UTC