dump_syms - SIGSEGV - MIPS

123 views
Skip to first unread message

arunc

unread,
Nov 23, 2021, 2:50:08 AM11/23/21
to Google Breakpad Discuss
Hi Team,

I'm trying to use the breakpad on the MIPS platform. I'm facing an a SIGSEGV while executing dump_syms

Could you please help here to fix this issue? Thanks in advance!


Code:
/google-breakpad/breakpad_exercise$ cat breakpad_exercise.c
#include <stdio.h>
#include "../src/client/linux/handler/exception_handler.h"

static bool breakpadDumpCallback(const google_breakpad::MinidumpDescriptor&descriptor,void * context,bool succeeded){
printf("\n-------------->a crah !!!!\n");
return succeeded;
}

void crash()
{
char* a = NULL;
*a = 'A';
printf("Hello char:%s\n", a);
}

int main() {
static google_breakpad::ExceptionHandler* excHandler = NULL;
excHandler = new google_breakpad::ExceptionHandler(google_breakpad::MinidumpDescriptor("./"),NULL,breakpadDumpCallback,NULL,true,-1);

printf("Hello, World!\n");
crash();

return 0;
}

make : breakpad_exercise.c -o breakpad_exercise -lbreakpad_client -lpthread -g


MIPS cross compiled bin:
google-breakpad/breakpad_exercise$ file breakpad_exercise
breakpad_exercise: ELF 32-bit MSB executable, MIPS, MIPS-I version 1 (SYSV), dynamically linked, interpreter /lib/ld-uClibc.so.0, BuildID[sha1]=94a2d491f868485cd7697d9a7af6e731428f9451, with debug_info, not stripped

Run on Board:
the above bin was running fine on the board and it catches the segfault and produced the minidump as well
# ./breakpad_exercise & # Hello, World! -------------->a crah !!!! [1]+ Segmentation fault ./breakpad_exercisedump:12024 Nov 21 21:37 63955280-4dd1-4062-58f09393-22af61de.dmp
Backtrace:
crash while  producing the text-format symbols.

google-breakpad/breakpad_exercise$ gdb --args ../src/tools/linux/dump_syms/dump_syms breakpad_exercise
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../src/tools/linux/dump_syms/dump_syms...
(gdb) run
Starting program: /home/wio/project/nw/tools/google-breakpad/src/tools/linux/dump_syms/dump_syms breakpad_exercise

Program received signal SIGSEGV, Segmentation fault.
0x000055555558a369 in google_breakpad::(anonymous namespace)::FindElfClassSegment<google_breakpad::ElfClass32> (segments=0x7fffffffd6c0, segment_type=4,
    elf_base=0x7ffff791e000 "\177ELF\001\002\001") at src/common/linux/elfutils.cc:102
102  for (int i = 0; i < elf_header->e_phnum; ++i) {
(gdb) bt
#0  0x000055555558a369 in google_breakpad::(anonymous namespace)::FindElfClassSegment<google_breakpad::ElfClass32> (segments=0x7fffffffd6c0, segment_type=4,
    elf_base=0x7ffff791e000 "\177ELF\001\002\001") at src/common/linux/elfutils.cc:102
#1  google_breakpad::FindElfSegments (elf_mapped_base=elf_mapped_base@entry=0x7ffff791e000, segment_type=segment_type@entry=4, segments=segments@entry=0x7fffffffd6c0)
    at src/common/linux/elfutils.cc:172
#2  0x000055555558ac0d in google_breakpad::FindElfBuildIDNote (identifier=..., elf_mapped_base=0x7ffff791e000) at src/common/linux/file_id.cc:101
#3  google_breakpad::FileID::ElfFileIdentifierFromMappedFile (base=base@entry=0x7ffff791e000, identifier=...) at src/common/linux/file_id.cc:150
#4  0x0000555555582ec9 in (anonymous namespace)::InitModuleForElfClass<google_breakpad::ElfClass32> (elf_header=0x7ffff791e000, obj_filename="breakpad_exercise", obj_os="Linux",
    module=...) at /usr/include/c++/9/ext/new_allocator.h:89
#5  0x0000555555587ef8 in (anonymous namespace)::ReadSymbolDataElfClass<google_breakpad::ElfClass32> (out_module=0x7fffffffdcb0, options=...,
    debug_dirs=std::vector of length 0, capacity 0, obj_os="Linux", obj_filename="breakpad_exercise", elf_header=0x7ffff791e000) at ./src/common/scoped_ptr.h:92
#6  google_breakpad::ReadSymbolDataInternal (obj_file=0x7ffff791e000 "\177ELF\001\002\001", obj_filename="breakpad_exercise", obj_os="Linux",
    debug_dirs=std::vector of length 0, capacity 0, options=..., module=0x7fffffffdcb0) at src/common/linux/dump_symbols.cc:1053
#7  0x00005555555889c1 in google_breakpad::ReadSymbolData (load_path=..., obj_file="breakpad_exercise", obj_os="Linux", debug_dirs=std::vector of length 0, capacity 0, options=...,
    module=0x7fffffffdcb0) at src/common/linux/dump_symbols.cc:1136
#8  0x0000555555588a0a in google_breakpad::WriteSymbolFile (load_path=..., obj_file=..., obj_os=..., debug_dirs=..., options=..., sym_stream=...)
    at src/common/linux/dump_symbols.cc:1073
#9  0x000055555555d7b1 in main (argc=<optimized out>, argv=<optimized out>) at /usr/include/c++/9/ext/new_allocator.h:80
(gdb)

host machine;
breakpad_exercise$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal

 Thanks,
AC

arunc

unread,
Nov 26, 2021, 4:43:17 AM11/26/21
to Google Breakpad Discuss
Hi Team,

I see a another conversation for the same issue, but not sure the final conclusion

arunc

unread,
Nov 30, 2021, 4:44:58 AM11/30/21
to Google Breakpad Discuss
Hi Team,

Could anyone please help on this issue?

Reply all
Reply to author
Forward
0 new messages