New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex qr// interpolation fails when chr(0) is used in a thread #7159
Comments
From @jlokierCreated by @jlokierTry this: use threads; The program should produce no output, but it produces this error message: thread failed to start: Unmatched [ in regex; marked by <-- HERE in m/(?-xism:[ This program is fine: use threads; This too: use threads; And this: use threads; Somehow, there is an interaction between threads and regex compilation It's not as obscure as it sounds. The interpolation operator \Q...\E (In larger programs, from which this is a whittled test case, it's Thanks, Perl Info
|
From @hvdsJamie Lokier (via RT) <perlbug-followup@perl.org> wrote: Thanks for the report. If I understand correctly, this occurs only in this The patch below (to bleadperl, but also suitable for maint) should fix it. Hugo Inline Patch--- sv.c.old Wed Mar 10 20:59:52 2004
+++ sv.c Thu Mar 11 16:16:48 2004
@@ -9715,7 +9715,7 @@
New(0, ret->offsets, 2*len+1, U32);
Copy(r->offsets, ret->offsets, 2*len+1, U32);
- ret->precomp = SAVEPV(r->precomp);
+ ret->precomp = SAVEPVN(r->precomp, r->prelen);
ret->refcnt = r->refcnt;
ret->minlen = r->minlen;
ret->prelen = r->prelen; |
The RT System itself - Status changed from 'new' to 'open' |
From @rgshv@crypt.org wrote:
Regression tests for cloning... perhaps in t/op/clone ?
While we're at it, maybe this one is more complete : ==== //depot/perl/sv.c#726 - /opt/perl/p4/perl/sv.c ==== Inline Patch--- /tmp/tmp.1393.0 Fri Mar 12 00:25:09 2004
+++ /opt/perl/p4/perl/sv.c Fri Mar 12 00:25:02 2004
@@ -9715,7 +9715,7 @@
New(0, ret->offsets, 2*len+1, U32);
Copy(r->offsets, ret->offsets, 2*len+1, U32);
- ret->precomp = SAVEPV(r->precomp);
+ ret->precomp = SAVEPVN(r->precomp, r->prelen);
ret->refcnt = r->refcnt;
ret->minlen = r->minlen;
ret->prelen = r->prelen;
@@ -9727,7 +9727,7 @@
ret->sublen = r->sublen;
if (RX_MATCH_COPIED(ret))
- ret->subbeg = SAVEPV(r->subbeg);
+ ret->subbeg = SAVEPVN(r->subbeg, r->sublen);
else
ret->subbeg = Nullch;
#ifdef PERL_COPY_ON_WRITE |
From @iabynOn Fri, Mar 12, 2004 at 12:26:29AM +0100, Rafael Garcia-Suarez wrote:
well, there's always ext/threads/t/problems.t for random threads-related -- |
From @hvdsRafael Garcia-Suarez <rgarciasuarez@free.fr> wrote: Yes, that one is also needed. Hugo |
From @smpeters
This fix was applied as change #22490. |
@smpeters - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#27530 (status was 'resolved')
Searchable as RT27530$
The text was updated successfully, but these errors were encountered: