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

[perl #133603] 5.29.4 - re/subst.t crashes perl on 64-bit Windows

Thread Previous
From:
sisyphus@cpan.org via RT
Date:
December 2, 2018 07:46
Subject:
[perl #133603] 5.29.4 - re/subst.t crashes perl on 64-bit Windows
Message ID:
rt-4.0.24-1829-1543736804-963.133603-15-0@perl.org
On Mon, 22 Oct 2018 21:30:30 -0700, tonyc wrote:
> On Tue, Oct 23, 2018 at 11:20:29AM +1100, Tony Cook wrote:
> > On Sun, Oct 21, 2018 at 09:54:41PM -0700, sisyphus@cpan.org via RT
> > wrote:
> > > This bug might be specific to my mingw-w64 port of gcc-8.1.0 -
> > > though there was no such problem with 5.29.3.
> > > When I build 5.29.4 with my mingw-w64 port of gcc-7.3.0,
> > > t/re/subst.t is fine.
> > >
> > > If (using gcc-8.1.0) I skip the offending "read-only COW =~ s/does
> > > not match// should croak" test, that test script then runs ok and
> > > all tests except for IO/Socket.t (see #133604) pass.
> > >
> > > However,I have now detected that t/run/fresh_perl.t is behaving
> > > strangely.
> > > After the first 16 tests have passed, I get a pop-up box telling me
> > > that perl has stopped working.
> > > But when I acknowledge that pop-up box, the test script continues
> > > on successfully and reports no failure.
> > > I get:
> > >
> > > ....
> > > ok 15 - push(@a, 1, 2, 3,)
> > > ok 16 - quotemeta ""
> > > <process hangs until I acknowledge the pop-up box>
> > > ok 17 - for ("ABCDE") {
> > > ok 18 - package FOO;sub new {bless {FOO => BAR}};
> > > ....
> > >
> > > with all test passing.
> >
> > I can't reproduce either failure:
> >
> > J:\dev\perl\git\perl\t>.\perl -I..\lib -V:gccversion
> > gccversion='8.1.0';
> >
> > J:\dev\perl\git\perl\t>.\perl harness run\fresh_perl.t
> > run/fresh_perl.t .. ok
> > All tests successful.
> > Files=1, Tests=92,  6 wallclock secs ( 0.03 usr +  0.03 sys =  0.06
> > CPU)
> > Result: PASS
> >
> > J:\dev\perl\git\perl\t>.\perl -I..\lib -V:ptrsize
> > ptrsize='8';
> >
> > J:\dev\perl\git\perl\t>.\perl harness re\subst.t
> > re/subst.t .. ok
> > All tests successful.
> > Files=1, Tests=276,  1 wallclock secs ( 0.02 usr +  0.01 sys =  0.03
> > CPU)
> > Result: PASS
> >
> > I didn't get a popup from fresh_perl.t
> >
> > I started from a clean tree, and built with:
> >
> > gmake -j2 CFG=Debug test-prep
> 
> Building with a default CFG, or by eliminating -DDEBUGGING I can
> reproduce it:
> 
> ok 236 - vivifying stash elem in $that::{elem} =~ s//.../e
> gdb: unknown target exception 0xc0000028 at 0x77a28658
> 
> Program received signal ?, Unknown signal.
> 0x0000000077a28658 in ntdll!RtlRaiseStatus ()
>    from C:\Windows\SYSTEM32\ntdll.dll
> (gdb) bt
> #0  0x0000000077a28658 in ntdll!RtlRaiseStatus ()
>    from C:\Windows\SYSTEM32\ntdll.dll
> #1  0x00000000779e7109 in ntdll!longjmp () from
> C:\Windows\SYSTEM32\ntdll.dll
> #2  0x000007fefe39e5a3 in msvcrt!longjmp ()
>    from C:\Windows\system32\msvcrt.dll
> #3  0x0000000069944310 in Perl_die_unwind
> (my_perl=my_perl@entry=0x2f6fe8,
>     msv=msv@entry=0x2807fd8) at ..\pp_ctl.c:1790
> #4  0x00000000699cc74a in Perl_vcroak (my_perl=0x2f6fe8,
> pat=<optimized out>,
>     args=<optimized out>) at ..\util.c:1715
> #5  0x00000000699cc826 in Perl_croak_nocontext (
>     pat=0x69b4ccd7 <details+1335> "%s") at ..\util.c:1749
> #6  0x00000000699ccdd7 in Perl_croak_no_modify () at ..\util.c:1778
> #7  0x0000000069968890 in Perl_pp_subst (my_perl=0x2f6fe8) at
> ..\pp_hot.c:4164
> #8  0x00000000699c3506 in Perl_runops_standard (my_perl=0x2f6fe8)
>     at ..\run.c:42
> #9  0x000000006997fc50 in S_run_body (oldscope=<optimized out>,
>     my_perl=<optimized out>) at perl.c:2683
> #10 perl_run (my_perl=0x699d2e70 <xs_init(PerlInterpreter*)>,
>     my_perl@entry=0x2f6fe8) at perl.c:2611
> #11 0x00000000699d6538 in RunPerl (argc=<optimized out>,
>     argv=<optimized out>, env=0x443b20) at perllib.c:251
> #12 0x00000000004013c7 in __tmainCRTStartup ()
> #13 0x00000000004014fb in mainCRTStartup ()
> 
> and the fresh_perl test:
> 
> tarting program: J:\dev\perl\git\perl\t\perl.exe ..\t.pl
> New Thread 9312.0x234c]
> odification of a read-only value attempted at ..\t.pl line 3.
> db: unknown target exception 0xc0000028 at 0x77a28658
> 
> rogram received signal ?, Unknown signal.
> x0000000077a28658 in ntdll!RtlRaiseStatus ()
>   from C:\Windows\SYSTEM32\ntdll.dll
> gdb) bt
> 0  0x0000000077a28658 in ntdll!RtlRaiseStatus ()
>   from C:\Windows\SYSTEM32\ntdll.dll
> 1  0x00000000779e7109 in ntdll!longjmp () from
> C:\Windows\SYSTEM32\ntdll.dll
> 2  0x000007fefe39e5a3 in msvcrt!longjmp ()
>   from C:\Windows\system32\msvcrt.dll
> 3  0x000000006997707e in S_my_exit_jump
> (my_perl=my_perl@entry=0x496fc8)
>    at perl.c:5239
> 4  0x000000006997fe6c in Perl_my_failure_exit (
>    my_perl=my_perl@entry=0x496fc8) at perl.c:5221
> 5  0x0000000069944323 in Perl_die_unwind
> (my_perl=my_perl@entry=0x496fc8,
>    msv=msv@entry=0x49a628) at ..\pp_ctl.c:1796
> 6  0x00000000699cc74a in Perl_vcroak (my_perl=0x496fc8, pat=<optimized
> out>,
>    args=<optimized out>) at ..\util.c:1715
> 7  0x00000000699cc826 in Perl_croak_nocontext (
>    pat=0x69b4ccd7 <details+1335> "%s") at ..\util.c:1749
> 8  0x00000000699ccdd7 in Perl_croak_no_modify () at ..\util.c:1778
> 9  0x0000000069968890 in Perl_pp_subst (my_perl=0x496fc8) at
> ..\pp_hot.c:4164
> 10 0x00000000699c3506 in Perl_runops_standard (my_perl=0x496fc8)
>    at ..\run.c:42
> 11 0x000000006997fd47 in S_run_body (oldscope=<optimized out>,
>    my_perl=<optimized out>) at perl.c:2688
> 12 perl_run (my_perl=0x699d2e70 <xs_init(PerlInterpreter*)>,
>    my_perl@entry=0x496fc8) at perl.c:2611
> 13 0x00000000699d6538 in RunPerl (argc=<optimized out>,
>    argv=<optimized out>, env=0x1bd3b20) at perllib.c:251
> 14 0x00000000004013c7 in __tmainCRTStartup ()
> 15 0x00000000004014fb in mainCRTStartup ()
> 
> Tony

