php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65997 Leak when using gc_collect_cycles with new GMP implementation
Submitted: 2013-10-29 18:44 UTC Modified: 2013-10-29 20:05 UTC
From: nikic@php.net Assigned: nikic (profile)
Status: Closed Package: GNU MP related
PHP Version: master-Git-2013-10-29 (Git) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 - 6 = ?
Subscribe to this entry?

 
 [2013-10-29 18:44 UTC] nikic@php.net
Description:
------------
From http://www.reddit.com/r/PHP/comments/1hx7qz/what_is_going_on_here_how_do_i_fix_t

function calcExp ($gmpC) {
    //make sure gc is on
    gc_enable();

    for ($i=0; $i<2000000000; $i++) {
        $gmpTempC = $gmpC;
        gc_collect_cycles();
    }
    return false;
}

$num = gmp_init('1094189891312342345461854');
print "\n";
calcExp($num);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-29 20:05 UTC] nikic@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
 [2013-11-04 09:00 UTC] ab@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4218e89f8df4ca3897e3aad595e0c2c9cf4c3aca
Log: Fix bug #65997 by switching to Serializable for GMP
 [2013-11-17 09:30 UTC] laruence@php.net
Automatic comment on behalf of nikic
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4218e89f8df4ca3897e3aad595e0c2c9cf4c3aca
Log: Fix bug #65997 by switching to Serializable for GMP
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 08:01:28 2024 UTC