perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hay <steve....@uk.radan.com>
Subject Re: t/perl/ithreads.t revisited
Date Mon, 13 Dec 2004 14:34:29 GMT
Steve Hay wrote:

>Anyway, I've made an interesting new discovery:  the ithreads.t test 
>crashes the server because ithreads.pm contains "use warnings FATAL => 
>'all'".  Simply commenting-out that line, the skeleton test now succeeds!
>
Furthermore, the full svn (rev 111694) test suite, with 
t/perl/ithreads.t re-enabled, also works!  The warnings now appear in 
the console window:

t\perl\ithreads.........................Attempt to free temp 
prematurely: SV 0x8437b04, Perl interpreter: 0x470e764 at 
C:\Temp\mod_perl-2.0\t\response/TestPerl/ithreads.pm line 44.
Attempt to free temp prematurely: SV 0x84378dc, Perl interpreter: 
0x470e764 at C:\Temp\mod_perl-2.0\t\response/TestPerl/ithreads.pm line 44.
Attempt to free temp prematurely: SV 0x476b4a0, Perl interpreter: 
0x470e764 at C:\Temp\mod_perl-2.0\t\response/TestPerl/ithreads.pm line 44.
Scalars leaked: 3
Attempt to free temp prematurely: SV 0x83d06e4, Perl interpreter: 
0x7b522a4 at C:\Temp\mod_perl-2.0\t\response/TestPerl/ithreads.pm line 61.
Attempt to free temp prematurely: SV 0x83d04bc, Perl interpreter: 
0x7b522a4 at C:\Temp\mod_perl-2.0\t\response/TestPerl/ithreads.pm line 61.
Attempt to free temp prematurely: SV 0x4763bd4, Perl interpreter: 
0x7b522a4 at C:\Temp\mod_perl-2.0\t\response/TestPerl/ithreads.pm line 61.
Scalars leaked: 3

Lines 44 & 61 are respectively the last lines of these two chunks:

        my $thr = threads->new(sub {
            my $tid = threads->self->tid;
            debug "2nd TID is $tid" if defined $tid;
            return 2;
        });

        my $thr = threads->new(sub {
            my $tid = threads->self->tid;
            debug "2nd TID is $tid" if defined $tid;
            $counter_priv += $counter_priv for 1..10;
            {
                lock $counter_shar;
                $counter_shar += $counter_shar for 1..10;
            }
        });

Regarding that warning, perldiag says:

"Mortalized values are supposed to be freed by the free_tmps() routine. 
This indicates that something else is freeing the SV before the 
free_tmps() routine gets a chance, which means that the free_tmps() 
routine will be freeing an unreferenced scalar when it does try to free it."

Presumably the "something else" that is trying to free the SV's here is 
simply the wrong interpreter?

- Steve


------------------------------------------------
Radan Computational Ltd.

We would like to take this opportunity to wish all our customers, suppliers and colleagues
seasons greetings.  We will not be sending corporate greetings cards this year.  Instead,
we will be making a donation to charity.

The information contained in this message and any files transmitted with it are confidential
and intended for the addressee(s) only.  If you have received this message in error or there
are any problems, please notify the sender immediately.  The unauthorized use, disclosure,
copying or alteration of this message is strictly forbidden.  Note that any views or opinions
presented in this email are solely those of the author and do not necessarily represent those
of Radan Computational Ltd.  The recipient(s) of this message should check it and any attached
files for viruses: Radan Computational will accept no liability for any damage caused by any
virus transmitted by this email.
Mime
View raw message