develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #121983] PERL_DEBUG_READONLY_OPS is incompat with regcomp

From:
Father Chrysostomos via RT
Date:
September 20, 2014 14:49
Subject:
[perl #121983] PERL_DEBUG_READONLY_OPS is incompat with regcomp
Message ID:
rt-4.0.18-32576-1411224547-1218.121983-15-0@perl.org
On Thu May 29 10:08:00 2014, rurban@cpanel.net wrote:
> 
> This is a bug report for perl from rurban@cpanel.net,
> generated with the help of perlbug 1.40 running under perl 5.21.0.
> 
> 
> -----------------------------------------------------------------
> ./Configure -des -Accflags=-DPERL_DEBUG_READONLY_OPS
> make miniperl
> ./miniperl -Ilib -e1
> =>
> Program received signal SIGSEGV, Segmentation fault.
> 0x0000000000623168 in Perl_pp_regcomp () at pp_ctl.c:167
> 167             PM_SETRE(pm, new_re);
> 
> when pm->op_pmregexp needs to be written to but is in write protected
> op slab.
> 
> A regcomp LOGOP should not be Slab_to_ro allocated.
> 
> Detected by hugmeir. simple testcase ./miniperl -e '"" =~ /$x/'
> such as: http://paste.scsys.co.uk/386789

The purpose of PERL_DEBUG_READONLY_OPS is to make sure threaded perls don’t modify ops at run time, since they are shared between threads.

For non-threaded perls, making sure ops are not modified is going to make everything crash, because ops are intentionally (and safely) modified frequently.

So PERL_DEBUG_READONLY_OPS does not make sense without threads.

I’ve made the error more obvious in commit 40653c2.

-- 

Father Chrysostomos


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



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