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

Re: Unbalanced saves: 2 more saves than restores sincee9bc6d6b34afc0063cc5181b59f77eeb81b1182d

Thread Previous
From:
demerphq
Date:
February 26, 2018 02:20
Subject:
Re: Unbalanced saves: 2 more saves than restores sincee9bc6d6b34afc0063cc5181b59f77eeb81b1182d
Message ID:
CANgJU+VoKZ0O0-7WdT62iU_zpPOU7SGf-atRozHKu-4xtd0vFw@mail.gmail.com
On 25 February 2018 at 17:14, demerphq <demerphq@gmail.com> wrote:
> Ever since e9bc6d6b34afc0063cc5181b59f77eeb81b1182d I see the error
> from the subject line for most tests when running make test, although
> they are not present when running make test_harness
>
> Example sequence:
>
> $ git clean -dfx
> $ ./Configure -Dusethreads -Doptimize=-g -d -Dusedevel -Dcc=ccache\
> gcc -Dld=gcc -DDEBUGGING
> $ TEST_FILES=base/rs.t make -j8 test
>
> And then i see stuff like this:
>
> $ ./runtests choose
> t/base/rs ... Unbalanced saves: 2 more saves than restores
> ok
> All tests successful.
> Elapsed: 0 sec
>
> When I go to the preceding commit ddd5ebe0cadc81a0360ad8007674490fda89ee88
>
> ./runtests choose
> t/base/rs ... ok
> All tests successful.
> Elapsed: 0 sec
> u=0.01  s=0.00  cu=0.00  cs=0.00  scripts=1  tests=41
>
> Running e9bc6d6b34afc0063cc5181b59f77eeb81b1182d under test_harness
> instead of test:
>
> TESTFILE=harness  ./runtests choose
> base/rs.t .. ok
> All tests successful.
> Files=1, Tests=41,  0 wallclock secs ( 0.02 usr +  0.00 sys =  0.02 CPU)
> Result: PASS
>
> Karl I hope this helps you debug this...

I pushed:

cb3fd6ac9362413a80d297fb7708846bd904102b

which moves the call to init_i18nl10n() to be the very last thing done
in perl_construct(), right after the ENTER, which then means that any
SAVEFREEPV calls happen inside of a lexical scope.

This fixed the warnings about unbalanced saves.

perl_construct is tricky, people have to be careful where they put
logic into it.  For instance prior to my patch under debugging we
might end up using PerlIO before PerlIO_init has been called, or even
before the hash function logic has been properly initialized. IMO
PerlIO_init and hash function initialization should happen well before
any other code is executed.

cheers,
Yves


-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

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