https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68737

--- Comment #4 from dave.anglin at bell dot net ---
On 2018-09-03 10:57 AM, redi at gcc dot gnu.org wrote:
> Could this be due to using alloca? The tests should not require a huge stack,
> so either alloca isn't usable or maybe there's a bug causing an infinite
> recursion.
(gdb) r
Starting program: 
/mnt/gnu/gcc/objdir-test/hppa64-hp-hpux11.11/libstdc++-v3/testsuite/14220.exe
warning: Private mapping of shared library text was not specified
by the executable; setting a breakpoint in a shared library which
is not privately mapped will not work.  See the HP-UX 11i v3 chatr
manpage for methods to privately map shared library text.

Pid 2143 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.

Program received signal SIGSEGV, Segmentation fault.
0xc000000000270de8 in memmove () from /lib/pa20_64/libc.2
(gdb) bt
#0  0xc000000000270de8 in memmove () from /lib/pa20_64/libc.2
#1  0xc0000000005bba38 in std::ctype<char>::do_widen (
     __to=0x800003fffdff0dd0 <crc_table+120> "1.", '0' <repeats 42 times>,
     __hi=0x800003fffdff0d9f <crc_table+71> "",
     __lo=0x800003fffdff0da0 <crc_table+72> "1.", '0' <repeats 42 times>,
     this=<optimized out>)
     at 
/mnt/gnu/gcc/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include/bits/locale_facets.h:1107
#2  std::ctype<char>::widen (
     __to=0x800003fffdff0dd0 <crc_table+120> "1.", '0' <repeats 42 times>,
     __hi=0x800003fffdff0d9f <crc_table+71> "",
     __lo=0x800003fffdff0da0 <crc_table+72> "1.", '0' <repeats 42 times>,
     this=<optimized out>)
     at 
/mnt/gnu/gcc/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include/bits/locale_facets.h:908
#3  std::num_put<char, std::ostreambuf_iterator<char, 
std::char_traits<char> > >::_M_insert_float<double> 
(this=0x800003fffdfe57a0, __s=..., __io=...,
     __fill=43 '+', __mod=<optimized out>, __v=1)
     at 
/mnt/gnu/gcc/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include/bits/locale_facets.tcc:1048
#4  0xc0000000005bbe68 in std::num_put<char, 
std::ostreambuf_iterator<char, std::char_traits<char> > >::do_put 
(this=<optimized out>,
     __s=<error reading variable: Cannot access memory at address 0x10>,
---Type <return> to continue, or q <return> to quit---
     __io=..., __fill=<optimized out>, __v=<optimized out>)
     at 
/mnt/gnu/gcc/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include/bits/locale_facets.tcc:1157
#5  0x4000000000003794 in std::num_put<char, 
std::ostreambuf_iterator<char, std::char_traits<char> > >::put (__v=1, 
__fill=43 '+', __io=..., __s=...,
     this=0x800003fffdfe57a0)
     at 
/mnt/gnu/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc:38
#6  test01 ()
     at 
/mnt/gnu/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc:38
#7  0x4000000000003a74 in main ()
     at 
/mnt/gnu/gcc/gcc/libstdc++-v3/testsuite/22_locale/num_put/put/char/14220.cc:45

On the failing call to memmove, we have the following arguments:

(gdb) p/x $r26
$1 = 0x800003fffdff0dd0
(gdb) p/x $r25
$2 = 0x800003fffdff0da0
(gdb) p/x $r24
$3 = 0xffffffffffffffff

(gdb) frame 1
#1  0x800003fffdfa0a38 in std::ctype<char>::do_widen (
     __to=0x800003fffdff0dd0 <crc_table+120> "\200",
     __hi=0x800003fffdff0d9f <crc_table+71> "",
     __lo=0x800003fffdff0da0 <crc_table+72> "1.", '0' <repeats 42 times>,
     this=<optimized out>)
     at 
/mnt/gnu/gcc/objdir/hppa64-hp-hpux11.11/libstdc++-v3/include/bits/locale_facets.h:1107
1107            __builtin_memcpy(__to, __lo, __hi - __lo);
(gdb) p __hi
$4 = 0x800003fffdff0d9f <crc_table+71> ""
(gdb) p __lo
$5 = 0x800003fffdff0da0 <crc_table+72> "1.", '0' <repeats 42 times>
(gdb) p/x __hi - __lo
$6 = 0xffffffffffffffff

Reply via email to