php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29358 PHP segfaults during shutdown because of custom stream wrapper
Submitted: 2004-07-23 21:46 UTC Modified: 2004-08-08 01:00 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: swalk at prp dot physik dot tu-darmstadt dot de Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5CVS-2004-07-23 (dev) 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: swalk at prp dot physik dot tu-darmstadt dot de
New email:
PHP Version: OS:

 

 [2004-07-23 21:46 UTC] swalk at prp dot physik dot tu-darmstadt dot de
Description:
------------
If i have any custom wrapper registered, and try to include or php_check_syntax() a file with a parse error in it, php segfaults during shutdown.

Reproduce code:
---------------
$ php -r 'class a {} stream_register_wrapper("a","a"); php_check_syntax("http://localhost/test.txt");'
Segmentation fault

test.txt contains just:
<?php foo

Expected result:
----------------
No output and no segfault :)

Actual result:
--------------
(gdb) bt
#0  0x00000019 in ?? ()
#1  0x08165371 in _php_stream_free (stream=0x82b7bc4, close_options=11)
    at /home/et/cvs.php.net/php-src/main/streams/streams.c:351
#2  0x081666b3 in stream_resource_regular_dtor (rsrc=0x82b78d4)
    at /home/et/cvs.php.net/php-src/main/streams/streams.c:1343
#3  0x081916ae in list_entry_destructor (ptr=0x82b78d4)
    at /home/et/cvs.php.net/php-src/Zend/zend_list.c:173
#4  0x08190279 in zend_hash_apply_deleter (ht=0x8211534, p=0x82b77bc)
    at /home/et/cvs.php.net/php-src/Zend/zend_hash.c:574
#5  0x08190309 in zend_hash_graceful_reverse_destroy (ht=0x8211534)
    at /home/et/cvs.php.net/php-src/Zend/zend_hash.c:640
#6  0x08180fb7 in shutdown_executor ()
    at /home/et/cvs.php.net/php-src/Zend/zend_execute_API.c:282
#7  0x0818a25b in zend_deactivate () at /home/et/cvs.php.net/php-src/Zend/zend.c:819
#8  0x08158981 in php_request_shutdown (dummy=0x0)
    at /home/et/cvs.php.net/php-src/main/main.c:1212
#9  0x081b725f in main (argc=5, argv=0xbffff2e4)
    at /home/et/cvs.php.net/php-src/sapi/cli/php_cli.c:1046

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-07-29 14:02 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2004-07-29 21:51 UTC] et@php.net
Still the same.

et@edea:~/downloads/sources/testing/php5-200407291830$ sapi/cli/php -r 'class a {} stream_register_wrapper("a","a"); php_check_syntax("http://localhost/test.txt");'
Segmentation fault

 [2004-07-30 01:31 UTC] wez@php.net
Works fine here.
It sounds like something else is causing the problem; please troubleshoot using valgrind, and/or eliminating extensions from your build.
 [2004-08-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 12 20:01:33 2024 UTC