php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7534 configure test for POSIX readdir_r dumps core
Submitted: 2000-10-30 12:12 UTC Modified: 2000-10-30 19:40 UTC
From: mills at cc dot umanitoba dot ca Assigned:
Status: Closed Package: Installation problem
PHP Version: 4.0.3pl1 OS: Solaris 2.6
Private report: No CVE-ID: None
 [2000-10-30 12:12 UTC] mills at cc dot umanitoba dot ca
make fails with the following error:

"reentrancy.c", line 106: prototype mismatch: 2 args passed, 3 expected
cc: acomp failed for reentrancy.c
*** Error code 1

The bug is in the test program in the configure script.
Because the `entry' array is not initialized to zeroes
the readdir_r call causes a core dump.  A quick fix is
to make it a global variable.  Here's a patch:

*** Oconfigure  Sun Oct 15 06:47:10 2000
--- configure   Sun Oct 29 12:23:04 2000
***************
*** 6879,6888 ****
  #include <sys/types.h>
  #include <dirent.h>
  
  main() {
        DIR *dir;
!       char entry[sizeof(struct dirent)+257];
!       struct dirent *pentry = (struct dirent *) &entry;
  
        dir = opendir("/");
        if (!dir) 
--- 6879,6888 ----
  #include <sys/types.h>
  #include <dirent.h>
  
+ char entry[sizeof(struct dirent)+257];
  main() {
        DIR *dir;
!       struct dirent *pentry;
  
        dir = opendir("/");
        if (!dir) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-30 19:40 UTC] sniper@php.net
This is fixed in CVS.  Please grab a snapshot from http://snaps.php.net/
and reopen this bug report if problem still exists with it.

--Jani
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 12 20:01:33 2024 UTC