php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23711 Any script containing a parse_ini_file() call results in a segmentation fault
Submitted: 2003-05-20 04:43 UTC Modified: 2003-05-20 05:23 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: gavin dot brown at uk dot com, colin at wibble dot org dot uk Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 4.3.2RC3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gavin dot brown at uk dot com, colin at wibble dot org dot uk
New email:
PHP Version: OS:

 

 [2003-05-20 04:43 UTC] gavin dot brown at uk dot com, colin at wibble dot org dot uk
Any script that contains a call to the parse_ini_file() function results in a segmentation fault. This is the case for mod_php4 and the CLI. The scripts used to test this are at http://jodrell.net/files/parse_ini_file_bug/

Here's what happens when the script is run from a shell:

[root@spoon rael]# /usr/local/bin/php parse_ini_file_demo.php 
Date: Tue, 20 May 2003 10:37:09 +0100
This string is printed before parsing.
Segmentation fault (core dumped)


[root@spoon rael]# gdb /usr/local/bin/php core
GNU gdb Red Hat Linux (5.2-2)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
Core was generated by `/usr/local/bin/php parse_ini_file_demo.php'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libcrypt.so.1...done.
Loaded symbols for /lib/libcrypt.so.1
Reading symbols from /lib/libresolv.so.2...done.
Loaded symbols for /lib/libresolv.so.2
Reading symbols from /lib/i686/libm.so.6...done.
Loaded symbols for /lib/i686/libm.so.6
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/libnsl.so.1...done.
Loaded symbols for /lib/libnsl.so.1
Reading symbols from /lib/i686/libc.so.6...done.
Loaded symbols for /lib/i686/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /lib/libnss_files.so.2...done.
Loaded symbols for /lib/libnss_files.so.2
#0  0x4011a3cd in __libc_free (mem=0xbfffca4c) at malloc.c:3143
3143    malloc.c: No such file or directory.
        in malloc.c
(gdb) bt
#0  0x4011a3cd in __libc_free (mem=0xbfffca4c) at malloc.c:3143
#1  0x0810e798 in _efree (ptr=0xbfffca58)
    at /home/stuff/php-4.3.2RC3/Zend/zend_alloc.c:265
#2  0x08108cb2 in zend_file_handle_dtor (fh=0xbfffca20)
    at Zend/zend_language_scanner.c:2945
#3  0x0810cd78 in zend_parse_ini_file (fh=0xbfffca20, unbuffered_errors=0, 
    ini_parser_cb=0x8094b94 <php_simple_ini_parser_cb>, arg=0x81a9e3c)
    at Zend/zend_ini_parser.c:185
#4  0x08094f0e in zif_parse_ini_file (ht=1, return_value=0x81a9e3c, 
    this_ptr=0x0, return_value_used=1)
    at /home/stuff/php-4.3.2RC3/ext/standard/basic_functions.c:2894
#5  0x0812fb88 in execute (op_array=0x81a57cc)
    at /home/stuff/php-4.3.2RC3/Zend/zend_execute.c:1606
#6  0x0811d60c in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /home/stuff/php-4.3.2RC3/Zend/zend.c:886
#7  0x080f6c9c in php_execute_script (primary_file=0xbffff5b0)
    at /home/stuff/php-4.3.2RC3/main/main.c:1687
#8  0x08138314 in main (argc=2, argv=0xbffff654)
    at /home/stuff/php-4.3.2RC3/sapi/cli/php_cli.c:805
#9  0x400b5657 in __libc_start_main (main=0x81378a0 <main>, argc=2, 
    ubp_av=0xbffff654, init=0x8060eec <_init>, fini=0x81388c0 <_fini>, 
    rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffff64c)
    at ../sysdeps/generic/libc-start.c:129

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-20 04:49 UTC] gavin dot brown at uk dot com, rael at wibble dot org dot uk
changing email address.
 [2003-05-20 05:12 UTC] rael at wibble dot org dot duk
The snapshot php4-STABLE-200305200930 did the trick for the CLI, although i've not been able to get apache to load via a install using --with-mysql --apxs2=...

[root@spoon rael]# /usr/local/bin/php -v
PHP 4.3.2RC4-dev (cli) (built: May 20 2003 11:06:00)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies

[root@spoon rael]# /usr/local/bin/php parse_ini_file_demo.php
Date: Tue, 20 May 2003 11:09:08 +0100
This string is printed before parsing.
This string is printed after parsing.
$parsed looks like this:
Array
(   
    [foo] => bar
    [name] => value
    [time] => money
    [knowledge] => power
)
 [2003-05-20 05:22 UTC] derick@php.net
Good, let's close this bug then. If you feel the apache 2 thing a bug too, please file a new one (but only if you are sure it's a bug ;) ).

Derick
 [2003-05-20 05:22 UTC] gavin dot brown at uk dot com, rael at wibble dot org dot uk
This snapshot appears work properly. Both the php module and the CLI work correctly and don't segfault. Should just mention that this is with Apache 1.3.27, whereas Colin uses Apache 2.
 [2003-05-20 05:23 UTC] derick@php.net
Concurrent access ;)
 [2003-05-20 05:23 UTC] gavin dot brown at uk dot com, colin at wibble dot org dot uk
closing this bug.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 17:01:29 2024 UTC