Bug 19382 - Segmentation fault on print
Summary: Segmentation fault on print
Status: RESOLVED DUPLICATE of bug 20020
Alias: None
Product: gdb
Classification: Unclassified
Component: backtrace (show other bugs)
Version: 7.10
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-20 07:19 UTC by Damir Franusic
Modified: 2019-01-10 00:54 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Fix for this issue (936 bytes, patch)
2018-11-23 23:06 UTC, KRS
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Damir Franusic 2015-12-20 07:19:32 UTC
Program received signal SIGSEGV, Segmentation fault.
0x0000000000566668 in value_entirely_covered_by_range_vector ()
(gdb) bt
#0  0x0000000000566668 in value_entirely_covered_by_range_vector ()
#1  0x000000000067b0e2 in cp_print_value_fields ()
#2  0x000000000067be30 in cp_print_value_fields_rtti ()
#3  0x0000000000679a7e in c_val_print ()
#4  0x00000000005788f2 in val_print ()
#5  0x000000000067ae17 in cp_print_value_fields ()
#6  0x000000000067be30 in cp_print_value_fields_rtti ()
#7  0x0000000000679a7e in c_val_print ()
#8  0x00000000005788f2 in val_print ()
#9  0x000000000067a468 in c_value_print ()
#10 0x000000000057ff87 in print_value ()
#11 0x0000000000580031 in print_command_1 ()
#12 0x0000000000686f2d in execute_command ()
#13 0x00000000005c2a11 in command_handler ()
#14 0x00000000005c2f6c in command_line_handler ()
#15 0x00007ffff7bbf33e in rl_callback_read_char () from /lib64/libreadline.so.6
#16 0x00000000005c2a79 in rl_callback_read_char_wrapper ()
#17 0x00000000005c2ac3 in stdin_event_handler ()
#18 0x00000000005c198d in gdb_wait_for_event ()
#19 0x00000000005c1bd2 in gdb_do_one_event ()
#20 0x00000000005c1c4e in start_event_loop ()
#21 0x00000000005bb983 in captured_command_loop ()
#22 0x00000000005b8e6d in catch_errors ()
#23 0x00000000005bc916 in captured_main ()
#24 0x00000000005b8e6d in catch_errors ()
#25 0x00000000005bcdbb in gdb_main ()
#26 0x000000000045b5d5 in main ()
Comment 1 Damir Franusic 2015-12-20 07:25:36 UTC
It seems that boost::mt19937 is causing the segfault:

(gdb) p r14pc->ran_mt19937
$1 = {
  static word_size = <optimized out>, 
  static state_size = <optimized out>, 
  static shift_size = <optimized out>, 
  static mask_bits = <optimized out>, 
  static xor_mask = <optimized out>, 
  static tempering_u = <optimized out>, 
  static tempering_d = <optimized out>, 
  static tempering_s = <optimized out>, 
  static tempering_b = <optimized out>, 
  static tempering_t = <optimized out>, 
  static tempering_c = <optimized out>, 
  static tempering_l = <optimized out>, 
  static initialization_multiplier = <optimized out>, 
Segmentation fault
Comment 2 Damir Franusic 2015-12-20 11:14:35 UTC
System info:
dfranusic@ferret ~/dev/pmink/debug $ uname -a
Linux ferret 3.18.11-gentoo #10 SMP Fri Dec 18 11:57:56 CET 2015 x86_64 Intel(R) Core(TM) i5-3230M CPU @ 2.60GHz GenuineIntel GNU/Linux
dfranusic@ferret ~/dev/pmink/debug $ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.5/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.8.5/work/gcc-4.8.5/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.5 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.5/include/g++-v4 --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.5/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.5 p1.3, pie-0.6.2' --enable-libstdcxx-time --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-altivec --disable-fixed-point --enable-targets=all --disable-libgcj --enable-libgomp --disable-libmudflap --disable-libssp --enable-lto --without-cloog --enable-libsanitizer
Thread model: posix
gcc version 4.8.5 (Gentoo 4.8.5 p1.3, pie-0.6.2)
Comment 3 Damir Franusic 2015-12-23 16:17:53 UTC
Segfault is not present when optimizations are disabled (-O0)
Comment 4 KRS 2018-11-23 23:06:36 UTC
Created attachment 11410 [details]
Fix for this issue
Comment 5 Simon Marchi 2018-11-26 19:26:11 UTC
Thanks for the patch.  However, we use the gdb-patches mailing list for patches.  Would it be possible to send it there?  You can go through

  https://sourceware.org/gdb/wiki/ContributionChecklist

to make sure the contribution process is smooth.
Comment 6 weimin.pan 2019-01-10 00:54:53 UTC
*** This bug has been marked as a duplicate of bug 20020 ***

*** This bug has been marked as a duplicate of bug 20020 ***