Closed p5pRT closed 9 years ago
Attached is a patch to bring Test-Simple up to alpha 076 in blead.
This fixes a couple downstream modules such as Test::WWW::Mechanize.
-Chad
On Sat Nov 22 13:07:46 2014\, exodist7@gmail.com wrote:
Attached is a patch to bring Test-Simple up to alpha 076 in blead.
This fixes a couple downstream modules such as Test::WWW::Mechanize.
-Chad
Pushed to blead in commit 136323e46f5f3fabc977dadf1206c0686aa4c585
Thank you very much.
-- James E Keenan (jkeenan@cpan.org)
The RT System itself - Status changed from 'new' to 'open'
@jkeenan - Status changed from 'open' to 'resolved'
Chad: We're getting one test failure from this patch set on our Win32 smoke test server:
../cpan/Test-Simple/t/Legacy/fork_die.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0.
See: http://perl5.git.perl.org:8080/job/perl5-win32/560/console
Can you investigate?
Thank you very much.
-- James E Keenan (jkeenan@cpan.org)
@jkeenan - Status changed from 'resolved' to 'open'
I will try to get a follow-up patch this evening to address the issue. If someone wants to simply remove the test for now I will re-add it in my follow up. It is a non critical failure\, a bug in the test\, not the module.
On Sat\, Nov 22\, 2014\, 7:15 PM James E Keenan via RT \< perlbug-followup@perl.org> wrote:
Chad: We're getting one test failure from this patch set on our Win32 smoke test server:
../cpan/Test-Simple/t/Legacy/fork_die.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0.
See: http://perl5.git.perl.org:8080/job/perl5-win32/560/console
Can you investigate?
Thank you very much.
-- James E Keenan (jkeenan@cpan.org)
On Sat Nov 22 19:15:10 2014\, jkeenan wrote:
Chad: We're getting one test failure from this patch set on our Win32 smoke test server:
../cpan/Test-Simple/t/Legacy/fork_die.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0.
See: http://perl5.git.perl.org:8080/job/perl5-win32/560/console
Can you investigate?
Thank you very much.
SEGV. This is -O1 VC Perl.
First-chance exception at 0x2808c813 (perl521.dll) in perl.exe: 0xC0000005: Access violation writing location 0x00000000.
perl521.dll!Perl_sv_setpvn(interpreter * my_perl=0x00c4abdc\, sv * const sv=0x00e1169c\, const char * const ptr=0x280f4583\, const unsigned int len=0) Line 4922 C perl521.dll!Perl_create_eval_scope(interpreter * my_perl=0x00c4abdc\, unsigned long flags=269) Line 4380 + 0x6b C perl521.dll!Perl_call_sv(interpreter * my_perl=0x280c5f3b\, sv * sv=0x00cc59f4\, volatile long flags=17759824) Line 2724 C perl521.dll!Perl_call_list(interpreter * my_perl=0x00c4abdc\, long oldscope=1\, av * paramList=0x00e1136c) Line 4841 C perl521.dll!win32_start_child(void * arg=0x00c4abdc) Line 1796 + 0xb C kernel32.dll!_BaseThreadStart@8() + 0x37
SvUPGRADE(sv\, SVt_PV);
dptr = SvGROW(sv\, len + 1); Move(ptr\,dptr\,len\,char); dptr[len] = '\0';\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<CRASH SvCUR_set(sv\, len); (void)SvPOK_only_UTF8(sv); /* validate pointer */ SvTAINT(sv); if (SvTYPE(sv) == SVt_PVCV) CvAUTOLOAD_off(sv); }
in Perl_create_eval_scope execution is at
Perl_create_eval_scope(pTHX_ U32 flags)
{
PERL_CONTEXT *cx;
const I32 gimme = GIMME_V;
ENTER_with_name("eval_scope");
SAVETMPS;
PUSHBLOCK(cx\, (CXt_EVAL|CXp_TRYBLOCK)\, PL_stack_sp); PUSHEVAL(cx\, 0);
PL_in_eval = EVAL_INEVAL; if (flags & G_KEEPERR) PL_in_eval |= EVAL_KEEPERR; else CLEAR_ERRSV();\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\< if (flags & G_FAKINGEVAL) { PL_eval_root = PL_op; /* Only needed so that goto works right. */ } return cx; }
Other thread at crash point
ntdll.dll!_KiFastSystemCallRet@0()
ntdll.dll!_ZwWaitForMultipleObjects@20() + 0xc
kernel32.dll!_WaitForMultipleObjectsEx@20() - 0x48
user32.dll!_RealMsgWaitForMultipleObjectsEx@20() + 0xd9
user32.dll!_MsgWaitForMultipleObjects@20() + 0x1f
perl521.dll!win32_msgwait(interpreter * my_perl=0x00365fe4\, unsigned long count=1\, void * * handles=0x0012fc74\, unsigned long timeout=4294967295\, unsigned long * resultp=0x0012fc7c) Line 2242 C
perl521.dll!win32_waitpid(int pid=1924\, int * status=0x0012fcb0\, int flags=1) Line 2350 + 0x13 C
perl521.dll!Perl_wait4pid(interpreter * my_perl=0x7ffd4000\, int pid=-7256\, int * statusp=0x0012fcb0\, int flags=0) Line 2998 + 0x13 C
perl521.dll!Perl_pp_waitpid(interpreter * my_perl=0x00000000) Line 4203 + 0x32 C
perl521.dll!Perl_runops_standard(interpreter * my_perl=0x00365fe4) Line 41 + 0x4 C
perl521.dll!S_run_body(interpreter * my_perl=0x7ffd4000\, long oldscope=1) Line 2420 + 0xa C
perl521.dll!perl_run(interpreter * my_perl=0x00365fe4) Line 2343 + 0x8 C
perl521.dll!RunPerl(int argc=4\, char * * argv=0x01363f70\, char * * env=0x00363090) Line 258 + 0x6 C
perl.exe!mainCRTStartup() Line 398 + 0xe C
kernel32.dll!_BaseProcessStart@4() + 0x23
In crashed thread curcop is
sub subtest { my ($class\, $name\, $code\, @args) = @_;
my $ctx = context();
$ctx->throw("subtest()'s second argument must be a code ref") unless $code && 'CODE' eq reftype($code);
$ctx->child('push'\, $name); $ctx->clear; my $todo = $ctx->hide_todo;
my $pid = $$;
my ($succ\, $err) = try { { no warnings 'once'; local $Test::Builder::Level = 1; $code->(@args); }
$ctx->set; my $stream = $ctx->stream; $ctx->done_testing unless $stream->plan || $stream->ended;
require Test::Stream::ExitMagic; { local $? = 0; Test::Stream::ExitMagic->new->do_magic($stream\, $ctx->snapshot); } };
if ($$ != $pid && !$ctx->stream->_use_fork) { warn \<\<" EOT"; Subtest finished with a new PID ($$ vs $pid) while forking support was turned off! This is almost certainly not what you wanted. Did you fork and forget to exit? EOT
# Did the forked process try to exit via die? die $err unless $succ;\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\< }
# If a subtest forked\, then threw an exception\, we need to propogate that right away. die $err unless $succ || $$ == $pid || $err->isa('Test::Stream::Event');
$ctx->set; $ctx->restore_todo($todo); # This sends the subtest event my $st = $ctx->child('pop'\, $name);
unless ($succ) { die $err unless blessed($err) && $err->isa('Test::Stream::Event'); $ctx->bail($err->reason) if $err->isa('Test::Stream::Event::Bail'); }
return $st->bool; }
The SV in question is freed see attached.
The highlighted line\, even tho its probably uninit/misused memory\, had the following interesting string pointer in it.
+ xpv_len_u {xpvlenu_len=14859588 xpvlenu_pv=0x00e2bd44 "This process did something wrong! at t/Legacy/fork_die.t line 53. " } xpvmg::__unnamed
the SV in the GV in PL_errsv is also free and is the one in 1st pic
-- bulk88 ~ bulk88 at hotmail.com
[sv dump.PNG](https://rt-archive.perl.org/perl5/Ticket/Attachment/1319813/702907/sv dump.PNG)
I was pretty sure this test could not pass on windows\, even though I do not have a windows system handy to test (Not home right now). There are a couple such tests in Test-Simple like this that simply skip on systems without a real fork. I will make this test skip on such systems just like the others do.
I intend to release the following once I have done my own testing: https://github.com/Test-More/test-more/commit/eb36b876c55b8ec0bbad4561f2114f1e360277d0
It will be part of the patch I will submit to this thread. I just need to do my testing first\, which takes an hour or so. I need to build blead on this system (linux). I also need to run my downstream tests that build half of cpan against the new Test::Simple version.
However if the issue highlighted is actually a bug in perl itself\, I have no objections to having it fixed :-).
-Chad
On Sat Nov 22 2014 at 7:50:08 PM bulk88 via RT \perlbug\-followup@​perl\.org wrote:
On Sat Nov 22 19:15:10 2014\, jkeenan wrote:
Chad: We're getting one test failure from this patch set on our Win32 smoke test server:
../cpan/Test-Simple/t/Legacy/fork_die.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 1 tests but ran 0.
See: http://perl5.git.perl.org:8080/job/perl5-win32/560/console
Can you investigate?
Thank you very much.
SEGV. This is -O1 VC Perl.
First-chance exception at 0x2808c813 (perl521.dll) in perl.exe: 0xC0000005: Access violation writing location 0x00000000.
perl521\.dll\!Perl\_sv\_setpvn\(interpreter \* my\_perl=0x00c4abdc\, sv \*
const sv=0x00e1169c\, const char * const ptr=0x280f4583\, const unsigned int len=0) Line 4922 C perl521.dll!Perl_create_eval_scope(interpreter * my_perl=0x00c4abdc\, unsigned long flags=269) Line 4380 + 0x6b C perl521.dll!Perl_call_sv(interpreter * my_perl=0x280c5f3b\, sv * sv=0x00cc59f4\, volatile long flags=17759824) Line 2724 C perl521.dll!Perl_call_list(interpreter * my_perl=0x00c4abdc\, long oldscope=1\, av * paramList=0x00e1136c) Line 4841 C perl521.dll!win32_start_child(void * arg=0x00c4abdc) Line 1796 + 0xb C kernel32.dll!_BaseThreadStart@8() + 0x37
SvUPGRADE\(sv\, SVt\_PV\); dptr = SvGROW\(sv\, len \+ 1\); Move\(ptr\,dptr\,len\,char\); dptr\[len\] = '\\0';\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<CRASH SvCUR\_set\(sv\, len\); \(void\)SvPOK\_only\_UTF8\(sv\); /\* validate pointer \*/ SvTAINT\(sv\); if \(SvTYPE\(sv\) == SVt\_PVCV\) CvAUTOLOAD\_off\(sv\);
}
in Perl_create_eval_scope execution is at
Perl_create_eval_scope(pTHX_ U32 flags) { PERL_CONTEXT *cx; const I32 gimme = GIMME_V;
ENTER\_with\_name\("eval\_scope"\); SAVETMPS; PUSHBLOCK\(cx\, \(CXt\_EVAL|CXp\_TRYBLOCK\)\, PL\_stack\_sp\); PUSHEVAL\(cx\, 0\); PL\_in\_eval = EVAL\_INEVAL; if \(flags & G\_KEEPERR\) PL\_in\_eval |= EVAL\_KEEPERR; else CLEAR\_ERRSV\(\);\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\< if \(flags & G\_FAKINGEVAL\) \{ PL\_eval\_root = PL\_op; /\* Only needed so that goto works right\. \*/ \} return cx;
}
Other thread at crash point
ntdll\.dll\!\_KiFastSystemCallRet@​0\(\) ntdll\.dll\!\_ZwWaitForMultipleObjects@​20\(\) \+ 0xc kernel32\.dll\!\_WaitForMultipleObjectsEx@​20\(\) \- 0x48 user32\.dll\!\_RealMsgWaitForMultipleObjectsEx@​20\(\) \+ 0xd9 user32\.dll\!\_MsgWaitForMultipleObjects@​20\(\) \+ 0x1f perl521\.dll\!win32\_msgwait\(interpreter \* my\_perl=0x00365fe4\,
unsigned long count=1\, void * * handles=0x0012fc74\, unsigned long timeout=4294967295\, unsigned long * resultp=0x0012fc7c) Line 2242 C perl521.dll!win32_waitpid(int pid=1924\, int * status=0x0012fcb0\, int flags=1) Line 2350 + 0x13 C perl521.dll!Perl_wait4pid(interpreter * my_perl=0x7ffd4000\, int pid=-7256\, int * statusp=0x0012fcb0\, int flags=0) Line 2998 + 0x13 C perl521.dll!Perl_pp_waitpid(interpreter * my_perl=0x00000000) Line 4203 + 0x32 C perl521.dll!Perl_runops_standard(interpreter * my_perl=0x00365fe4) Line 41 + 0x4 C perl521.dll!S_run_body(interpreter * my_perl=0x7ffd4000\, long oldscope=1) Line 2420 + 0xa C perl521.dll!perl_run(interpreter * my_perl=0x00365fe4) Line 2343 + 0x8 C perl521.dll!RunPerl(int argc=4\, char * * argv=0x01363f70\, char * * env=0x00363090) Line 258 + 0x6 C perl.exe!mainCRTStartup() Line 398 + 0xe C kernel32.dll!_BaseProcessStart@4() + 0x23
In crashed thread curcop is
sub subtest { my ($class\, $name\, $code\, @args) = @_;
my $ctx = context\(\); $ctx\->throw\("subtest\(\)'s second argument must be a code ref"\) unless $code && 'CODE' eq reftype\($code\); $ctx\->child\('push'\, $name\); $ctx\->clear; my $todo = $ctx\->hide\_todo; my $pid = $$; my \($succ\, $err\) = try \{ \{ no warnings 'once'; local $Test​::Builder​::Level = 1; $code\->\(@​args\); \} $ctx\->set; my $stream = $ctx\->stream; $ctx\->done\_testing unless $stream\->plan || $stream\->ended; require Test​::Stream​::ExitMagic; \{ local $? = 0; Test​::Stream​::ExitMagic\->new\->do\_magic\($stream\,
$ctx->snapshot); } };
if \($$ \!= $pid && \!$ctx\->stream\->\_use\_fork\) \{ warn \<\<" EOT";
Subtest finished with a new PID ($$ vs $pid) while forking support was turned off! This is almost certainly not what you wanted. Did you fork and forget to exit? EOT
\# Did the forked process try to exit via die? die $err unless $succ;\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<
\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\<\< }
\# If a subtest forked\, then threw an exception\, we need to propogate
that right away. die $err unless $succ || $$ == $pid || $err->isa('Test::Stream:: Event');
$ctx\->set; $ctx\->restore\_todo\($todo\); \# This sends the subtest event my $st = $ctx\->child\('pop'\, $name\); unless \($succ\) \{ die $err unless blessed\($err\) && $err\->isa\('Test​::Stream​::Event'\); $ctx\->bail\($err\->reason\) if $err\->isa\('Test​::Stream​::
Event::Bail'); }
return $st\->bool;
}
The SV in question is freed see attached.
The highlighted line\, even tho its probably uninit/misused memory\, had the following interesting string pointer in it.
+ xpv_len_u {xpvlenu_len=14859588 xpvlenu_pv=0x00e2bd44 "This process did something wrong! at t/Legacy/fork_die.t line 53. " } xpvmg::__unnamed
the SV in the GV in PL_errsv is also free and is the one in 1st pic
-- bulk88 ~ bulk88 at hotmail.com
This patch *should* fix the window issue\, and brings blead up to alpha 077. I do not have a windows system available\, so I will rely on someone else to verify it in windows. I have verified it on my system\, and all my downstream checks also passed (linux only).
On Sat Nov 22 20:12:04 2014\, exodist7@gmail.com wrote:
However if the issue highlighted is actually a bug in perl itself\, I have no objections to having it fixed :-).
-Chad
At my_perl->Ierrgv->sv_u.svu_gp->gp_sv and curcop
In Test::Stream::Util
sub try(&) { my $code = shift; my $error; my $ok;
{ local ($@\, $!\, $SIG{__DIE__});\<\<\<\<\<\<\<\<\<\<\<CURCOP $ok = eval { $code->(); 1 } || 0; unless($ok) { $error = $@ || "Error was squashed!\n"; } study ""; }
return wantarray ? ($ok\, $error) : $ok; }
perl521.dll!Perl_leave_scope(interpreter * my_perl=0x00ccf81c\, long base=35) Line 828 C perl521.dll!Perl_pop_scope(interpreter * my_perl=0x00ccf81c) Line 104 + 0x18 C perl521.dll!Perl_pp_leaveloop(interpreter * my_perl=0x00ccf81c) Line 2263 + 0xa7 C perl521.dll!Perl_runops_debug(interpreter * my_perl=0x00ccf81c) Line 2242 + 0xd C perl521.dll!win32_start_child(void * arg=0x00ccf81c) Line 1772 + 0xd C++ kernel32.dll!_BaseThreadStart@8() + 0x37
case SAVEt_SV: /* scalar reference */ svp = &GvSV(ARG1_GV); refsv = ARG1_SV; /* what to refcnt_dec */ restore_sv: { SV * const sv = *svp; *svp = ARG0_SV; SvREFCNT_dec(sv); if (UNLIKELY(SvSMAGICAL(ARG0_SV))) { PL_localizing = 2; mg_set(ARG0_SV); PL_localizing = 0; } SvREFCNT_dec_NN(ARG0_SV);\<\<\<\<\<\<\<\<\<\<\<$@ got freed SvREFCNT_dec(refsv); break; }
I am going to say this is the same bug as in #40565 .
-- bulk88 ~ bulk88 at hotmail.com
Yikes\, just cought up on that ticket... yeah\, just gonna skip the test on windows. Though this explains why most forking tests using Test::Builder have issues on windows! I have always wondered what it was.
I may put a hack in Test::Builder to not localize certain ones\, or manually stash and restore them when windows is in use to fix a LOT of things that simply do not work in windows.
On Sat\, Nov 22\, 2014\, 9:58 PM bulk88 via RT \perlbug\-followup@​perl\.org wrote:
On Sat Nov 22 20:12:04 2014\, exodist7@gmail.com wrote:
However if the issue highlighted is actually a bug in perl itself\, I have no objections to having it fixed :-).
-Chad
At my_perl->Ierrgv->sv_u.svu_gp->gp_sv and curcop
In Test::Stream::Util
sub try(&) { my $code = shift; my $error; my $ok;
\{ local \($@​\, $\!\, $SIG\{\_\_DIE\_\_\}\);\<\<\<\<\<\<\<\<\<\<\<CURCOP $ok = eval \{ $code\->\(\); 1 \} || 0; unless\($ok\) \{ $error = $@​ || "Error was squashed\!\\n"; \} study ""; \} return wantarray ? \($ok\, $error\) : $ok;
}
perl521\.dll\!Perl\_leave\_scope\(interpreter \* my\_perl=0x00ccf81c\,
long base=35) Line 828 C perl521.dll!Perl_pop_scope(interpreter * my_perl=0x00ccf81c) Line 104 + 0x18 C perl521.dll!Perl_pp_leaveloop(interpreter * my_perl=0x00ccf81c) Line 2263 + 0xa7 C perl521.dll!Perl_runops_debug(interpreter * my_perl=0x00ccf81c) Line 2242 + 0xd C perl521.dll!win32_start_child(void * arg=0x00ccf81c) Line 1772 + 0xd C++ kernel32.dll!_BaseThreadStart@8() + 0x37
case SAVEt\_SV​: /\* scalar reference \*/ svp = &GvSV\(ARG1\_GV\); refsv = ARG1\_SV; /\* what to refcnt\_dec \*/ restore\_sv​: \{ SV \* const sv = \*svp; \*svp = ARG0\_SV; SvREFCNT\_dec\(sv\); if \(UNLIKELY\(SvSMAGICAL\(ARG0\_SV\)\)\) \{ PL\_localizing = 2; mg\_set\(ARG0\_SV\); PL\_localizing = 0; \} SvREFCNT\_dec\_NN\(ARG0\_SV\);\<\<\<\<\<\<\<\<\<\<\<$@​ got freed SvREFCNT\_dec\(refsv\); break; \}
I am going to say this is the same bug as in #40565 .
-- bulk88 ~ bulk88 at hotmail.com
--- via perlbug: queue: perl5 status: open https://rt-archive.perl.org/perl5/Ticket/Display.html?id=123277
Here is a patch to alpha 078\, This should fix the windows issues. It also won't explode like the 077 patch would have if it had been applied.
Notes: * Skip problematic test on windows\, it doesn't really apply to windows systems anyway * Revert flow-control change that broke an incredible amount of stuff.
This patch applies to current blead\, do not apply any other patches in this ticket (also do not revert the one that was already applied)
On Sun Nov 23 16:45:37 2014\, exodist7@gmail.com wrote:
Here is a patch to alpha 078\, This should fix the windows issues. It also won't explode like the 077 patch would have if it had been applied.
Notes: * Skip problematic test on windows\, it doesn't really apply to windows systems anyway * Revert flow-control change that broke an incredible amount of stuff.
This patch applies to current blead\, do not apply any other patches in this ticket (also do not revert the one that was already applied)
Thank you. Applied as 2e52a9b871.
--
Father Chrysostomos
@cpansprout - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#123277 (status was 'resolved')
Searchable as RT123277$