php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70626 PHP segfaults or reports "zend_mm_heap corrupted" for some date functions
Submitted: 2015-10-02 22:24 UTC Modified: 2015-10-03 12:30 UTC
From: michael at michaelmarley dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 7.0.0RC4 OS: Linux x86_64
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: michael at michaelmarley dot com
New email:
PHP Version: OS:

 

 [2015-10-02 22:24 UTC] michael at michaelmarley dot com
Description:
------------
Starting with PHP 7.0.0 RC4, I get "zend_mm_heap corrupted" errors or segfaults when executing some date functions.  I included a simple example that causes the problem.

The problem occurs both for CLI and FPM modes.  In FPM mode, it always causes a segfault.  In CLI mode, it usually prints "zend_mm_heap corrupted", but segfaults sometimes.  I tried to capture a backtrace by running it in CLI in GDB, but it never seems to segfault while running in GDB; it always displays the corruption message instead.  The message or segfault always occurs at the end of the script, so even if I put more code below the line that triggers the crash, that code will execute successfully.  It always crashes at the end of the script though.

I am using the packages from here: https://launchpad.net/~mamarley/+archive/ubuntu/php-exp.  If it matters, they were compiled with GCC 5.2.  I have no third-party extensions enabled (only opcache, gd, pgsql, and pdo_pgsql).  I have also tried with all the extensions disabled and still gotten the same problem.

I am sorry for the lack of debugging information here, but I am at a loss about how to collect anything useful.  If you let me know what I should do, I would be glad to do it though.

Test script:
---------------
<?php
$date=date_create(date("Y-m-d"));
print_r($date);
?>

Expected result:
----------------
DateTime Object
(
    [date] => 2015-10-02 00:00:00.000000
    [timezone_type] => 3
    [timezone] => America/New_York
)

Actual result:
--------------
DateTime Object
(
    [date] => 2015-10-02 00:00:00.000000
    [timezone_type] => 3
    [timezone] => America/New_York
)
zend_mm_heap corrupted

or

DateTime Object
(
    [date] => 2015-10-02 00:00:00.000000
    [timezone_type] => 3
    [timezone] => America/New_York
)
Segmentation fault

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-10-03 04:19 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-10-03 04:19 UTC] laruence@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

I can not reproduce this ...
 [2015-10-03 12:30 UTC] michael at michaelmarley dot com
-Status: Feedback +Status: Closed
 [2015-10-03 12:30 UTC] michael at michaelmarley dot com
I apologize, it seems the issue is with one of the Debian patches.  Sorry for wasting your time.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Feb 28 16:01:29 2020 UTC