-
Notifications
You must be signed in to change notification settings - Fork 559
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
threaded perl-5.18.0 fails re/pat_rt_report_thr.t on i586 #12993
Comments
From @shlomifThis is a bug report for perl from shlomif@shlomifish.org, Threaded perl-5.18.0 fails the re/pat_rt_report_thr.t test script on [QUOTE] # This script reproduces a failure at the "make test" stage with perl-5.18.0 # Based on the Mageia's perl-5.18.0-1's .src.rpm's .spec. sh Configure -des \ [/QUOTE] [QUOTE] # This script reproduces a failure at the "make test" stage with perl-5.18.0 # Based on the Mageia's perl-5.18.0-1's .src.rpm's .spec. sh Configure -des \ [/QUOTE] This bug was discovered when building perl-5.18.0 for the Mageia development https://github.com/shlomif/build-perl-with-failure-on-i586 The test failures are: [QUOTE] Regards, -- Shlomi Fish Flags: Site configuration information for perl 5.16.3: Configured by Mageia at Sun Mar 17 18:51:26 UTC 2013. Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Locally applied patches: @INC for perl 5.16.3: Environment for perl 5.16.3: Complete configuration data for perl 5.16.3: Author='' -- Shlomi Fish http://www.shlomifish.org/ I hope that you agree with me that 99.9218485921% of the users wouldn’t bother Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @jkeenanOn Sat May 25 09:36:11 2013, shlomif@shlomifish.org wrote:
I built with these arguments on dromedary and all tests passed. Now, That suggests that the test failures you witnessed are specific to the I would recommend trying other builds on this system, adding one Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
From @shlomifHi James, On Sat May 25 17:19:15 2013, jkeenan wrote:
The fact that it fails on i586 was the whole point. All tests are Can't you set up an i586 Linux VM? See https://www.virtualbox.org/ .
Yes, maybe.
Yes, I already reduced the flags considerably and I will reduce them Regards, -- Shlomi Fish
|
From @shlomifHi all, On Sun May 26 01:11:10 2013, shlomif wrote:
I was able to reproduce it on Mageia Linux 3 i586 with this: https://github.com/shlomif/build-perl-with-failure-on-i586/blob/master/build-perl-with-failure.bash < QUOTE > Is there a need for further reduction? I am now going to try that on a Debian 7.x (Stable) i386 VM. Regards, -- Shlomi Fish |
From @shlomifHi all, On Sun May 26 01:48:36 2013, shlomif wrote:
With these flags on debian-7.0.0-i686 (installed from the LXDE CD at Regards, -- Shlomi Fish |
From @shlomifOn Sun May 26 02:41:06 2013, shlomif wrote:
And all tests are successful on Debian-7.0.0-i385 stable. Regards, -- Shlomi Fish
|
From @nwc10On Sun, May 26, 2013 at 02:48:36AM -0700, Shlomi Fish via RT wrote:
I can't replicate this on a 32-bit build on a Debian 6 system. Everything Nicholas Clark |
From @shlomifHi Nicholas, On Mon, 27 May 2013 15:11:51 +0100
Would it be possible for you to set up a Mageia 3 32-bit i586 VM so you can Regards, Shlomi Fish -- Shlomi Fish http://www.shlomifish.org/ Mephiqoleth: THERE ARE JEWS OF MANY SPECIES. Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @rjbs* Shlomi Fish <shlomif@shlomifish.org> [2013-05-27T13:03:30]
Have you tried contacting someone with a vested interest in having perl work on -- |
From @shlomifHi Ricardo, On Mon May 27 10:16:43 2013, perl.p5p@rjbs.manxome.org wrote:
Well, I am part of the Magiea community - being a packager for them and In any case, installing a VM of a system that causes problems is not Regards, -- Shlomi Fish |
From @shlomifHi all, I am now getting the same test failures after building a threaded perl Regards, -- Shlomi Fish |
From @tonycozOn Sat, May 25, 2013 at 09:36:12AM -0700, shlomif@shlomifish.org (via RT) wrote:
The failure on Megeia essentially comes down to: [tony@localhost perl]$ ./perl -Ilib -Mthreads -le 'sub foo { $s = "\x{1ff}" . "f" x 32000; my $r = $s =~ /\x{1ff}f*/gc; print $r; print pos($s) } foo()' Note that the pos() value is low even for smaller strings: [tony@localhost perl]$ ./perl -Ilib -Mthreads -le 'sub foo { $s = "\x{1ff}" . "f" x 32; my $r = $s =~ /\x{1ff}f*/gc; print $r; print pos($s) } my $t = threads->create(\&foo); $t->join' Tony |
From @tonycozOn Tue, May 28, 2013 at 07:07:07PM +1000, Tony Cook wrote:
The obvious thing to check: [tony@localhost perl]$ ./perl -Mre=debug -Ilib -Mthreads -le 'sub foo { $s = "\x{1ff}" . "f" x 32; my $r = $s =~ /\x{1ff}f*/gc; print $r; print pos($s) } my $t = threads->create(\&foo); $t->join' |
From @tonycozA bit of "printf" debugging, and I believe it's a bug in perl, not in S_regrepeat() sets max to I32_MAX when the supplied value is if (max == REG_INFTY) so at this point max is half our address space. If the character we're matching ('f' in this case) is invariant (it In the simple branch, then: if (utf8_target && scan + max < loceol) { Our test regexp is UTF-8, if scan were under 0x80000000 this code Trying to match EXACT \x66 vs \x66 (@b690046a eol 36900469 regeol b690048a) (scan = b690046a, loceol = 36900469, PL_regeol = b690048a) so our C<< scan + max < loceol >> condition is true, and the pointer The scan loop: while (scan < loceol && UCHARAT(scan) == c) { then terminates early since loceol starts out less than scan. Tony |
From @shlomifHi Tony, thanks for your help in this diagnosis. It's very appreciated. Regards, Shlomi Fish. On Tue, 28 May 2013 20:05:32 +1000
-- Shlomi Fish http://www.shlomifish.org/ <mst> I find it’s usually safe to assume that whatever shlomif’s doing, there Please reply to list if it's a mailing list post - http://shlom.in/reply . |
From @tonycozOn Tue, May 28, 2013 at 08:05:32PM +1000, Tony Cook wrote:
The attached patch fixes this particular instance of the bug, but from Tony |
From @tonycoz0001-avoid-overflowing-a-pointer-for-repeated-EXACT-nodes.patchFrom 932efe1a848ca53f7a355589d74c5a0a50e6063f Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 28 May 2013 20:43:28 +1000
Subject: [PATCH] avoid overflowing a pointer for repeated EXACT nodes
there may be many other similar bugs in S_regrepeat
---
regexec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/regexec.c b/regexec.c
index 4590a81..5f4da4b 100644
--- a/regexec.c
+++ b/regexec.c
@@ -6730,7 +6730,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
* can use UTF8_IS_INVARIANT() even if the pattern isn't UTF-8, as it's
* true iff it doesn't matter if the argument is in UTF-8 or not */
if (UTF8_IS_INVARIANT(c) || (! utf8_target && ! is_utf8_pat)) {
- if (utf8_target && scan + max < loceol) {
+ if (utf8_target && loceol - scan > max) {
/* We didn't adjust <loceol> because is UTF-8, but ok to do so,
* since here, to match at all, 1 char == 1 byte */
loceol = scan + max;
--
1.8.1.5
|
From @tonycozOn Tue May 28 03:06:14 2013, tonyc wrote:
Last night I spent some time trying to figure out if I can run the The glibc supplied with Mageia appears to switch to mmap() for allocation The only other way I can see to do that would be a custom malloc(), but Tony |
From @tonycozOn Tue May 28 03:49:19 2013, tonyc wrote:
I've applied this fix, and a few similar changes to S_regrepeat as I think this is a candidate for maint. Tony |
From @rjbs* Tony Cook via RT <perlbug-followup@perl.org> [2013-06-03T08:32:13]
Would some other committer please have a look at this code and comment on its Thanks. -- |
From @nwc10On Wed, May 29, 2013 at 05:22:05PM -0700, Tony Cook via RT wrote:
I suspect that Perl's malloc can be (ab)used so that it always allocates Nicholas Clark |
From @cpansproutOn Fri Jun 07 08:35:09 2013, perl.p5p@rjbs.manxome.org wrote:
’Fraid I’m not familiar with that code at all. -- Father Chrysostomos |
From @hvdsRicardo Signes <perl.p5p@rjbs.manxome.org> wrote: The change is essentially four variants of this: - if (utf8_target && scan + max < loceol) { I think this is correct only if scan and loceol are guaranteed to be I think the former is intended to be the case, but the docs and comments I wonder whether it would make all this significantly clearer if I don't think the change makes anything worse, in the sense that I don't For the record, in this case I also think one commit would have been Hugo |
From @tonycozOn Sat, Jun 08, 2013 at 08:43:18AM +0100, hv@crypt.org wrote:
The difference isn't required to fit into I32 - C's promotion rules scan and loceol are pointers in the string being matched against -
It's clearer with davem's changes in blead where PL_regeol has become
Neither version has a problem with strings larger than 2GB, but
Please propose an example.
I mostly wanted to make the fixes match the tests added (for the two Tony |
From @iabynOn Mon, Jun 03, 2013 at 05:32:13AM -0700, Tony Cook via RT wrote:
Now cherry-picked into maint-5.18 as -- |
@iabyn - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#118175 (status was 'resolved')
Searchable as RT118175$
The text was updated successfully, but these errors were encountered: