Skip Menu |

This queue is for tickets about the Regexp-Grammars CPAN distribution.

Report information
The Basics
Id: 61459
Status: open
Priority: 0/
Queue: Regexp-Grammars

People
Owner: Nobody in particular
Requestors: ARODLAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Warn about nonreentrant regex engine in the caveats section of POD
This is kind of funny since I'm the one who wrote you asking to have objrule call the class constructor properly, but anyway... I think it would be worth noting in the IMPORTANT CONSTRAINTS AND LIMITATIONS section of the POD that the perl5 regex engine is (so far) non-reentrant -- any code that triggers a regex match inside of (?{ ... }) or (??{ ... }) will lead to weird data corruption and most likely segfaults. In particular this means constructors called by <objrule:>, and in very particular it means Moose constructors under many conditions, like having an attribute with an 'Int' type constraint. Thanks, Andrew
Subject: Re: [rt.cpan.org #61459] Warn about nonreentrant regex engine in the caveats section of POD
Date: Mon, 20 Sep 2010 07:50:02 +1000
To: bug-Regexp-Grammars [...] rt.cpan.org
From: Damian Conway <damian [...] conway.org>
Thanks, Andrew. I have now adapted your wording to add the following warning at the very top of the "IMPORTANT CONSTRAINTS AND LIMITATIONS" section: The Perl 5 regex engine is not reentrant. So any attempt to perform a regex match inside a C<(?{ ... })> or C<(??{ ... })> will almost certainly lead to either weird data corruption or a segfault. The same calamities can also occur in any constructor called by C<< <objrule:> >>. If the constructor invokes another regex in any way, it will most likely fail catastrophically. In particular, this means that Moose constructors will frequently crash and burn within a Regex::Grammars grammar (for example, if the Moose-based class declares an attribute type constraint such as 'Int', which Moose checks using a regex). Thanks for pointing out this non-obvious corner case. Damian