php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55764 Review ZEND_MM_LONG_CONST on 64 bit
Submitted: 2011-09-22 16:46 UTC Modified: 2013-02-18 00:35 UTC
From: sixd@php.net Assigned: dmitry (profile)
Status: No Feedback Package: Scripting Engine problem
PHP Version: trunk-SVN-2011-09-22 (SVN) OS: All
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-09-22 16:46 UTC] sixd@php.net
Description:
------------
Pointed out by Hannes on #php.pecl is a comment in
http://pecl.php.net/bugs/bug.php?id=12821 by skatta72 at luukku dot
com as follows:

   "I think I found this one. It's a missing L in Zend/zend_alloc.c:

    define ZEND_MM_LONG_CONST(x)      (x##L)

    In 64bit system it should be

    define ZEND_MM_LONG_CONST(x)      (x##LL)

    I found with gdb that the size - variable was way off where
    freeing a memory block and the resulting pointer caused the seg
    fault. Since that change, no crashes.

    This is inside the Zend memory management code. I wouldn't be
    surprised if it causes many other problems that occur randomly
    with php on 64-bit platform."

Dmitry, can you review this?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-22 16:47 UTC] sixd@php.net
-Assigned To: +Assigned To: dmitry
 [2011-09-23 07:23 UTC] dmitry@php.net
-Status: Assigned +Status: Feedback
 [2011-09-23 07:23 UTC] dmitry@php.net
I think you are wrong.

zend_alloc works with pointers and size_t which have the same size as long on both 32-bit and 64-bit GCC.

Also size of "long" and "long long" is the same on 64-bit GCC.
 [2013-02-18 00:35 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-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 07:03:34 2021 UTC