|  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: 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]
Pointed out by Hannes on #php.pecl is a comment in 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?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-22 16:47 UTC]
-Assigned To: +Assigned To: dmitry
 [2011-09-23 07:23 UTC]
-Status: Assigned +Status: Feedback
 [2011-09-23 07:23 UTC]
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-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 17:01:31 2024 UTC