develooper Front page | perl.perl5.porters | Postings from February 2020

Re: How to bisect for first commit at which a test passes?

Thread Previous | Thread Next
From:
James E Keenan
Date:
February 2, 2020 04:18
Subject:
Re: How to bisect for first commit at which a test passes?
Message ID:
20200202041757.20347.qmail@lists-nntp.develooper.com
On 2/1/20 10:43 PM, hv@crypt.org wrote:
> I wrote:
> :James E Keenan <jkeenan@pobox.com> wrote:
> ::[perl2] $ ./perl -v | head -2 | tail -1
> ::This is perl 5, version 31, subversion 3 (v5.31.3) built for
> ::amd64-freebsd-thread-multi
> ::[perl2] $ ( cd t ; ./perl op/sprintf2.t >/dev/null ) ; echo $?
> ::0
> ::[perl2] $ ( cd t ; ./perl harness op/sprintf2.t >/dev/null ) ; echo $?
> ::0
> :
> :Umm, that's 5.31.3, we expected that to pass.
> :
> :If you get the same with 5.31.2, try the harness invocation without the
> :'>/dev/null' - if it still reports a non-zero exit status but itself
> :exits with 0, we should make a ticket to consider whether that's correct
> :behaviour. (My guess is that it's not correct, but that it would need
> :a bunch of toolchain work to propagate the information correctly.)
> 
> Sorry, that's all garbage, I misread and over-cut.
> 
> You had also said:
> :This is perl 5, version 31, subversion 2 (v5.31.2) built for
> :amd64-freebsd-thread-multi
> :[perl] $ ( cd t ; ./perl op/sprintf2.t >/dev/null ) ; echo $?
> :9
> :[perl] $ ( cd t ; ./perl harness op/sprintf2.t >/dev/null ) ; echo $?
> :9
> 
> So these cases are both correctly returning non-zero. Needs further
> investigation to understand where bisect is getting confused: either
> there's a bug in bisect itself, or it creates an environmental
> difference.
> 
> I'll look further tomorrow; I may have to find a way to induce a more
> reproducible SEGV so I can try it locally, or try again to understand
> what ether was saying.
> 
> Hugo
> 

I wasn't able (yet) to figure out how to invoke Porting/bisect.pl per 
your suggestions.  So I resorted to manual bisection, i.e., I identified 
the commit range, numbered the commits, and just went through the range 
calling:

#####

#####

And -- you guessed it -- the first good commit was yours!

#####
commit a06a4d45d476265b6d5143171126fe6f33ef2c44
Author:     Hugo van der Sanden <hv@crypt.org>
AuthorDate: Mon Jul 22 16:29:13 2019 +0100
Commit:     Hugo van der Sanden <hv@crypt.org>
CommitDate: Wed Jul 31 13:32:12 2019 +0100

     [perl #134172] restrict scope of locale changes during sprintf
#####

Now, two interesting findings ...

1. t/op/sprintf2.t is one of the tests exercised by 'make minitest'.  So 
if I say:

#####
sh ./Configure -des -Dusedevel -Duseithreads \
-Dcc="g++7" \
-Accflags="-Wl,-rpath=/usr/local/lib/gcc7" \
-Aldflags="-Wl,-rpath=/usr/local/lib/gcc7" \
&& make minitest
#####

... then, when we get to t/op/sprintf2.t, we see:

#####
t/op/sprintf ................... ok
t/op/sprintf2 .................. FAILED--non-zero wait status: 139
t/op/srand ..................... ok
#####

at either v5.31.2 or at the last "bad" commit before the one identified 
above.

2. We can do better.  If we call 'make miniperl' and then call just 
enough miniperl commands to be able to run t/op/sprintf2.t:

#####
$ $ sh ./Configure -des -Dusedevel -Duseithreads \ 
                      -Dcc="g++7" \ 
 
-Accflags="-Wl,-rpath=/usr/local/lib/gcc7" \ 
 
-Aldflags="-Wl,-rpath=/usr/local/lib/gcc7" \ 
                                       && make miniperl && \ 
 
      ./miniperl -Ilib make_patchnum.pl && \ 
                                             ./miniperl -Ilib configpm 
&& \ 
             ./miniperl -Ilib t/op/sprintf2.t; echo $? ERROR
#####

... we get either '9 ERROR' or '0 ERROR' depending on whether we're at 
the last "bad" commit (or tag v5.31.2) or the first "good" commit (or 
tag v5.31.3 or later).

Thank you very much.
Jim Keenan

Thread Previous | Thread Next


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