Re: C++ in jemalloc

From: Mark Millard <markmi_at_dsl-only.net>
Date: Sat, 7 Oct 2017 20:33:05 -0700
It turns out that /usr/local/bin/gdb crashing 
for the clang-built powerpc64 world is again
due to C++ exceptions being thrown, this time
in gdb80 itself.

This helps explain why for clang-based buildworld
experiments /usr/libexec/gdb is a better alternative
currently for the powerpc families.

Again the _Unwind_SetGR use in __gxx_personality_v0
fails:

# ls -lT /usr/local/bin/gdb*
lrwxr-xr-x  1 root  wheel         5 Sep 29 15:25:15 2017 /usr/local/bin/gdb -> gdb80
-r-xr-xr-x  1 root  wheel  97577168 Sep 29 15:25:15 2017 /usr/local/bin/gdb80
lrwxr-xr-x  1 root  wheel         5 Sep 29 15:25:15 2017 /usr/local/bin/gdbtui80 -> gdb80

# ldd /usr/local/bin/gdb80 
/usr/local/bin/gdb80:
	libreadline.so.7 => /usr/local/lib/libreadline.so.7 (0x50e80000)
	libncurses.so.8 => /lib/libncurses.so.8 (0x50ef7000)
	libkvm.so.7 => /lib/libkvm.so.7 (0x50f61000)
	libutil.so.9 => /lib/libutil.so.9 (0x50f83000)
	libm.so.5 => /lib/libm.so.5 (0x50fad000)
	libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0x50fe5000)
	liblzma.so.5 => /usr/lib/liblzma.so.5 (0x5102a000)
	libc++.so.1 => /usr/lib/libc++.so.1 (0x5105d000)
	libcxxrt.so.1 => /lib/libcxxrt.so.1 (0x5118a000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x511b1000)
	libc.so.7 => /lib/libc.so.7 (0x511d6000)
	libncursesw.so.8 => /lib/libncursesw.so.8 (0x51528000)
	libelf.so.2 => /lib/libelf.so.2 (0x515ac000)
	libthr.so.3 => /lib/libthr.so.3 (0x515da000)

