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
 [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: Mon May 06 00:01:31 2024 UTC