Discussion:
[Bug c++/20607] New: gdb printing google's protobuf object will crash
egmkang at outlook dot com
2016-09-14 07:13:05 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20607

Bug ID: 20607
Summary: gdb printing google's protobuf object will crash
Product: gdb
Version: 7.11.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
Assignee: unassigned at sourceware dot org
Reporter: egmkang at outlook dot com
Target Milestone: 7.11.1
Host: Ubuntu 4.4.0-36-generic
Target: 64bit
Build: gcc 5.4.0

when i print a protobuf object, the gdb(itself) will crash.

this is backtrace when i print a
google::protobuf::RepeatedField<google::protobuf::int32> instance.


```
#0 value_entirely_covered_by_range_vector (value=0x0, ranges=0x80) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/value.c:398
398 /build/gdb-cXfXJ3/gdb-7.11.1/gdb/value.c: No such file or directory.
(gdb) bt
#0 value_entirely_covered_by_range_vector (value=0x0, ranges=0x80) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/value.c:398
#1 0x0000000000691d91 in cp_print_static_field (options=0x7ffc853963d0,
recurse=1, stream=0x22d99d0, val=<optimized out>, type=0x58ca1e0)
at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/cp-valprint.c:641
#2 cp_print_value_fields (type=<optimized out>,
real_type=***@entry=0x6f42bd0, valaddr=***@entry=0x7ddad40 "\200^",
offset=***@entry=0,
address=***@entry=106927506549960, stream=0x22d99d0, recurse=0,
val=0x6716750, options=0x7ffc853963d0, dont_print_vb=0x0, dont_print_statmem=0)
at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/cp-valprint.c:331
#3 0x0000000000692832 in cp_print_value_fields_rtti (type=<optimized out>,
***@entry=0x6f42bd0, valaddr=0x7ddad40 "\200^", offset=0,
address=106927506549960, stream=0x22d99d0,
recurse=<optimized out>, val=0x6716750, options=0x7ffc853963d0,
dont_print_vb=0x0, dont_print_statmem=0) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/cp-valprint.c:452
#4 0x0000000000690282 in c_val_print_struct (type=0x6f42bd0,
valaddr=<optimized out>, embedded_offset=<optimized out>, address=<optimized
out>, stream=<optimized out>,
recurse=<optimized out>, original_value=0x6716750, options=0x7ffc853963d0)
at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/c-valprint.c:406
#5 0x0000000000690770 in c_val_print (type=0x6f42bd0, valaddr=0x7ddad40
"\200^", embedded_offset=0, address=106927506549960, stream=0x22d99d0,
recurse=0, original_value=0x6716750,
options=0x7ffc853963d0) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/c-valprint.c:526
#6 0x0000000000584253 in val_print (type=***@entry=0x6f42b40,
valaddr=0x7ddad40 "\200^", embedded_offset=***@entry=0,
address=***@entry=106927506549960,
stream=***@entry=0x22d99d0, recurse=***@entry=0, val=0x6716750,
options=0x7ffc85396480, language=0x846f40 <cplus_language_defn>)
at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/valprint.c:1009
#7 0x0000000000690f30 in c_value_print (val=0x6716750, stream=0x22d99d0,
options=<optimized out>) at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/c-valprint.c:689
#8 0x000000000058bdc7 in print_value (val=***@entry=0x6716750,
fmtp=***@entry=0x7ffc853965b0) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/printcmd.c:976
#9 0x000000000058be91 in print_command_1 (exp=0x20ebe72 "carrier_attr",
voidprint=1) at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/printcmd.c:1009
#10 0x000000000069db16 in execute_command (p=<optimized out>, ***@entry=0x20ebe70
"p carrier_attr", from_tty=1) at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/top.c:475
#11 0x00000000005d487c in command_handler (command=0x20ebe70 "p carrier_attr")
at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-top.c:491
#12 0x00000000005d4f5f in command_line_handler (rl=<optimized out>) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-top.c:690
#13 0x00007fee6c54b6f5 in rl_callback_read_char () from
/lib/x86_64-linux-gnu/libreadline.so.6
#14 0x00000000005d48d9 in rl_callback_read_char_wrapper (client_data=<optimized
out>) at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-top.c:171
#15 0x00000000005d4923 in stdin_event_handler (error=<optimized out>,
client_data=0x0) at /build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-top.c:430
#16 0x00000000005d3705 in gdb_wait_for_event (block=***@entry=1) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-loop.c:834
#17 0x00000000005d38a9 in gdb_do_one_event () at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-loop.c:323
#18 0x00000000005d39ee in start_event_loop () at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/event-loop.c:347
#19 0x00000000005cd3b3 in captured_command_loop (data=***@entry=0x0) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/main.c:318
#20 0x00000000005ca1cd in catch_errors (func=***@entry=0x5cd3a0
<captured_command_loop>, func_args=***@entry=0x0,
errstring=***@entry=0x7ac0eb "",
mask=***@entry=RETURN_MASK_ALL) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/exceptions.c:240
#21 0x00000000005cdfa6 in captured_main (data=***@entry=0x7ffc853969d0) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/main.c:1157
#22 0x00000000005ca1cd in catch_errors (func=***@entry=0x5cd900
<captured_main>, func_args=***@entry=0x7ffc853969d0,
errstring=***@entry=0x7ac0eb "",
mask=***@entry=RETURN_MASK_ALL) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/exceptions.c:240
#23 0x00000000005ce87b in gdb_main (args=***@entry=0x7ffc853969d0) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/main.c:1165
#24 0x000000000045eca5 in main (argc=<optimized out>, argv=<optimized out>) at
/build/gdb-cXfXJ3/gdb-7.11.1/gdb/gdb.c:32
```
--
You are receiving this mail because:
You are on the CC list for the bug.
guillaume at morinfr dot org
2017-08-01 18:26:03 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20607

Guillaume Morin <guillaume at morinfr dot org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |guillaume at morinfr dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
thomas at sondergaard dot cc
2018-11-02 14:02:22 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20607

Thomas Sondergaard <thomas at sondergaard dot cc> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |thomas at sondergaard dot cc
--
You are receiving this mail because:
You are on the CC list for the bug.
weimin.pan at oracle dot com
2018-11-08 00:55:41 UTC
Permalink
https://sourceware.org/bugzilla/show_bug.cgi?id=20607

weimin.pan at oracle dot com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |weimin.pan at oracle dot com

--- Comment #1 from weimin.pan at oracle dot com ---
This is a duplicate of PR 17685, which depends on whether or not
the compiler generated a DWARF declaration DIE for the static data
member. Programs with such debug info will crash gdb when printing
class objects.
--
You are receiving this mail because:
You are on the CC list for the bug.
Loading...