Skip to content
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

[PLAT-8545] Capture the current thread name on crash #1406

Merged
merged 6 commits into from
Jun 23, 2022

Conversation

kstenerud
Copy link
Contributor

Goal

Capturing thread names is async-safe when getting the current thread name. This can be useful when recording Objective-C and C++ exceptions because they are handled on the same thread that threw the exception.

Note: This won't capture the offending thread name for mach exceptions because they are handled on the mach exception handler thread.

Testing

Added thread name checks for ObjC and C++ exception e2e tests.

@github-actions
Copy link

github-actions bot commented Jun 16, 2022

Bugsnag.framework binary size increased by 88 bytes from 814,568 to 814,656

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%    +132  +0.1%    +132    __TEXT,__text
  +1.1%     +32  +1.1%     +32    Binding Info
  +0.0%     +32  +0.0%     +32    String Table
  +0.0%     +16  +0.0%     +16    Symbol Table
  +0.8%     +16  +0.8%     +16    __TEXT,__const
  +2.4%      +8  +2.4%      +8    __DATA,__got
  +0.2%      +4  +0.2%      +4    Indirect Symbol Table
  -0.1%      -8  -0.1%      -8    [__DATA]
  [NEW]      +4  -1.8%     -84    [__LINKEDIT]
  -0.6%    -148  -0.6%    -148    [__TEXT]
  +0.0%     +88  [ = ]       0    TOTAL

Generated by 🚫 Danger

@kstenerud kstenerud force-pushed the PLAT-8545-current-thread-name branch from 6c65bf2 to ae3a3d8 Compare June 17, 2022 08:12
@kstenerud kstenerud requested a review from kattrali June 17, 2022 08:12
@kstenerud kstenerud force-pushed the PLAT-8545-current-thread-name branch from de7296e to 6398f26 Compare June 20, 2022 07:39
@kstenerud kstenerud requested a review from kattrali June 20, 2022 07:59
Copy link
Contributor

@nickdowell nickdowell left a comment

Choose a reason for hiding this comment

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

The changes to bsg_kscrw_i_writeThread LGTM but I think adding more scenarios to the E2E is a bad idea due to additional run time required. Instead the thread name checks can be conditionalised - e.g.

And on iOS 13 and later, the event "threads.0.name" equals "потік"

@kstenerud kstenerud force-pushed the PLAT-8545-current-thread-name branch from 6398f26 to c307386 Compare June 21, 2022 08:07
@kstenerud kstenerud merged commit c8c0c39 into next Jun 23, 2022
@kstenerud kstenerud deleted the PLAT-8545-current-thread-name branch June 23, 2022 11:23
@nickdowell nickdowell mentioned this pull request Jun 29, 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.

4 participants