Repository navigation
aosp: Fix the crash handler startup - #12916
Conversation
🤖 Gemini Suggested Commit Message💡 Pro Tips for a Better Commit Message:
|
|
There was a problem hiding this comment.
Code Review
This pull request introduces Android support for the Crashpad handler, enabling it to run via the system linker on Android Q and later, and dynamically building the environment with LD_LIBRARY_PATH. The review feedback suggests adding a defensive null check for the global environ pointer in BuildHandlerEnvironment to prevent potential dereferencing issues. Additionally, it notes that the preprocessor conditional branches in crashpad_client_linux.cc are identical and should be simplified.
@ogarai are you saying it never ran for Cobalt 25 or in the current Cobalt 27 build? @hlwarriner can you help review this approach? |
I meant Cobalt 27, I suspect it worked fine in Cobalt 25 because the handler path and the CA certs matched how the APK was packaged before, so they needed updating in Cobalt 27 to the current expected locations. |
It looks like some significant changes are made to how we package and run the Crashpad handler on AOSP vs. in C25. I want to take a closer look and try a local build, and will reply early next week with comments. |
|
Hey, I had been working on this and pushed a version of this fix here: 472b646. @ogarai feel free to pick whatever it makes sense from that commit. In particular, @andrewsavage1 confirmed that partner toolchains should be using crashpad_handler instead of chrome_crashpad_handler. |
hlwarriner
left a comment
There was a problem hiding this comment.
Sorry for the delay but I've left a few comments about concerns I have with the approach.
As a higher level comment, I would in general suggest that we package and run the Crashpad handler similarly to how we did in C25. If there are compelling reasons to change the approach then I think a short doc explaining the changes at a high level would be very helpful.
|
CC @alunev as FYI |
bdda9c8 to
dbe70a1
Compare
Done. I've applied your approach on this PR. Thanks! |
|
@hlwarriner @hferreiro I've incorporated 472b646 and ported the c25 certs logic. PTAL |
On AOSP the crashpad handler never ran. The loader looked for the wrong file name under a hardcoded arm/ directory, and the exec'd handler couldn't load libc++_shared.so. Uploads would also have failed, because the handler was pointed at CA certificates inside the APK. Launch it through /system/bin/linker, which Android TV added in youtube#9637, with the library directory only in the handler's environment. This path uses the Android system CA store. Like Android TV, it needs Android Q. Test: On device, a crash starts the handler, which writes a minidump and uploads it. With youtube#12903, the Evergreen System Image crash handler yts test finds the uploaded report and then fails on symbolization. Bug: 532158865
dbe70a1 to
c0e8d3e
Compare
|
Gentle ping @hlwarriner @hferreiro |
|
@hferreiro @hlwarriner PTAL at the latest commit, thanks! |
|
@hferreiro @hlwarriner gentle ping |
done |
Thanks for making the latest round of changes. Things are extremely busy over here as we prepare for our LTS release but I'll take a final look by eod Monday at the latest. |
Refer to original PR: #12916 On AOSP the crashpad handler never ran. The loader looked for the wrong file name under a hardcoded arm/ directory, and the exec'd handler couldn't load libc++_shared.so. Uploads would also have failed, because the handler was pointed at CA certificates inside the APK. Package the base crashpad_handler, as other Evergreen platforms do, with libc++ linked statically. Exec it from the native library directory, as in C25. At startup, copy the CA certificates out of the APK into the cache directory and pass that copy to the handler, also as in C25. Test: On device, a crash starts the handler, which writes a minidump and uploads it. Both Evergreen System Image native stability yts tests pass. The crash handler yts test finds the uploaded report and then fails on symbolization. Co-authored-by: Henrique Ferreiro <hferreiro@igalia.com> Bug: 532158865 (cherry picked from commit 77e87db)
Refer to original PR: #12916 On AOSP the crashpad handler never ran. The loader looked for the wrong file name under a hardcoded arm/ directory, and the exec'd handler couldn't load libc++_shared.so. Uploads would also have failed, because the handler was pointed at CA certificates inside the APK. Package the base crashpad_handler, as other Evergreen platforms do, with libc++ linked statically. Exec it from the native library directory, as in C25. At startup, copy the CA certificates out of the APK into the cache directory and pass that copy to the handler, also as in C25. Test: On device, a crash starts the handler, which writes a minidump and uploads it. Both Evergreen System Image native stability yts tests pass. The crash handler yts test finds the uploaded report and then fails on symbolization. Co-authored-by: Henrique Ferreiro <hferreiro@igalia.com> Bug: 532158865 (cherry picked from commit 77e87db)
Follow-up to #12916. On Evergreen platforms the Crashpad handler is a separate executable that only the native toolchain builds, and the loader launches it. The Chromium crash reporter linked into the hermetic libcobalt.so is a stub, so the hermetic build has no use for chrome_crashpad_handler and shouldn't build it at all. Bug: 406511608
Since #12916, the AOSP platform configuration applies -static-libstdc++ to every native toolchain binary, so the per-target flag on devil_util_bin is redundant. Drop it. Cross-reference the flag and the libunwind that //build/config:common_deps adds for the native toolchain, since the static libc++ doesn't link without it. Bug: 495203133
Follow-up to youtube#12916. The hermetic libcobalt.so compiled the Chromium crash reporter against Crashpad client stubs kept in third_party only so that it would link. Crash reporting in libcobalt.so is a no-op there: Crashpad is run by the loader, through //starboard/crashpad_wrapper, and libcobalt.so reaches it through Starboard extensions rather than this API. Replace the reporter with a no-op in hermetic builds, and remove the stubs it kept alive. Bug: 406511608
…ermetically Refer to original PR: #13348 Follow-up to #12916. On Evergreen platforms the Crashpad handler is a separate executable that only the native toolchain builds, and the loader launches it. The Chromium crash reporter linked into the hermetic libcobalt.so is a stub, so the hermetic build has no use for chrome_crashpad_handler and shouldn't build it at all. Bug: 406511608 (cherry picked from commit 1f9f737)
Refer to original PR: #13349 Since #12916, the AOSP platform configuration applies -static-libstdc++ to every native toolchain binary, so the per-target flag on devil_util_bin is redundant. Drop it. Cross-reference the flag and the libunwind that //build/config:common_deps adds for the native toolchain, since the static libc++ doesn't link without it. Bug: 495203133 (cherry picked from commit c1b25e5)
…ermetically Refer to original PR: #13348 Follow-up to #12916. On Evergreen platforms the Crashpad handler is a separate executable that only the native toolchain builds, and the loader launches it. The Chromium crash reporter linked into the hermetic libcobalt.so is a stub, so the hermetic build has no use for chrome_crashpad_handler and shouldn't build it at all. Bug: 406511608 (cherry picked from commit 1f9f737)
Refer to original PR: #13349 Since #12916, the AOSP platform configuration applies -static-libstdc++ to every native toolchain binary, so the per-target flag on devil_util_bin is redundant. Drop it. Cross-reference the flag and the libunwind that //build/config:common_deps adds for the native toolchain, since the static libc++ doesn't link without it. Bug: 495203133 (cherry picked from commit c1b25e5)
On AOSP the crashpad handler never ran. The loader looked for the wrong
file name under a hardcoded arm/ directory, and the exec'd handler
couldn't load libc++_shared.so. Uploads would also have failed, because
the handler was pointed at CA certificates inside the APK.
Package the base crashpad_handler, as other Evergreen platforms do, with
libc++ linked statically. Exec it from the native library directory, as
in C25. At startup, copy the CA certificates out of the APK into the
cache directory and pass that copy to the handler, also as in C25.
Test: On device, a crash starts the handler, which writes a minidump
and uploads it. Both Evergreen System Image native stability yts tests
pass. The crash handler yts test finds the uploaded report and then
fails on symbolization.
Co-authored-by: Henrique Ferreiro hferreiro@igalia.com
Bug: 532158865