Memory Leak in Math::Pari
From: Ilya Zakharevich (nospam-abuse_at_ilyaz.org)
Date: 12/16/04
- Next message: fdl: "field method for Win32::IE::Mechanize"
- Previous message: Alan J. Flavell: "Re: Clearing radio_group"
- Next in thread: Ilya Zakharevich: "Math::Pari on darwin"
- Reply: Ilya Zakharevich: "Math::Pari on darwin"
- Reply: Ilya Zakharevich: "Math::Pari on darwin"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 16 Dec 2004 05:21:50 +0000 (UTC)
>From documentation of v2.010601:
A memory leak on the PARI stack was possible in a rare situaton:
if a PARI function returning a value which is not on stack
(very few possibilities: gnil, gun etc.) is called when no
Math::Pari temporary values are on stack, the GENs created for
the function arguments would leak.
I think some people saw this leak before, but since it was so hard to
reproduce, suffered from it silently. Please retest Math::Pari if you
had "PARI stack overflow" errors.
Thanks for your patience,
Ilya
P.S. It can take several hours for this version to propagate to CPAN.
P.P.S. Actual code to reproduce the leak is very simple; I found it
mostly by luck (or a misprint ;-). Do
$z = PARI 0;
LOOP_OVER_THIS: $x = 256*$z;
The PARI code for multiplication recognizes multiplication by
0, so it returns the globally defined constant 0, which
prohibits freeing the result of conversion of Perl value 256
to a PARI value.
- Next message: fdl: "field method for Win32::IE::Mechanize"
- Previous message: Alan J. Flavell: "Re: Clearing radio_group"
- Next in thread: Ilya Zakharevich: "Math::Pari on darwin"
- Reply: Ilya Zakharevich: "Math::Pari on darwin"
- Reply: Ilya Zakharevich: "Math::Pari on darwin"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|