|  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
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

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.

- Tim Macinta

Reproduce code:

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


Middle: 9999999

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


Add a Patch

Pull Requests

Add a Pull Request


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

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?

- Tim Macinta
 [2006-03-20 08:13 UTC]
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-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 15 02:05:50 2022 UTC