# /usr/libexec/gdb /usr/local/bin/gdb80 /var/crash/gdb80.14502.core 
. . .
Core was generated by `/usr/local/bin/gdb /usr/obj/powerpc64vtsc_xtoolchain-gcc/powerpc.powerpc64/usr/s'.
Program terminated with signal 11, Segmentation fault.
. . .
(gdb) bt
#0  0x00000000511b5c20 in _Unwind_SetGR (context=<value optimized out>, index=<value optimized out>, val=1374378080) at unwind-dw2-fde.h:162
#1  0x000000005119f194 in __gxx_personality_v0 (version=<value optimized out>, actions=<value optimized out>, exceptionClass=<value optimized out>, exceptionObject=0x51eb5860, 
    context=0xffffffffffffb420) at /usr/src/contrib/libcxxrt/exception.cc:1203
#2  0x00000000511b6a60 in _Unwind_RaiseException_Phase2 (exc=0x51eb5860, context=0xffffffffffffb420) at unwind.inc:66
#3  0x00000000511b6548 in _Unwind_RaiseException (exc=<value optimized out>) at unwind.inc:135
#4  0x000000005119e4f4 in __cxa_throw (thrown_exception=<value optimized out>, tinfo=<value optimized out>, dest=<value optimized out>) at /usr/src/contrib/libcxxrt/exception.cc:774
#5  0x00000000102be040 in throw_exception () at common-exceptions.c:303
#6  0x00000000102be1dc in throw_it (reason=1374378080, error=4294947872, fmt=<value optimized out>, ap=<value optimized out>) at common-exceptions.c:373
#7  0x00000000102be0a4 in throw_verror (error=<value optimized out>, fmt=<value optimized out>, ap=<value optimized out>) at common-exceptions.c:379
#8  0x00000000102be258 in throw_error (error=GDB_NO_ERROR, fmt=0x18 <Address 0x18 out of bounds>) at common-exceptions.c:394
#9  0x0000000010279bf8 in call_site_for_pc (gdbarch=<value optimized out>, pc=<value optimized out>) at block.c:241
#10 0x00000000102e93e0 in call_site_find_chain (gdbarch=<value optimized out>, caller_pc=<value optimized out>, callee_pc=<value optimized out>) at dwarf2loc.c:1057
#11 0x00000000102e4800 in dwarf2_tailcall_sniffer_first (this_frame=0x51eb5808, tailcall_cachep=0x51eb5860, entry_cfa_sp_offsetp=0xffffffffffffb420) at dwarf2-frame-tailcall.c:387
#12 0x00000000102e32b8 in ._ZL26dwarf2_frame_prev_registerP10frame_infoPPvi () at __split_buffer:311
#13 0x0000000010340464 in frame_unwind_register_value (frame=<value optimized out>, regnum=<value optimized out>) at frame.c:1200
#14 0x0000000010340148 in frame_register_unwind (frame=0x0, regnum=<value optimized out>, optimizedp=0x51eb5860, unavailablep=0x51eb5808, lvalp=0x514077a0, addrp=0x51eb5808, realnump=0x6, 
    bufferp=0xffffffffffffb420 "") at frame.c:1102
#15 0x0000000010341ddc in get_prev_frame_always_1 (this_frame=0xffffffffffffb420) at frame.c:1840
#16 0x000000001033e878 in get_prev_frame_always (this_frame=0xffffffffffffb420) at frame.c:2092
#17 0x000000001033e110 in get_prev_frame (this_frame=0xffffffffffffb420) at frame.c:2345
#18 0x0000000010419464 in backtrace_command (arg=<value optimized out>, from_tty=1374378080) at stack.c:1830
#19 0x00000000101e3654 in do_cfunc (c=<value optimized out>, args=0x0, from_tty=24) at cli/cli-decode.c:106
#20 0x00000000101e67b0 in cmd_func (cmd=0x0, args=0x18 <Address 0x18 out of bounds>, from_tty=<value optimized out>) at cli/cli-decode.c:1896
#21 0x000000001046497c in execute_command (p=<value optimized out>, from_tty=1374377992) at top.c:674
#22 0x000000001032e398 in command_handler (command=0xffffffffffffb420 "") at event-top.c:590
#23 0x000000001032e788 in command_line_handler (rl=<value optimized out>) at event-top.c:780
#24 0x000000001032dc54 in gdb_rl_callback_handler (rl=<value optimized out>) at event-top.c:213
#25 0x0000000050ec5950 in rl_callback_read_char () at ../callback.c:283
#26 0x000000001032f560 in gdb_rl_callback_read_char_wrapper_noexcept () at event-top.c:175
#27 0x000000001032d84c in gdb_rl_callback_read_char_wrapper (client_data=<value optimized out>) at event-top.c:192
#28 0x000000001032e14c in stdin_event_handler (error=<value optimized out>, client_data=0xffffffffffffb420) at event-top.c:518
#29 0x000000001032d690 in handle_file_event (file_ptr=0xffffffffffffb420, ready_mask=1374378080) at event-loop.c:733
#30 0x000000001032c830 in gdb_wait_for_event (block=<value optimized out>) at common-exceptions.h:220
#31 0x000000001032c2c4 in gdb_do_one_event () at event-loop.c:347
#32 0x000000001032c940 in start_event_loop () at event-loop.c:371
#33 0x00000000103a674c in captured_command_loop (data=<value optimized out>) at main.c:325
#34 0x000000001032fd50 in catch_errors (func=<value optimized out>, func_args=0x6, errstring=0xffffffffffffb420 "", mask=1374377992) at exceptions.c:236
#35 0x00000000103a61b4 in gdb_main (args=<value optimized out>) at main.c:1150
#36 0x000000001000bc38 in main (argc=<value optimized out>, argv=0xffffffffffffb420) at gdb.c:38
#37 0x000000001000b938 in _start (argc=1374377992, argv=0x51eb5860, env=0xffffffffffffb420, obj=<value optimized out>, cleanup=<value optimized out>, ps_strings=<value optimized out>)
    at /usr/src/lib/csu/powerpc64/crt1.c:94
#38 0x0000000050e49b70 in .text () at /usr/src/libexec/rtld-elf/powerpc64/rtld_start.S:104
Current language:  auto; currently minimal

===
Mark Millard
markmi at dsl-only.net
Received on Sun Oct 08 2017 - 01:33:09 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:13 UTC