php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52797 crash because of double free
Submitted: 2010-09-08 15:18 UTC Modified: 2013-02-18 00:34 UTC
From: hossy421 at yahoo dot co dot jp Assigned:
Status: No Feedback Package: Reproducible crash
PHP Version: 5.3.3 OS: FreeBSD 7.3-RELEASE-p2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-09-08 15:18 UTC] hossy421 at yahoo dot co dot jp
Description:
------------
httpd ( Apache 2.2 ) crashes below messages.

> pid XXXXX(httpd), uid 80: exited on signal 11

XXXXX is process id of a httpd child process.


Test script:
---------------
independent of script.
httpd is crashed by any script.
for example PukiWiki.

Expected result:
----------------
all script will run without any error.

Actual result:
--------------
I've compiled PHP with --enable-debug option.
PHP crash with below message.

> ---------------------------------------
> Zend/zend_language_scanner.l(704) : Block 0x28f9871c status:
> Beginning:      Freed
>     Start:      OK
>       End:      Overflown (magic=0x0000003C instead of 0xC5F842B3)
>                 At least 4 bytes overflown
> ---------------------------------------

Zend/zend_language_scanner.l(704) is below code.
> efree(SCNG(script_org));

`SCNG(script_org)' is saved by `zend_save_lexical_state()' function,
and restored by `zend_restore_lexical_state()' function.

`SCNG(script_org)' is `unsigned char*',
but only the pointers are stored and saved, not the string pointed to.


Patches

patch-zend_language_scanner.c.diff (last revision 2010-09-08 13:19 UTC by hossy421 at yahoo dot co dot jp)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-29 11:31 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2011-01-29 11:31 UTC] felipe@php.net
Please try using this snapshot:

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

  http://windows.php.net/snapshots/


 [2011-01-29 16:07 UTC] hossy421 at yahoo dot co dot jp
The patch is not applied to the latest snapshot.
I believe the problem is still there.
 [2011-07-25 21:33 UTC] osharoiko at gmail dot com
I can confirm that this reproducable problem stil exists in 5.3.6 and the patch 
provided in this ticket solves the problem. I have a strong feeling that this 
problem also exists in trunk (thought I didn't check that directly, but I can see 
on svn.php.net that patch was not committed). Please consider fixing this 
problem.
 [2012-10-04 11:05 UTC] slangley at google dot com
Happens with 5.3.13 and a custom SAPI.

---------------------------------------
Zend/zend_language_scanner.l(709) : Block 0x101e8318 status:
Invalid pointer: ((prev=0x00000079) != (prev.size=0x101e827c))
---------------------------------------

---------------------------------------
Zend/zend_language_scanner.l(709) : Block 0x101e8368 status:
Beginning:      Freed
   Start:      OK
     End:      Overflown (magic=0x0000002D instead of 0xF40CA3AE)
               At least 4 bytes overflown
---------------------------------------
 [2013-02-18 00:34 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 "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 07 06:01:30 2024 UTC