develooper Front page | perl.perl5.porters | Postings from December 2018

[perl #133589] regex compilation can leak memory

Thread Next
James E Keenan via RT
December 6, 2018 20:26
[perl #133589] regex compilation can leak memory
Message ID:
On Sun, 14 Oct 2018 18:56:50 GMT, wrote:
> This is a bug report for perl from,
> generated with the help of perlbug 1.41 running under perl 5.29.4.
> -----------------------------------------------------------------
> In looking at the code in regcomp.c, I noticed that one way it tries
> to
> avoid leaks when raising errors is that it mortalizes an SV before
> dying.  This works, but the scalar doesn't get mortalized if warnings
> are generated, so if those are fatalized there would be a leak.
> Further,
> other functions are called which can output warnings or errors, and
> those functions don't mortalize the SV.  As an example, grok_hex() can
> be called with options that allow it to output warnings.  If those are
> fatal, a leak will occur.  User-defined \p{} properties call perl code
> which can die or warn; again leaks can occur.

Could a TODO test be written for this?

Thank you very much.

James E Keenan (

via perlbug:  queue: perl5 status: new

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About