php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1394 fclose() causes SIGSEGV esp. when run as apache module
Submitted: 1999-05-10 05:40 UTC Modified: 1999-05-16 11:24 UTC
From: bsidhi at openport dot com Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 3.0.7 OS: Linux
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bsidhi at openport dot com
New email:
PHP Version: OS:

 

 [1999-05-10 05:40 UTC] bsidhi at openport dot com
this looks to be the same as #1313

it looks to me like the destructor for php3 fclose() is simply libc's fclose!

functions/file.c
    GLOBAL(le_fp) = register_list_destructors(fclose,NULL);
    GLOBAL(le_pp) = register_list_destructors(__pclose,NULL);

so i made it:
    GLOBAL(le_fp) = register_list_destructors(__fclose,NULL);
    GLOBAL(le_pp) = register_list_destructors(__pclose,NULL);

and added:
static void __fclose(FILE *fp)
{
TLS_VARS;
    fclose(fp);
}

that seems to fix it.  of course, i have no clue what TLS_VARS is all about .. just copied from __pclose up above =:)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-05-16 11:24 UTC] ssb at cvs dot php dot net
fixed in CVS

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 20:01:34 2024 UTC