how to read .dmp file? only dump_syms and minidump_stackwalk?

615 views
Skip to first unread message

hy l

unread,
Feb 24, 2021, 4:53:23 AM2/24/21
to Crashpad-dev
hi ,i'm new to learn crashpad .
i want to know that how to get more info from  .dmp file ?
i use dump_syms and  minidump_stackwalk to read .dmp file
but only backtrace info
for example:

 2021-02-24 17:46:32: basic_code_modules.cc:110: INFO: No module at 0x7ffcbc73841f
2021-02-24 17:46:32: basic_code_modules.cc:110: INFO: No module at 0x7ffcbc73842d
2021-02-24 17:46:32: basic_code_modules.cc:110: INFO: No module at 0x7ffcbc738441
2021-02-24 17:46:32: basic_code_modules.cc:110: INFO: No module at 0x7ffcbc73845d
2021-02-24 17:46:32: minidump_processor.cc:326: INFO: Processed /root/crashpad/crashpad/out/Default/crash/pending/e99b4548-0372-458a-a38b-4d1ec1ee9a0c.dmp
OS|Linux|4.18.0 -80 #1 SMP Tue Jun 4 09:19:46 UTC 2019 x86_64
CPU|amd64|family 6 model 85 stepping 7|4
GPU|||
Crash|SIGSEGV|0x0|0
Module|crashpad_self_te|0.0.0.0|crashpad_self_te|9D7F314817E91694767C79C4E3841DDB0|0x5608ae8ee000|0x5608aeb56517|1
Module|libgcc_s.so.1|0.0.0.0|libgcc_s.so.1|9BC19433D1A073486DE7783F997136DD0|0x7f7bfb486000|0x7f7bfb69d2cf|0
Module|libc.so.6|0.0.0.0|libc.so.6|D6B798055EA0AE64676133CF6331AF550|0x7f7bfb69e000|0x7f7bfba6181f|0
Module|libpthread.so.0|0.0.0.0|libpthread.so.0|72B82653A08F711B49DAC943100F14050|0x7f7bfba62000|0x7f7bfbc814bf|0
Module|libm.so.6|0.0.0.0|libm.so.6|7008DA33CC7A030F330B80C8B34A4D040|0x7f7bfbc82000|0x7f7bfc00313f|0
Module|libstdc++.so.6|0.0.0.0|libstdc++.so.6|6AF140DE7451E919F4F55C412F9770120|0x7f7bfc004000|0x7f7bfc39861f|0
Module|libdl.so.2|0.0.0.0|libdl.so.2|1DC851396E357B3D3D625BAD8091A35D0|0x7f7bfc399000|0x7f7bfc59c12f|0
Module|ld-linux-x86-64.so.2|0.0.0.0|ld-linux-x86-64.so.2|33680C40CEAAB602D44F200706D11B370|0x7f7bfc59d000|0x7f7bfc7c714f|0
Module|linux-vdso.so.1|0.0.0.0|linux-vdso.so.1|4F254406BA9C26A8DB070A796046026A0|0x7ffcbc7aa000|0x7ffcbc7aafba|0

0|0|crashpad_self_te|test(int, int)|/root/crashpad/crashpad/out/Default/../../tools/crashpad_self_te.cc|94|0x0
0|1|crashpad_self_te|main|/root/crashpad/crashpad/out/Default/../../tools/crashpad_self_te.cc|99|0x8
0|2|libc.so.6|__libc_start_main|||0xf3
0|3|crashpad_self_te|_start|||0x2e
0|4|||||0x7ffcbc736158
0|5|ld-linux-x86-64.so.2|setitimer|||0x209dd0
2021-02-24 17:46:32: minidump.cc:4980: INFO: Minidump closing minidump

i use minidump_stackwalk -m or -s 
but i wang to get more info 
such as gdb ,i can get the value of the variables

what should i do? or Is there any documentation to learn ?

thanks a lot


hy l

unread,
Feb 24, 2021, 4:59:26 AM2/24/21
to Crashpad-dev, hy l
by the way ,what cause this :
 2021-02-24 17:46:32: basic_code_modules.cc:110: INFO: No module at 0x7ffcbc73842d 
is that an error?

Joshua Peraza

unread,
Feb 24, 2021, 11:55:00 AM2/24/21
to hy l, Crashpad-dev
You should be able to pass your artifacts (executables, libraries, debug info) and a minidump to LLDB and it should be able to show local variables if there is sufficient debug info provided.

On Wed, Feb 24, 2021 at 1:59 AM hy l <l9491...@gmail.com> wrote:
by the way ,what cause this :
 2021-02-24 17:46:32: basic_code_modules.cc:110: INFO: No module at 0x7ffcbc73842d 
