php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36793 Some objects become corrupted after 32767 instantiations
Submitted: 2006-03-20 00:05 UTC Modified: 2006-03-20 08:13 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: twm at twmacinta dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.4.2 OS: RHEL ES 3 update 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-03-20 00:05 UTC] twm at twmacinta dot com
Description:
------------
Hello,

I have a set of two classes which are used together and which work fine initially but which result in memory corruption after being instantiated 32767 times.  I have attached the URL of a sample script which demonstrates the problem since I wasn't able to reproduce it in 20 lines or less.  I ran the program through Valgrind to see if it could ferret out more specifics, but it didn't report any errors.

Thanks,
- Tim Macinta


Reproduce code:
---------------
http://www.twmacinta.com/php_bugs/object_corruption_20060319.php.txt

Expected result:
----------------
Start
Middle: 0
Middle: 10000
Middle: 20000
Middle: 30000

...

Middle: 9999999
End


Actual result:
--------------
Start
Middle: 0
Middle: 10000
Middle: 20000
Middle: 30000
Middle: 32761
Middle: 32762
Middle: 32763
Middle: 32764
Middle: 32765
Middle: 32766
foo was not defined


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-20 00:17 UTC] mike@php.net
Sorry, won't get fixed for PHP-4.
 [2006-03-20 00:31 UTC] twm at twmacinta dot com
Hello,

OK, thanks for letting me know.  Could you give me more information on what the core problem is so that I can try to avoid it?

Thanks,
- Tim Macinta
 [2006-03-20 08:13 UTC] mike@php.net
You can't. This is a PHP4 limitation. Please search the bug system or the mailing list archives for "refcount" and "short int".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 18 06:03:37 2021 UTC