| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
On some Android versions/OEMs, AppExitInfo's thread dump names the main thread after the process name (e.g. 'com.example.app') instead of 'main'. ThreadDumpParser previously only matched on 'main', causing the thread to not be flagged as main/crashed and resulting in ANR events with no usable stack trace. Pass the process name from ApplicationExitInfo.getProcessName() to ThreadDumpParser and treat a thread as main if its name equals 'main' OR the process name. Fixes JAVA-635 Co-Authored-By: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Sorry, something went wrong.
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: mainStartup times
App size
Previous results on branch: fix/anrv2-main-thread-process-nameStartup times
App size
|
Sorry, something went wrong.
The main thread can be renamed by the OS to the (potentially truncated) process name, so relying on the process name is fragile. On Linux/Android the main thread's kernel thread id (sysTid) always equals the process id, so use that as the authoritative signal instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
this looks good! shall we also address the second part which is not to attach a thread if its stacktrace has no frames? Could be addressed in a separate PR ofc
Sorry, something went wrong.
…trace Normalize the main thread's name back to "main" once it is identified (the OS may have renamed it to the process name), and drop threads that have no stacktrace as they are not actionable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Identify the main thread by matching the thread whose kernel thread id (sysTid) equals the process id, falling back to the conventional "main" thread name, and skip threads that have no stacktrace as they are not actionable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
| Back | FazBrowse Home | New Git URL |
📜 Description
Not every main thread has a name="main" set, so we ended up not correctly identifying it (on some Android versions/OEMs, native threads, etc...).
To solve this we now rely on a common Linux/Android convention: The main thread kernel id (sysTid) is the same as the process id (pid). For managed Java threads, a fallback for the "main" thread name remains.
Changes
No public API change.
💡 Motivation and Context
When the OS names the main thread after the process, ANRs were not attributed to the main thread and were reported without a stack trace. Matching on sysTid == pid is robust and does not depend on the (truncatable) process name.
Fixes JAVA-635
Fixes #5731
💚 How did you test it?
📝 Checklist
🔮 Next steps
--
View Junior Session in Sentry