php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21726 Memory leaks
Submitted: 2003-01-18 08:32 UTC Modified: 2003-01-18 12:32 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: novell at kiruna dot se Assigned: moriyoshi (profile)
Status: Closed Package: *General Issues
PHP Version: 5CVS-2003-01-18 (dev) OS: Linux
Private report: No CVE-ID: None
 [2003-01-18 08:32 UTC] novell at kiruna dot se
/opt/DEV/php/php4/ext/standard/scanf.c(887) :  Freeing 0x418B2B64 (22 bytes), script=./test.php
Last leak repeated 675 times
/opt/DEV/php/php4/Zend/zend_execute.c(2876) :  Freeing 0x418A6964 (4 bytes), script=./test.php
/opt/DEV/php/php4/Zend/zend_variables.c(110) : Actual location (location was relayed)

with this script:

#!/usr/bin/php
<?php
$fp = fopen("Makefile","r");
if ($fp) {
  $x = 0;
  while ($temp = fscanf($fp,"%s = %s",$var,$var2)) {
    if ($var == "CC") { $bleh = $var2; }
    $x++;
} }
fclose($fp);
?>

The Makefile used is the Makefile generated in php source
directory when running configure. And yes, the script is
ugly.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-18 11:39 UTC] derick@php.net
Due to a bug in the installed sed on your system the build
fails. Install GNU sed and it should be okay.
 
Thank you for your interest in PHP.
 [2003-01-18 11:42 UTC] wez@php.net
my fault; I'm playing with a local copy of the bugdb and didn't update the mailto address.
 [2003-01-18 11:51 UTC] moriyoshi@php.net
I'm working on this.

 [2003-01-18 11:54 UTC] moriyoshi@php.net
Changing the line
  while ($temp = fscanf($fp,"%s = %s",$var,$var2)) {
to
  while ($temp = fscanf($fp,"%n = %n",$var,$var2)) {

causes the runtime to segfault.



 [2003-01-18 12:32 UTC] moriyoshi@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Aug 28 13:00:03 2025 UTC