Skip to content

feat: emit inline frames #635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 2, 2022
Merged

feat: emit inline frames #635

merged 10 commits into from
Aug 2, 2022

Conversation

Gankra
Copy link
Collaborator

@Gankra Gankra commented Jul 27, 2022

just messing around right now...

TODO:

  • human output cleanup
    • fix the : in "Found by"
    • add the source file/line to the end
    • add the module to the start
      • tbh I hate the xul.dll! prefix...
      • [ ] check if mozcrash.py relies on it
  • tests
    • add a new input minidump/sym that integration tests can slurp up to test output
  • docs
    • update json-schema.md
    • add doc-comments
    • RELEASES.md
  • api
    • look over the new APIs
    • look over the new fields
    • decide if we're ok with everyone using this API having to .rev() the inlinees (probably not, but it's not a terrible burden either)
      • I was not, fixed
  • [ ] builtin dump_syms support
    • [ ] pass --inlines?
      • configurable by a flag?

@Gankra
Copy link
Collaborator Author

Gankra commented Jul 27, 2022

current sample output:

output-human.txt
Crash reason:  EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
Crash address: 0xffffffff80000042
Process uptime: 0 seconds

Thread 0 main (crashed)
 0  core::ptr::write_volatile
    Found by inlining
 1  crash-client!sadness_generator::raise_segfault [lib.rs : 133 + 0x0]
     rax = 0x000000010a000199    rdx = 0x0000700001f79000
     rcx = 0x000000010a00032c    rbx = 0x0000000000000004
     rsi = 0x00007fee420049c0    rdi = 0x00007fee42004a60
     rbp = 0x00007ffee5c02ce0    rsp = 0x00007ffee5c02ce0
      r8 = 0x00000000090008ff     r9 = 0x0000000000000003
     r10 = 0x0000700001f79000    r11 = 0x0000000000000246
     r12 = 0x0000000000000003    r13 = 0x00000000000000ff
     r14 = 0x0000000000000d03    r15 = 0x0000000200000000
     rip = 0x000000010a010c34
    Found by: given as instruction pointer in context
 2  crash_client::real_main::{{closure}}
    Found by inlining
 3  crash_client::real_main
    Found by inlining
 4  crash-client!crash_client::main [main.rs : 142 + 0x562]
     rbx = 0x0000000000000004    rbp = 0x00007ffee5c03350
     rsp = 0x00007ffee5c02cf0    r12 = 0x0000000000000003
     r13 = 0x00000000000000ff    r14 = 0x0000000000000d03
     r15 = 0x0000000200000000    rip = 0x000000010a00019e
    Found by: call frame info
 5  core::ops::function::FnOnce::call_once
    Found by inlining
 6  crash-client!std::sys_common::backtrace::__rust_begin_short_backtrace [backtrace.rs : 122 + 0x1]
     rbx = 0x00007fee41405ae0    rbp = 0x00007ffee5c03360
     rsp = 0x00007ffee5c03360    r12 = 0x00007ffee5405000
     r13 = 0x00007ffee5404000    r14 = 0x0000000000000001
     r15 = 0x000000010a0c01b8    rip = 0x000000010a001d86
    Found by: call frame info
 7  crash-client!std::rt::lang_start::{{closure}} [rt.rs : 145 + 0xb]
     rbx = 0x00007fee41405ae0    rbp = 0x00007ffee5c03370
     rsp = 0x00007ffee5c03370    r12 = 0x00007ffee5405000
     r13 = 0x00007ffee5404000    r14 = 0x0000000000000001
     r15 = 0x000000010a0c01b8    rip = 0x000000010a001a8c
    Found by: call frame info
 8  core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
    Found by inlining
 9  std::panicking::try::do_call
    Found by inlining
10  std::panicking::try
    Found by inlining
11  std::panic::catch_unwind
    Found by inlining
12  std::rt::lang_start_internal::{{closure}}
    Found by inlining
13  std::panicking::try::do_call
    Found by inlining
14  std::panicking::try
    Found by inlining
15  std::panic::catch_unwind
    Found by inlining
16  crash-client!std::rt::lang_start_internal [rt.rs : 128 + 0x3]
     rbx = 0x00007fee41405ae0    rbp = 0x00007ffee5c03480
     rsp = 0x00007ffee5c03380    r12 = 0x00007ffee5405000
     r13 = 0x00007ffee5404000    r14 = 0x0000000000000001
     r15 = 0x000000010a0c01b8    rip = 0x000000010a07f34e
    Found by: call frame info
17  crash-client!main + 0x28
     rbx = 0x0000000000000000    rbp = 0x00007ffee5c034a0
     rsp = 0x00007ffee5c03490    r12 = 0x0000000000000000
     r13 = 0x0000000000000000    r14 = 0x0000000000000000
     r15 = 0x0000000000000000    rip = 0x000000010a000379
    Found by: call frame info
18  libdyld.dylib + 0x15f3c
     rbx = 0x0000000000000000    rbp = 0x00007ffee5c034b0
     rsp = 0x00007ffee5c034b0    r12 = 0x0000000000000000
     r13 = 0x0000000000000000    r14 = 0x0000000000000000
     r15 = 0x0000000000000000    rip = 0x00007fff20329f3d
    Found by: call frame info

@Gankra
Copy link
Collaborator Author

Gankra commented Jul 28, 2022

@Gankra Gankra changed the title WIP inline frames v2 feat: emit inline frames Jul 28, 2022
@Gankra Gankra force-pushed the inline branch 2 times, most recently from d79aeec to 323709c Compare August 1, 2022 14:42
@Gankra
Copy link
Collaborator Author

Gankra commented Aug 1, 2022

lmfao sym files
image

I guess I could try to trim the file to what's needed but that kinda sounds like a pain

@Gankra Gankra marked this pull request as ready for review August 1, 2022 15:20
Copy link
Collaborator

@Swatinem Swatinem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor comments, looks awesome otherwise

@Gankra Gankra merged commit 188ec7e into rust-minidump:main Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants