php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29791 glob crash
Submitted: 2004-08-22 19:42 UTC Modified: 2004-08-23 16:53 UTC
From: mg at iceni dot pl Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5CVS-2004-08-22 (dev) 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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mg at iceni dot pl
New email:
PHP Version: OS:

 

 [2004-08-22 19:42 UTC] mg at iceni dot pl
Description:
------------
PHP 5 crashes while using glob() function with specific 
arguments.  

Reproduce code:
---------------
<?php
glob(''); // crash
glob('*'); // crash
glob('*.txt'); //ok
?>

Expected result:
----------------
 

Actual result:
--------------
#0  0x08131300 in zif_glob (ht=1, return_value=0x830a6dc, 
this_ptr=0x0, return_value_used=0) 
at /home/sh/php5/ext/standard/dir.c:421 
421             strncpy(cwd, globbuf.gl_pathv[0], 
MAXPATHLEN); 
(gdb) bt 
#0  0x08131300 in zif_glob (ht=1, return_value=0x830a6dc, 
this_ptr=0x0, return_value_used=0) 
at /home/sh/php5/ext/standard/dir.c:421 
#1  0x08229e35 in zend_do_fcall_common_helper 
(execute_data=0xbfffd380) 
at /home/sh/php5/Zend/zend_execute.c:2980 
#2  0x0822a9a6 in zend_do_fcall_handler 
(execute_data=0xbfffd380) 
at /home/sh/php5/Zend/zend_execute.c:3114 
#3  0x082239bd in execute (op_array=0x830af3c) 
at /home/sh/php5/Zend/zend_execute.c:1498 
#4  0x081f9da5 in zend_execute_scripts (type=8, 
retval=0x0, file_count=3) 
at /home/sh/php5/Zend/zend.c:1052 
#5  0x081ab791 in php_execute_script 
(primary_file=0xbffff7d0) 
at /home/sh/php5/main/main.c:1633 
#6  0x08231e1d in main (argc=3, argv=0xbffff894) 
at /home/sh/php5/sapi/cli/php_cli.c:943 
 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-22 19:48 UTC] tony2001@php.net
Works fine here.
What server API have you tried? CLI? Apache? Apache2? Other?
 [2004-08-22 19:57 UTC] iliaa@php.net
What C library are you using, the error you are reporting 
implies that in "" or "*" conditions the library would 
return NULL as the path. 
 [2004-08-22 20:38 UTC] mg at iceni dot pl
Please mark this bug as BOGUS... Looks like my system is 
totally screwed, glob() in my glibc is using some 
different structure glob_t than rest of the world...
 [2004-08-23 08:36 UTC] derick@php.net
Ok, marking bogus then. What specific version glibc do you have?
 [2004-08-23 16:53 UTC] mg at iceni dot pl
Some pre 2.3.3 version from CVS downloaded around a month 
before official release. So I guess that's the reason... 
strange because everything else is working flawlessly. 
Looks like it's time to reinstall this mess 8)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 05 06:01:36 2025 UTC