php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51057 Memory leak(s), 64 bit?
Submitted: 2010-02-16 13:08 UTC Modified: 2012-04-13 21:31 UTC
From: daniel dot oconnor at gmail dot com Assigned:
Status: No Feedback Package: Unknown/Other Function
PHP Version: 5.3.1 OS: Debian 5.0.2
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-02-16 13:08 UTC] daniel dot oconnor at gmail dot com
Description:
------------
I'm seeing:

[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
/usr/src/php-5.3.1/Zend/zend_opcode.c(63) :  Freeing 0x02090898 (4 bytes), script=tests/AllTests.php

and a few of it's friends.

The machine is http://wiki.php.net/systems/sg1 - compiled php 5.3.1, 

Reproduce code:
---------------
clockwerx@sg1:~/packages-all/Services_ExchangeRates$ php tests/AllTests.php 



Expected result:
----------------
No memory leaks

Actual result:
--------------
PHPUnit 3.4.10 by Sebastian Bergmann.

.E.EE...........E..EEEIIE

Time: 0 seconds, Memory: 9.75Mb

There were 8 errors:

1) Services_ExchangeRatesTest::testShouldStoreRetrievedData2
Assigning the return value of new by reference is deprecated

/usr/local/lib/php/pear/XML/Unserializer.php:801
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:72
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:72
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Rates_ECB.php:83
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates.php:189
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRatesTest.php:70
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

2) Services_ExchangeRatesTest::testShouldValidateCurrencyCode
Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates.php:370
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates.php:272
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRatesTest.php:102
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

3) Services_ExchangeRatesTest::testShouldNotConvertInvalidCurrencies
Non-static method PEAR::raiseError() should not be called statically, assuming $this from incompatible context

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates.php:370
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates.php:272
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates.php:292
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRatesTest.php:112
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

4) Services_ExchangeRatesCommonTest::testShouldParseXML
Use of undefined constant XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE - assumed 'XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE'

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:77
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRatesCommonTest.php:23
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

5) Services_ExchangeRates_CurrenciesUNTest::testShouldParseInformationCorrectly
Use of undefined constant XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE - assumed 'XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE'

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:77
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Currencies_UN.php:76
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRates_CurrenciesUNTest.php:36
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

6) Services_ExchangeRates_RatesECBTest::testShouldRetrieveInformation
Use of undefined constant XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE - assumed 'XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE'

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:77
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Rates_ECB.php:83
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRates_RatesECBTest.php:34
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

7) Services_ExchangeRates_RatesNBPTest::testShouldRetrieveInformation
Use of undefined constant XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE - assumed 'XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE'

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:77
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Rates_NBP.php:106
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRates_RatesNBPTest.php:60
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

8) Services_ExchangeRates_RatesNBITest::testShouldRetrieveInformation
Use of undefined constant XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE - assumed 'XML_UNSERIALIZER_OPTION_ATTRIBUTES_PARSE'

/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Common.php:77
/home/clockwerx/packages-all/Services_ExchangeRates/Services/ExchangeRates/Rates_NBI.php:78
/home/clockwerx/packages-all/Services_ExchangeRates/tests/Services_ExchangeRates_RatesNBITest.php:43
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:25
/home/clockwerx/packages-all/Services_ExchangeRates/tests/AllTests.php:49

FAILURES!
Tests: 25, Assertions: 20, Errors: 8, Incomplete: 2.
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
/usr/src/php-5.3.1/Zend/zend_vm_execute.h(17741) :  Freeing 0x02947B38 (41 bytes), script=tests/AllTests.php
Last leak repeated 4 times
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
Zend/zend_language_scanner.l(1795) :  Freeing 0x0283FAC8 (40 bytes), script=tests/AllTests.php
Last leak repeated 48 times
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
/usr/src/php-5.3.1/Zend/zend_operators.c(1856) :  Freeing 0x02841010 (7 bytes), script=tests/AllTests.php
Last leak repeated 24 times
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
/usr/src/php-5.3.1/Zend/zend_opcode.c(377) :  Freeing 0x0284E630 (9240 bytes), script=tests/AllTests.php
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
Zend/zend_language_scanner.l(1673) :  Freeing 0x027CFC98 (5 bytes), script=tests/AllTests.php
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
/usr/src/php-5.3.1/main/spprintf.c(775) :  Freeing 0x027EA8B8 (79 bytes), script=tests/AllTests.php
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
Zend/zend_language_scanner.l(313) :  Freeing 0x0208E418 (232 bytes), script=tests/AllTests.php
[Tue Feb 16 08:05:07 2010]  Script:  'tests/AllTests.php'
/usr/src/php-5.3.1/Zend/zend_opcode.c(63) :  Freeing 0x02090898 (4 bytes), script=tests/AllTests.php
=== Total 84 memory leaks detected ===


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-16 13:29 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

Also, as *extra tests*, turn of the memory manager with export USE_ZEND_ALLOC=0, and run your tests under valgrind.
 [2010-02-24 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2010-04-25 20:02 UTC] felipe@php.net
-Status: No Feedback +Status: Feedback
 [2010-04-25 20:02 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/


 [2012-04-13 21:31 UTC] nikic@php.net
-Status: Feedback +Status: No Feedback
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 21:01:29 2024 UTC