is that an error?

That's fine to ignore. It just means there wasn't any code loaded at that address, which isn't necessarily a bad thing.
 
--
You received this message because you are subscribed to the Google Groups "Crashpad-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to crashpad-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/crashpad-dev/cca49808-17d0-4e2a-b3af-3cb4859175aen%40chromium.org.

hy l

unread,
Mar 1, 2021, 4:28:20 AM3/1/21
to Crashpad-dev, Joshua Peraza, Crashpad-dev
thanks for your reply!
but when I use lldb to parse the  minidump file of crashpad , I met some questions.
I run my test program on Centos, x86_64, lldb version 7.0.1
 
when I use dump_syms and minidump_stackwalk ,I can get right backtrace :

0|0|test_myself|test(int, int)|/root/crashpad/crashpad/out/Default/../../tools/test_myself.cc|96|0x0
0|1|test_myself|main|/root/crashpad/crashpad/out/Default/../../tools/test_myself.cc|102|0x8
0|2|libc.so.6|__libc_start_main|||0xf3
0|3|test_myself|_start|||0x2e
0|4|||||0x7ffe28c60008
0|5|ld-linux-x86-64.so.2|setitimer|||0x209dd0
2021-03-01 16:47:31: minidump.cc:4980: INFO: Minidump closing minidump

then I use lldb to parse my minidump file ,
my cmd is :
lldb  -c /path/to/mytest.dmp

and I try to add symbol files like this  :
(lldb) target symbols add /root/crashpad/crashpad/out/Default/test_myself
...

but I get wrong backtrace such as :

(lldb) bt
* thread #1, stop reason = signal SIGSEGV
  * frame #0: 0x000055d0663780de test_myself`sys_rt_sigtimedwait(s=<unavailable>, i=<unavailable>, t=<unavailable>, c=<unavailable>) at linux_syscall_support.h:3512

(lldb) frame variable
(const kernel_sigset_t *) s = <read memory from 0x7f2d86acb0b0 failed (0 of 8 bytes read)>

(siginfo_t *) i = <read memory from 0x7f2d86acb0a8 failed (0 of 8 bytes read)>

(const timespec *) t = <read memory from 0x7f2d86acb0a0 failed (0 of 8 bytes read)>

(size_t) c = <read memory from 0x7f2d86acb098 failed (0 of 8 bytes read)>

(long long) __res = <read memory from 0x7f2d86acb090 failed (0 of 8 bytes read)>


Does crashpad support my platform? Or how to use lldb to parse minidump correct ? I searched how to use lldb to parse minidump by google ,Unfortunately,I got nothing helpful.

here is my code , a simple demo  :

#include "client/crashpad_info.h"
#include "client/crashpad_client.h"
#include "client/crash_report_database.h"
#include "client/settings.h"

#include <stdio.h>
#include <unistd.h>

#if defined(__APPLE__)
typedef std::string StringType;
#elif  defined(__linux__)
typedef std::string StringType;
#elif defined(_MSC_VER)
typedef std::wstring StringType;
#endif

using namespace base;
using namespace crashpad;
using namespace std;


bool initializeCrashpad() {

  FilePath handler("/root/crashpad/crashpad/crashpad_handler");
  FilePath reportsDir("/crash");
  FilePath metricsDir("/crash");

  StringType url = "";

  map<StringType, StringType> annotations;
  annotations["format"] = "minidump";                   

  vector<StringType> arguments; 
  arguments.push_back("--no-rate-limit");


  unique_ptr<CrashReportDatabase> database = CrashReportDatabase::Initialize(reportsDir);
  if (database == NULL) return false;

  vector<FilePath> attachments;
  FilePath attachment("/crash/attachment.txt");
  attachments.push_back(attachment);

  Settings *settings = database->GetSettings();
  if (settings == NULL) return false;
  settings->SetUploadsEnabled(false);

  CrashpadClient *client = new CrashpadClient();
  bool status = client->StartHandler(handler, reportsDir, metricsDir, url, annotations, arguments, false, false, attachments);

  return status;
}

int test(int a,int b)
{
  int x = a + b;
  int* p = nullptr;
  *p = x;
  return x;
}

int main(int argc, char *argv[]) {
  initializeCrashpad();
  test(1,2);
  return 0;
}

Thanks a lot!


hy l

unread,
Mar 1, 2021, 4:31:11 AM3/1/21
to Crashpad-dev, hy l, Joshua Peraza, Crashpad-dev
my Linux kernel version is :

[root@x86_64 crashpad]# uname -a
Linux x86_64.localdomain 4.18.0-80.el8.x86_64 #1 SMP Tue Jun 4 09:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


Reply all
Reply to author
Forward
Message has been deleted
0 new messages