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

[perl #133589] regex compilation can leak memory

Thread Next
From:
James E Keenan via RT
Date:
December 6, 2018 20:26
Subject:
[perl #133589] regex compilation can leak memory
Message ID:
rt-4.0.24-18787-1544127996-731.133589-15-0@perl.org
On Sun, 14 Oct 2018 18:56:50 GMT, public@khwilliamson.com wrote:
> This is a bug report for perl from khw@cpan.org,
> 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 (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=133589

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About