develooper Front page | perl.perl5.porters | Postings from June 2019

[perl #134172] commit 027471cf breaks t/op/sprintf2.t on FreeBSD-11

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
June 6, 2019 17:31
Subject:
[perl #134172] commit 027471cf breaks t/op/sprintf2.t on FreeBSD-11
Message ID:
rt-4.0.24-30275-1559842258-1597.134172-15-0@perl.org
On Thu, 06 Jun 2019 15:54:29 GMT, jkeenan wrote:
> On Thu, 06 Jun 2019 15:47:02 GMT, hv wrote:
> > On Thu, 06 Jun 2019 08:16:29 -0700, jkeenan wrote:
> > > > (gdb) next
> > > > 13092                   Perl_croak(aTHX_ "Numeric format result
> > > > too
> > > > large");
> > > > 2: *PL_locale_mutex = {m_lock = {m_owner = 0, m_flags = 0,
> > > > m_ceilings
> > > > = 0x801e1c1e8, m_rb_lnk = 0,
> > > >     m_spare = 0x801e1c1f8}, m_flags = 1, m_count = 0, m_spinloops
> > > > =
> > > > 0,
> > > > m_yieldloops = 0, m_ps = 0,
> > > >  m_qe = {tqe_next = 0x0, tqe_prev = 0x0}, m_pqe = {tqe_next =
> > > > 0x0,
> > > > tqe_prev = 0x0}, m_rb_prev = 0x0}
> > > > 1: PL_locale_mutex = 0x801e1c1e0
> >
> > Ok, so at this point it still looks valid ...
> >
> > > > Program received signal SIGSEGV, Segmentation fault.
> > > > 0x0000000000597ad9 in Perl_dounwind (my_perl=0x801e22000, cxix=-
> > > > 1)
> > > > at
> > > > pp_ctl.c:1550
> > > > 1550            CX_LEAVE_SCOPE(cx);
> > > > 2: *PL_locale_mutex = Error accessing memory address 0x2: Bad
> > > > address.
> > > > Disabling display 2 to avoid infinite recursion.
> >
> > .. but by the time we get here it has been corrupted to 0x2.
> >
> > I think it's worth another go at the 'watch', but if that fails we
> > may
> > have to step through with 'next' and 'step' until the displayed value
> > changes. If we set the watchpoint later, it may work better:
> >
> > shell% gdb --args ./perl -we 'my $x = sprintf("%7000000000E", 0)'
> > (gdb) break sv.c:13092
> > (gdb) run
> > .. break at sv.c:13092 (the croak call)
> > (gdb) watch PL_locale_mutex
> > (gdb) cont
> >
> > As before, it should not take more than a few minutes after the
> > 'cont'.
> >
> > Hugo
> 
> 'cont' returned within 1 second.
> 
> #####
> $ gdb --args ./perl -we 'my $x = sprintf("%7000000000E", 0)'
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and
> you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for
> details.
> This GDB was configured as "amd64-marcel-freebsd"...
> (gdb) break sv.c:13092
> Breakpoint 1 at 0x55b2f0: file sv.c, line 13092.
> (gdb) run
> Starting program: /usr/home/jkeenan/gitwork/perl/perl -we my\ \$x\ =\
> sprintf\(\"%7000000000E\",\ 0\)
> 
> Breakpoint 1, Perl_sv_vcatpvfn_flags (my_perl=<value optimized out>,
> sv=<value optimized out>,
>     pat=<value optimized out>, patlen=<value optimized out>, args=0x0,
> svargs=0x801e16528,
>    sv_count=1, maybe_tainted=0x801c02200, flags=0) at sv.c:13092
> 13092                   Perl_croak(aTHX_ "Numeric format result too
> large");
> (gdb) watch PL_locale_mutex
> Watchpoint 2: PL_locale_mutex
> (gdb) cont
> Continuing.
> 
> Breakpoint 1, Perl_sv_vcatpvfn_flags (my_perl=<value optimized out>,
> sv=<value optimized out>,
>     pat=<value optimized out>, patlen=<value optimized out>, args=0x0,
> svargs=0x801e16530,
>    sv_count=1, maybe_tainted=0x452591, flags=0) at sv.c:13092
> 13092                   Perl_croak(aTHX_ "Numeric format result too
> large");
> (gdb) bt
> #0  Perl_sv_vcatpvfn_flags (my_perl=<value optimized out>, sv=<value
> optimized out>,
>     pat=<value optimized out>, patlen=<value optimized out>, args=0x0,
> svargs=0x801e16530,
>    sv_count=1, maybe_tainted=0x452591, flags=0) at sv.c:13092
> #1  0x0000000000553045 in Perl_sv_vsetpvfn (my_perl=0x801e22000,
> sv=0x801e98610,
>     pat=0x801e20128 "%7000000000E", patlen=<value optimized out>,
> args=<value optimized out>,
>    svargs=0x801e16530, sv_count=1, maybe_tainted=0x7fffffffe577) at
> sv.c:10984
> #2  0x00000000005c4f31 in Perl_do_sprintf (my_perl=0x801e22000,
> sv=0x801e98610,
>    len=<value optimized out>, sarg=<value optimized out>) at
> doop.c:734
> #3  0x0000000000579ac0 in Perl_pp_sprintf (my_perl=0x801e22000) at
> pp.c:3559
> #4  0x00000000004f0340 in Perl_runops_debug (my_perl=0x801e22000) at
> dump.c:2537
> #5  0x0000000000453464 in S_run_body (my_perl=0x801e22000, oldscope=1)
> at inline.h:65
> #6  0x00000000004532d9 in perl_run (my_perl=0x801e22000) at
> perl.c:2646
> #7  0x00000000004213fa in main (argc=<value optimized out>,
> argv=<value optimized out>,
>    env=0x7fffffffe7a0) at perlmain.c:127
> #####

#####
$ gdb --args ./perl -we 'my $x = sprintf("%7000000000E", 0)'
[snip]
(gdb) break sv.c:13092
Breakpoint 1 at 0x55b2f0: file sv.c, line 13092.
(gdb) run
Starting program: /usr/home/jkeenan/gitwork/perl/perl -we my\ \$x\ =\ sprintf\(\"%7000000000E\",\ 0\)

Breakpoint 1, Perl_sv_vcatpvfn_flags (my_perl=<value optimized out>, sv=<value optimized out>, 
    pat=<value optimized out>, patlen=<value optimized out>, args=0x0, svargs=0x801e16528, 
    sv_count=1, maybe_tainted=0x801c02200, flags=0) at sv.c:13092
13092	                Perl_croak(aTHX_ "Numeric format result too large");
(gdb) watch PL_locale_mutex
Watchpoint 2: PL_locale_mutex
(gdb) cont
Continuing.

Breakpoint 1, Perl_sv_vcatpvfn_flags (my_perl=<value optimized out>, sv=<value optimized out>, 
    pat=<value optimized out>, patlen=<value optimized out>, args=0x0, svargs=0x801e16530, 
    sv_count=1, maybe_tainted=0x452591, flags=0) at sv.c:13092
13092	                Perl_croak(aTHX_ "Numeric format result too large");
(gdb) cont
Continuing.
Numeric format result too large at -e line 1.
Watchpoint 2: PL_locale_mutex

Old value = 0x801e1c1e0
New value = 0x2
_pthread_mutex_destroy (mutex=0xa45b28) at pthread_md.h:95
95		return (TCB_GET64(tcb_thread));
Current language:  auto; currently minimal
(gdb) bt
#0  _pthread_mutex_destroy (mutex=0xa45b28) at pthread_md.h:95
#1  0x000000000044c554 in Perl_sys_term () at perl.c:152
#2  0x0000000000421472 in main (argc=<value optimized out>, argv=<value optimized out>, 
    env=0x7fffffffe7a0) at perlmain.c:155
#####

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134172

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