dimahardie / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

Segfault when running minidump_stackawlk #474

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. fresh checkout and configure and make
pasted example code from the getting started linux page
2. ran this commands
rm a.out
rm a.out.sym
g++ -g -O0 main.cpp -I google-breakpad-read-only/src/ -L 
google-breakpad-read-only/src/client/linux/ -l breakpad_client -lpthread
google-breakpad-read-only/src/tools/linux/dump_syms/dump_syms ./a.out > 
a.out.sym
build_id=$(head -n1 a.out.sym | head -n1 a.out.sym | awk '{print $4}')
dest_path=./symbols/a.out/$build_id
mkdir -p dest_path
mv a.out.sym $dest_path
./a.out #segfaults as the example code and generates a dmp.
3. ran minidump stackwalk with 
google-breakpad-read-only/src/processor/minidump_stackwalk 
/tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp symbols

What is the expected output? What do you see instead?
(gdb) run
Starting program: 
/root/google-breakpad-read-only/src/processor/minidump_stackwalk 
/tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp symbols
Missing separate debuginfo for /lib64/ld-linux-x86-64.so.2
Try: zypper install -C 
"debuginfo(build-id)=17c088070352d83e7afc43d83756b00899fd37f0"
Missing separate debuginfo for /usr/lib64/libstdc++.so.6
Try: zypper install -C 
"debuginfo(build-id)=e907b88d15f5e1312d1ae0c7c61f8da92745738b"
Missing separate debuginfo for /lib64/libm.so.6
Try: zypper install -C 
"debuginfo(build-id)=365e4d2c812908177265c8223f222a1665fe1035"
Missing separate debuginfo for /lib64/libgcc_s.so.1
Try: zypper install -C 
"debuginfo(build-id)=3f06bcfc74f9b01780d68e89b8dce403bef9b2e3"
Missing separate debuginfo for /lib64/libc.so.6
Try: zypper install -C 
"debuginfo(build-id)=a41ac0b0b7cd60bd57473303c2c3de08856d2e06"
2012-04-13 13:19:25: minidump_processor.cc:264: INFO: Processing minidump in 
file /tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp
2012-04-13 13:19:25: minidump.cc:3775: INFO: Minidump opened minidump 
/tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp
2012-04-13 13:19:25: minidump.cc:3820: INFO: Minidump not byte-swapping minidump
2012-04-13 13:19:25: minidump.cc:4186: INFO: GetStream: type 1197932545 not 
present
2012-04-13 13:19:25: minidump.cc:4186: INFO: GetStream: type 1197932546 not 
present
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /root/a.out
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /lib64/libc-2.11.1.so
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /lib64/libgcc_s.so.1
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /lib64/libm-2.11.1.so
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /usr/lib64/libstdc++.so.6.0.10
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /lib64/libpthread-2.11.1.so
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for /lib64/ld-2.11.1.so
2012-04-13 13:19:25: minidump.cc:1958: INFO: MinidumpModule could not determine 
version for linux-gate.so
2012-04-13 13:19:25: minidump_processor.cc:116: INFO: Minidump 
/tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp has CPU info, OS info, no 
Breakpad info, exception, module list, thread list, no dump thread, and 
requesting thread
2012-04-13 13:19:25: minidump_processor.cc:150: INFO: Looking at thread 
/tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp:0/1 id 0x3436
2012-04-13 13:19:25: minidump.cc:308: INFO: MinidumpContext: looks like AMD64 
context
2012-04-13 13:19:25: minidump.cc:308: INFO: MinidumpContext: looks like AMD64 
context
2012-04-13 13:19:25: simple_symbol_supplier.cc:192: INFO: No symbol file at 
symbols/a.out/6B26827943AEA76FFA976B153C0DE0AF0/a.out.sym
2012-04-13 13:19:25: simple_symbol_supplier.cc:130: INFO: Cannot find symbol 
data buffer for module /root/a.out
2012-04-13 13:19:25: basic_code_modules.cc:88: INFO: No module at 0x7fff47c58cd0

Program received signal SIGSEGV, Segmentation fault.
0x0000000000407993 in join (ptr=<value optimized out>, this=<value optimized 
out>) at ./src/processor/linked_ptr.h:75
75          while (p->next_ != ptr) p = p->next_;

Backtrace:
(gdb) bt
#0  0x0000000000407993 in join (ptr=<value optimized out>, this=<value 
optimized out>) at ./src/processor/linked_ptr.h:75
#1  copy<google_breakpad::CodeModule const> (ptr=<value optimized out>, 
this=<value optimized out>) at ./src/processor/linked_ptr.h:167
#2  linked_ptr (ptr=<value optimized out>, this=<value optimized out>) at 
./src/processor/linked_ptr.h:106
#3  entry (ptr=<value optimized out>, this=<value optimized out>) at 
./src/processor/range_map.h:108
#4  google_breakpad::RangeMap<unsigned long, 
google_breakpad::linked_ptr<google_breakpad::CodeModule const> >::RetrieveRange 
(ptr=<value optimized out>, this=<value optimized out>)
    at ./src/processor/range_map-inl.h:126
