php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1035 ereg_replace() causes segmentation fault in Apache+mod_ssl
Submitted: 1999-01-06 16:07 UTC Modified: 1999-04-19 04:47 UTC
From: danbeck at mtginfo dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.5 OS: RedHat Linux 5.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
20 + 18 = ?
Subscribe to this entry?

 
 [1999-01-06 16:07 UTC] danbeck at mtginfo dot com
After using the apxs utility that comes with Apache to reconfigure and install PHP3 3.0.5 as a DSO, I attempted to access a script that was previously working on the same machine.  By eliminating a line of code at a time, It seems that the ereg_replace function in the code snippit below is causing the problem.  If I comment that line out, my script works just fine, if I leave it in, it causes Apache to report and Segmentation Fault and IE4 tells me that the server returned an invalid response.

<?
 $fp = fopen($dat_file_name, "r");
 $count = -1;
 while(!feof($fp)) {
   $data = explode(":", fgets($fp, 1024));
   // chomp
   $data[0] = chop($data[0]);
   $data[1] = ereg_replace( "\n", "", $data[1] );

   $tmp_array[$data[0]] = $data[1];

 }
 fclose($fp); 

?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-04-19 04:47 UTC] rasmus
This is because the RH Apache RPM disables hsregex and PHP's configure mechanism wasn't smart enough to detect this.  As of 3.0.8 it will be, but for now either use the Apache-1.3.6 RPM from http://www.lerdorf.on.ca/apache/ or configure php using --with-system-regex
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 06:01:29 2024 UTC