-
-
Notifications
You must be signed in to change notification settings - Fork 475
fix(anr): extend main thread detection from thread dump #5733
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
+140
−15
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4330409
fix(anr): detect main thread when OS names it after the process
markushi afcbab4
Format code
getsentry-bot fd4f335
ref(anr): Detect main thread via sysTid matching process id
markushi b3f6ab0
changelog
markushi e62aea4
Simplify changelog entry
markushi e844d0a
ref(anr): Normalize main thread name and skip threads without a stack…
markushi 6ecc3b3
ref(anr): Detect main thread via sysTid and skip stackless threads
markushi 99cc520
ref(anr): Clean up ThreadDumpParser
markushi 512563b
Update CHANGELOG.md
markushi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
sentry-android-core/src/test/resources/thread_dump_no_stacktrace.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
|
|
||
| ----- pid 12345 at 2024-01-01 10:00:00.000000000+0000 ----- | ||
| Cmd line: io.sentry.samples.android | ||
| Build fingerprint: 'google/sdk_gphone64_arm64/emu64a:13/TE1A.220922.012/9302419:userdebug/dev-keys' | ||
| ABI: 'arm64' | ||
|
|
||
| DALVIK THREADS (2): | ||
| "main" prio=5 tid=1 Runnable | ||
| | group="main" sCount=0 ucsCount=0 flags=0 obj=0x72a985e0 self=0xb400007cabc57380 | ||
| | sysTid=12345 nice=-10 cgrp=top-app sched=0/0 handle=0x7deceb74f8 | ||
| | state=R schedstat=( 324804784 183300334 997 ) utm=23 stm=8 core=3 HZ=100 | ||
| | stack=0x7ff93a9000-0x7ff93ab000 stackSize=8188KB | ||
| | held mutexes= | ||
| at io.sentry.samples.android.MainActivity.onCreate(MainActivity.java:42) | ||
|
|
||
| "Thread-2" prio=5 tid=2 Sleeping | ||
| | group="main" sCount=1 ucsCount=0 flags=1 obj=0x136c0518 self=0xb400007cabc82ad0 | ||
| | sysTid=12346 nice=0 cgrp=top-app sched=0/0 handle=0x7ace0a9cb0 | ||
| | state=S schedstat=( 574039 4838087 11 ) utm=0 stm=0 core=1 HZ=100 | ||
| | stack=0x7acdfb2000-0x7acdfb4000 stackSize=991KB | ||
| | held mutexes= |
24 changes: 24 additions & 0 deletions
24
sentry-android-core/src/test/resources/thread_dump_process_name_main.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
|
|
||
| ----- pid 12345 at 2024-01-01 10:00:00.000000000+0000 ----- | ||
| Cmd line: io.sentry.samples.android | ||
| Build fingerprint: 'google/sdk_gphone64_arm64/emu64a:13/TE1A.220922.012/9302419:userdebug/dev-keys' | ||
| ABI: 'arm64' | ||
|
|
||
| DALVIK THREADS (2): | ||
| "io.sentry.samples.android" prio=5 tid=1 Runnable | ||
| | group="main" sCount=0 ucsCount=0 flags=0 obj=0x72a985e0 self=0xb400007cabc57380 | ||
| | sysTid=12345 nice=-10 cgrp=top-app sched=0/0 handle=0x7deceb74f8 | ||
| | state=R schedstat=( 324804784 183300334 997 ) utm=23 stm=8 core=3 HZ=100 | ||
| | stack=0x7ff93a9000-0x7ff93ab000 stackSize=8188KB | ||
| | held mutexes= | ||
| at io.sentry.samples.android.MainActivity.onCreate(MainActivity.java:42) | ||
|
|
||
| "Thread-2" prio=5 tid=2 Sleeping | ||
| | group="main" sCount=1 ucsCount=0 flags=1 obj=0x136c0518 self=0xb400007cabc82ad0 | ||
| | sysTid=12346 nice=0 cgrp=top-app sched=0/0 handle=0x7ace0a9cb0 | ||
| | state=S schedstat=( 574039 4838087 11 ) utm=0 stm=0 core=1 HZ=100 | ||
| | stack=0x7acdfb2000-0x7acdfb4000 stackSize=991KB | ||
| | held mutexes= | ||
| at java.lang.Thread.sleep(Native method) | ||
| at io.sentry.samples.android.BackgroundWorker.run(BackgroundWorker.java:20) | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.