Haven't made any progress with this.
One correction to make - I stated above that "nvtype=long double" builds were unaffected, but that is incorrect.
They are affected in exactly the same way as "nvtype=double" builds.

Other than that, all I have is a couple of one-liners (based on the t/run/fresh_perl.t and t/re/subst.t failures) that demonstrate the problem:

C:\>perl -le "for('A') {s/b/c/}"
Modification of a read-only value attempted at -e line 1.

C:\>perl -le "for(__PACKAGE__) {s/b/c/}"
Modification of a read-only value attempted at -e line 1.

C:\>

In both cases a "perl.exe has stopped working" pop-up appears after the error message has been presented, and the process doesn't exit until the pop-up has been acknowledged.

One heisenbuggy aspect that I noticed was that if I preceded the above code with a Devel::Peek::Dump() of an arbitrary string, then there was no crash to contend with. That is, this one liner (for example) behaves exactly as it ought:

C:\>perl -MDevel::Peek -le "Dump('x'); for('A') {s/b/c/}"
SV = PV(0x37c668) at 0x47c350
  REFCNT = 1
  FLAGS = (POK,IsCOW,READONLY,PROTECT,pPOK)
  PV = 0x486888 "x"\0
  CUR = 1
  LEN = 10
  COW_REFCNT = 0
Modification of a read-only value attempted at -e line 1.

C:\>

Problem still persists in 5.29.5.

Cheers,
Rob




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

Thread Previous


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