develooper Front page | perl.perl5.porters | Postings from March 2007

Re: maint@30692 dumping core

Thread Previous
Nicholas Clark
March 23, 2007 12:13
Re: maint@30692 dumping core
Message ID:
On Fri, Mar 23, 2007 at 10:03:26AM -0700, Jerry D. Hedden wrote:
> Jerry D. Hedden wrote:
> > Starting with maint@30692, when I try to install
> > Math::Random::MT::Auto (an XS module of my own creation -
> > available on CPAN), 'make test' causes Perl to dump core on
> > any tests that use threads.
> > 
> > This did not occur prior to 30692, nor does it occur with
> > blead.
> > 
> > Is it me, or is there something 'incomplete' about
> > maint@30692?
> >
> > This is under Cygwin.
> Nicholas Clark wrote:
> > I'm not in a position to test Cygwin.
> I was able to reproduce this on Solaris.

So I tried on FreeBSD. And Linux. And it's not cygwin specific.

Change 30731 should fix it.

The problem was that the regexp dup pointer wasn't being initialised early
enough. The crash was re_dup trying to call the uninitialised pointer to a
function, and the end of my stack trace looked like this:

#82 0x080b99d4 in Perl_gp_dup (my_perl=0x1be99480, gp=0x1bb53df8,
    param=0x52bfe270) at sv.c:9030
#83 0x080babf9 in Perl_sv_dup (my_perl=0x1be99480, sstr=0x1bb3581c,
    param=0x52bfe270) at sv.c:9484
#84 0x0808b709 in Perl_he_dup (my_perl=0x1be99480, e=0x1bb198b0,
    shared=1 '\001', param=0x52bfe270) at hv.c:155
#85 0x080bb1c1 in Perl_sv_dup (my_perl=0x1be99480, sstr=0x1badfcf0,
    param=0x52bfe270) at sv.c:9555
#86 0x080babad in Perl_sv_dup (my_perl=0x1be99480, sstr=0x1bae0584,
    param=0x52bfe270) at sv.c:9483
#87 0x080bded8 in perl_clone (proto_perl=0x1badf028, flags=2) at sv.c:10380
#88 0x1be239ec in S_ithread_create (my_perl=0x1badf028,
    init_function=0x1bf4c510, stack_size=0, gimme=0, exit_opt=0,
    params=0x1c09fbbc) at threads.xs:666
#89 0x1be24edf in XS_threads_create (my_perl=0x1badf028, cv=0x1bd30860)
    at threads.xs:949
#90 0x080a677b in Perl_pp_entersub (my_perl=0x1badf028) at pp_hot.c:2819
#91 0x0807c896 in Perl_runops_debug (my_perl=0x1badf028) at dump.c:1650
#92 0x08096e06 in S_run_body (my_perl=0x1badf028, oldscope=1) at perl.c:2475
#93 0x0809685c in perl_run (my_perl=0x1badf028) at perl.c:2390
#94 0x08060a94 in main (argc=3, argv=0x52bfe664, env=0x52bfe674)
    at perlmain.c:109

Line 10380 is

    PL_envgv            = gv_dup(proto_perl->Ienvgv, param);

It's not a problem on blead (any more) because Yves rewrote how
the regexp dup code works as part of making regexps lexically pluggable.

Nicholas Clark

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About