php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1828 call to ereg crashes apache with a segfault 11.
Submitted: 1999-07-22 09:19 UTC Modified: 1999-07-22 09:31 UTC
From: rasjani at pcuf dot fi Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.11 OS: Linux / REdhat 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: rasjani at pcuf dot fi
New email:
PHP Version: OS:

 

 [1999-07-22 09:19 UTC] rasjani at pcuf dot fi
This following script is from  php manual and is causing me trouble.  Ive asked help from #php (from efnet & ircnet) and in both places ppl think its a bug.  Here's the script.

<?PHP
	$date = "1999-01-01";
	if ( ereg( "([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs ) ) {
	    echo "$regs[3].$regs[2].$regs[1]";
	} else {
	    echo "Invalid date format: $date";
	}
?>

This script wasnt the first time i found the bug but ive tested this too and the same things happens. Browser complains about empty document and apache's errlog file gets this message:

[Thu Jul 22 15:59:22 1999] [notice] child pid 16696 exit signal Segmentation fault (11)

Here's info that might help to solve the problem.. 

PHP Version: 3.0.11 (selfcompiled, with following switches)
	--with-apxs=/usr/sbin/apxs --with-pgsql=/usr/include/pgsql --with-system-regex
Apache: 1.3.6 (straight from redhat RPM, not self compiled)
Distro: Linux Redhat 6.0


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-07-22 09:31 UTC] andrey at cvs dot php dot net
There is a bug in configure when hsregex and apxs are used.

To fix it,  undo this change:

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

and then run autoconf and remake PHP.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC