php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58418 Segmentation fault during shutdown
Submitted: 2008-11-18 18:19 UTC Modified: 2017-11-05 04:22 UTC
From: asbjorn at lila dot io Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5.2.6 OS: Debian GNU/Linux lenny
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: asbjorn at lila dot io
New email:
PHP Version: OS:

 

 [2008-11-18 18:19 UTC] asbjorn at lila dot io
Description:
------------
I ran the script with:
php5 -n -e test.php

I ran it in a loop like this:
for i in `seq 1 100`; do php5 -n -e test.php; if [ $? != 0 ]; then echo; echo Crashed on run $i; echo ; break; fi; done

We don't use MySQL for anything else than pastebin on that machine so we have just moved MySQL off that machine for now, since we primarily uses PgSQL.

The PECL bug reporter doesn't support PHP 5.2.6, so I set it to 5.2.5.

`php5 -n -v` output:
PHP 5.2.6-5 with Suhosin-Patch 0.9.6.2 (cli) (built: Oct  5 2008 12:28:28) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

`php -n -i` output, test script, etc.:
http://asbjorn.it/pub/bugreports/php/fileinfo/

I haven't had time to test it on PHP5.3 yet.


Reproduce code:
---------------
<?php
// This script has a seg faults in at
// *least* 1 out of 50 runs. I have a script that
// consistenly fails. But I haven't been able to
// replicate it in a small script.

dl('mysql.so'); // or mysqli.so, but not pdo.so+pdo_mysql.so
dl('fileinfo.so'); // the order doesn't mather

echo "Initializing Fileinfo\n";
$finfo = new FInfo(FILEINFO_MIME);

// If you don't access undefined variables
// it doesn't seg faults.
echo 'foo is'.(isset($foo)?'':' NOT')." set\n";

echo "The script continues...\n"
// High risk of seg fault during shutdown
?>

Expected result:
----------------
Initializing Fileinfo
foo is NOT set
The script continues...

Actual result:
--------------
Initializing Fileinfo
foo is NOT set
The script continues...
Segmentation fault (core dumped)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-18 18:23 UTC] asbjorn at lila dot io
I just forgot to add that there is a bunch of traces available at http://asbjorn.it/pub/bugreports/php/fileinfo/dumps/
 [2017-10-11 17:32 UTC] ab@php.net
-Status: Open +Status: Feedback -Package: Fileinfo +Package: *General Issues
 [2017-10-11 17:32 UTC] ab@php.net
Thanks for the report. Please check with some recent PHP version.

Thanks.
 [2017-11-05 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 16:01:29 2024 UTC