#5  0x0000000000406ecc in 
google_breakpad::BasicCodeModules::GetModuleForAddress (this=<value optimized 
out>, address=4200637) at src/processor/basic_code_modules.cc:87
#6  0x0000000000436c38 in ScanForReturnAddress<unsigned long> 
(searchwords=<value optimized out>, ip_found=<value optimized out>, 
location_found=<value optimized out>, location_start=<value optimized out>,
    this=<value optimized out>) at ./src/google_breakpad/processor/stackwalker.h:141
#7  ScanForReturnAddress<unsigned long> (searchwords=<value optimized out>, 
ip_found=<value optimized out>, location_found=<value optimized out>, 
location_start=<value optimized out>,
    this=<value optimized out>) at ./src/google_breakpad/processor/stackwalker.h:117
#8  google_breakpad::StackwalkerAMD64::GetCallerByStackScan (searchwords=<value 
optimized out>, ip_found=<value optimized out>, location_found=<value optimized 
out>, location_start=<value optimized out>,
    this=<value optimized out>) at src/processor/stackwalker_amd64.cc:151
#9  0x000000000043719b in google_breakpad::StackwalkerAMD64::GetCallerFrame 
(this=0x6909b0, stack=0x690a30) at src/processor/stackwalker_amd64.cc:194
#10 0x0000000000435cc5 in google_breakpad::Stackwalker::Walk (this=0x6909b0, 
stack=0x690a30) at src/processor/stackwalker.cc:138
#11 0x0000000000430265 in google_breakpad::MinidumpProcessor::Process 
(this=0x7fffffffe210, dump=0x7fffffffe060, process_state=0x7fffffffe150) at 
src/processor/minidump_processor.cc:219
#12 0x0000000000430fd6 in google_breakpad::MinidumpProcessor::Process 
(this=0x7fffffffe210, 
minidump_file="/tmp/4a2ad206-5475-affc-53735dbc-002260c3.dmp", 
process_state=0x7fffffffe150)
    at src/processor/minidump_processor.cc:272
#13 0x0000000000405c42 in PrintMinidumpProcess (machine_readable=<value 
optimized out>, symbol_paths=<value optimized out>, minidump_file=<value 
optimized out>) at src/processor/minidump_stackwalk.cc:527
#14 main (machine_readable=<value optimized out>, symbol_paths=<value optimized 
out>, minidump_file=<value optimized out>) at 
src/processor/minidump_stackwalk.cc:586

What version of the product are you using? On what operating system?
Latest revision on sles 11 sp1 x86_64 linux 2.6.32.12-0.7-default

Please provide any additional information below.

Original issue reported on code.google.com by anne...@gmail.com on 13 Apr 2012 at 5:30

Attachments:

GoogleCodeExporter commented 9 years ago
What compiler did you build minidump_stackwalk with?

Original comment by thestig@chromium.org on 19 Apr 2012 at 4:41

GoogleCodeExporter commented 9 years ago
linux:~ # g++ -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info 
--mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada 
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ 
--with-pkgversion='SUSE Linux' --disable-libgcj --disable-libmudflap 
--with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit 
--enable-libstdcxx-allocator=new --disable-libstdcxx-pch 
--enable-version-specific-runtime-libs --program-suffix=-4.3 
--enable-linux-futex --without-system-libunwind --with-cpu=generic 
--build=x86_64-suse-linux
Thread model: posix
gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux)
linux:~ # uname -a
Linux linux 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 
x86_64 x86_64 GNU/Linux

Original comment by anne...@gmail.com on 19 Apr 2012 at 2:11

GoogleCodeExporter commented 9 years ago
I think this is a compiler bug in older gcc versions. I had a workaround for 
this but I can't remember what it is. It's no longer an issue with gcc 4.4 and 
newer. Try with an OpenSUSE 12.1 system and see how it behaves there.

Original comment by thestig@chromium.org on 19 Apr 2012 at 6:34

GoogleCodeExporter commented 9 years ago
I used gcc 4.4 and it runs fine thought It's not showing when it prints the 
stack trace the function name and file. 

Right now it's showing a.out + 0x16ef
Any suggestions on how it should look like and what to look for to get it to 
show the function name instead of the memory address?

Original comment by anne...@gmail.com on 25 Apr 2012 at 3:25

GoogleCodeExporter commented 9 years ago
You need to pass a second argument with the base path to the symbols. Though 
that is a different topic that should be discussed elsewhere, say on the 
google-breakpad mailing list.

So it looks like you ran into the same compiler bug I ran into a while back. I 
think one way to get around it is to build with -O0 instead of -O2.

Original comment by thestig@chromium.org on 25 Apr 2012 at 7:01

GoogleCodeExporter commented 9 years ago
Issue 538 has been merged into this issue.

Original comment by thestig@chromium.org on 25 Jul 2013 at 8:17