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 15:16
Subject:
[perl #134172] commit 027471cf breaks t/op/sprintf2.t on FreeBSD-11
Message ID:
rt-4.0.24-26846-1559834189-1778.134172-15-0@perl.org
On Thu, 06 Jun 2019 15:12:34 GMT, jkeenan wrote:
> On Thu, 06 Jun 2019 14:17:46 GMT, hv wrote:
> > On Thu, 06 Jun 2019 04:37:28 -0700, jkeenan wrote:
> > > I let it run overnight.  No difference in results.
> >
> > Oh, that's sad, it's clearly hanging in that time() call for some
> > reason.
> >
> > Let's try a different approach, closer to the likely source of the
> > problem. Line 12950 of sv.c should be "float_need = 1  /* possible
> > unary minus */", the point we start handling the large number in the
> > sprintf pattern. Check that this is the right line, and thn try the
> > following:
> >
> > shell% gdb --args ./perl -we 'my $x = sprintf("%7000000000E", 0)'
> > (gdb) break sv.c:12950
> > (gdb) run
> >  Breakpoint 1, Perl_sv_vcatpvfn_flags (my_perl=0xd43260, sv=0xd72e78,
> >      pat=0xd76368 "%7000000000E", patlen=12, args=0x0,
> > svargs=0xd48b18,
> >     sv_count=1, maybe_tainted=0x7fffffffd2ff, flags=0) at sv.c:12950
> > 12950               float_need =     1  /* possible unary minus */
> >
> > and then:
> > (gdb) disp PL_locale_mutex
> > (gdb) disp *PL_locale_mutex
> > (gdb) next
> > .. and repeat 'next' about 15 times until the Perl_croak() call. If
> > the displayed values haven't changed by this point, try 'cont' to see
> > if they do change by the time we hit the SEGV.
> >
> > Hugo
> 
> #####
> $ ./perl -Ilib -V:config_args
> config_args='-des -Dusedevel -Duseithreads -Doptimize=-O2 -pipe
> -fstack-protector -fno-strict-aliasing -DDEBUGGING';
> [perl] $ gdb --args ./perl -we 'my $x = sprintf("%7000000000E", 0)'
> GNU gdb 6.1.1 [FreeBSD]
> [snip]
> (gdb) break sv.c:12950
> Breakpoint 1 at 0x557e4e: file sv.c, line 12950.
> (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:12967
> 12967               if (!lc_numeric_set) {
> (gdb) disp PL_locale_mutex
> 1: PL_locale_mutex = 0x801e1c1e0
> (gdb) disp *PL_locale_mutex
> 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}
> (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
> (gdb) next
> 
> 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:12967
> 12967               if (!lc_numeric_set) {
> 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
> (gdb) next
> 12972                   STORE_LC_NUMERIC_SET_TO_NEEDED();
> 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
> (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
> (gdb) next
> Numeric format result too large at -e line 1.
> 
> 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.
> #####

Followed by:

#####
(gdb) bt  
#0  0x0000000000597ad9 in Perl_dounwind (my_perl=0x801e22000, cxix=-1) at pp_ctl.c:1550
#1  0x0000000000454979 in S_my_exit_jump (my_perl=0x801e22000) at perl.c:5269
#2  0x00000000004581a7 in Perl_my_failure_exit (my_perl=0x801e22000) at perl.c:5256
#3  0x0000000000598882 in Perl_die_unwind (my_perl=0x801e22000, msv=0x801e1f048) at pp_ctl.c:1797
#4  0x00000000004f4828 in Perl_vcroak (my_perl=0x801e22000, pat=0x801e1f048 "\030 �\001\b", 
    args=0x7fffffffe2e0) at util.c:1711
#5  0x00000000004f1bc7 in Perl_croak_nocontext (pat=<value optimized out>) at util.c:1745
#6  0x000000000061295b in PerlIOUnix_refcnt_inc (fd=0) at perlio.c:2309
#7  0x0000000000613338 in PerlIOUnix_open (my_perl=0x801e22000, self=0x81ddd0, layers=0x801e1b8d8, 
    n=0, mode=0x81e560 "r", fd=0, imode=0, perm=0, f=0x801ea9038, narg=0, args=0x0) at perlio.c:2607
#8  0x000000000061523c in PerlIOBuf_open (my_perl=0x801e22000, self=0x81db30, layers=0x801e1b8d8, 
    n=1, mode=<value optimized out>, fd=1, imode=0, perm=0, f=0x0, narg=0, args=0x0) at perlio.c:3897
#9  0x00000000006112d8 in PerlIO_openn (my_perl=0x801e22000, layers=<value optimized out>, 
    mode=<value optimized out>, fd=0, imode=<value optimized out>, perm=<value optimized out>, f=0x0, 
    narg=0, args=0x0) at perlio.c:1550
#10 0x00000000006101ae in PerlIO_stdstreams (my_perl=0x801e22000) at perlio.c:4928
#11 0x0000000000616f6d in Perl_PerlIO_stderr (my_perl=0x801e22000) at perlio.c:4884
#12 0x00000000004f4503 in Perl_write_to_stderr (my_perl=0x801e22000, msv=0x801e1f048) at util.c:1516
#13 0x000000000059887a in Perl_die_unwind (my_perl=0x801e22000, msv=0x801e1f048) at pp_ctl.c:1796
#14 0x00000000004f4828 in Perl_vcroak (my_perl=0x801e22000, pat=0x801e1f048 "\030 �\001\b", 
    args=0x7fffffffe6c0) at util.c:1711
#15 0x00000000004f1bc7 in Perl_croak_nocontext (pat=<value optimized out>) at util.c:1745
#16 0x000000000044c596 in Perl_sys_term () at perl.c:152
#17 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