php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2711 fopen kills apache -- appears to be regcomp related on Alpha/Linux
Submitted: 1999-11-12 12:18 UTC Modified: 2002-06-16 09:01 UTC
From: marc dot nozell at compaq dot com Assigned:
Status: Not a bug Package: Reproducible Crash
PHP Version: 3.0.12 OS: Linux/Alpha
Private report: No CVE-ID: None
 [1999-11-12 12:18 UTC] marc dot nozell at compaq dot com
This bug looks similar to #1931, but...

I'm running RedHat V6.0 on an AlphaServer DS10.
Packages: Apache 1.3.9, MySQL 3.22.27 and PHP 3.0.12
I have a similar configuration on a ProLiant 1850R which works fine.

1) Apache+MySQL+PHP module -- fopen on a URL fails with
"Invalid URL".  

2) I rebuild PHP as a standalone program and uncommented
some of debug code in url.c and found that url_parse() 
was failing after the second extended regexp.

3) Then rebuilt PHP as a standalong program using --with-system-regexp and then the code worked.  

4) HOWEVER, when I rebuilt PHP3 as an apache module --with-system-regexp, the code still fails, but with this in
the error log:

FATAL:  emalloc():  Unable to allocate 4294967293 bytes 

I can't get apache to leave a core file.  If httpd
is run from gdb, it simply dies with "Program exited with code 01." and bt says "No stack."

-marc

-------------------------------

The PHP3 code is the same one found in the manual:

<?

$fp = fopen("http://www.ispworks.com/", "r");

if (!$fp) {
	die("Can't open URL");
}

while ($buffer = fgets($fp, 4096)) {
  echo $buffer;
}
fclose($fp);
?>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-16 09:01 UTC] sander@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately, PHP 3 is no longer supported. Please download
the latest version of PHP 4 from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 24 17:01:24 2020 UTC