util/posix/crash_handler_posix.cpp


Log

Author Commit Date CI Message
Roman Lavrov 0757254b 2024-11-22T10:21:29 Tests: Add crash callback to test Replay (e.g. linux-trace) Prints a backtrace on trapped signals. Didn't help with the issue on the bug as it was an OOM -> SIGKILL which can't be trapped but generally nice to have. Also adds stdout flushes to the signal handler as stdout redirection is by default _not_ line-buffered, so without a flush the printfs just go into the buffer and don't actually show up in the redirected output (including on bots). This might be the reason we were missing backtraces in some other cases. Bug: angleproject:380296979 Change-Id: I9fbba35e3bf4e6d863139ceb533f51973fe2f98d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6044040 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Shahbaz Youssefi 914fe61b 2024-03-15T13:20:49 Vulkan: Rename RendererVk.* to vk_renderer.* Done in a separate CL from the move to namespace vk to avoid possible rebase-time confusion with the file name change. Bug: angleproject:8564 Change-Id: Ibab79029834b88514d4466a7a4c076b1352bc450 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5370107 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Roman Lavrov 5c28a749 2023-05-18T19:20:56 Print signal to stdout before calling crash handler Doesn't fix anything but if deadlock described on the bug happens locally and stdout is piped to console (or line-buffered file), it's at least visible that a signal handler was invoked. Bug: angleproject:8080 Change-Id: I27e1b22cc269082682fd639ef087f1b8b14b26eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4544588 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Auto-Submit: Roman Lavrov <romanl@google.com> Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
Maksim Sisov 746798b2 2023-03-31T11:35:33 Allocate buffer via malloc for demangle. abi::__cxa_demangle requires that the output buffer passed for demangling is malloced according to the documentation as (quote) - "If output_buffer is not long enough, it is expanded using realloc". Not doing that results in raising exceptions and calling the angle's exception handler recursively many times. That results in a huge stacktrace as a result, which is printed until the program is terminated. Bug: angleproject:8111 Change-Id: I7ddd1a623b55fef2c8b15f40136312dd0ff4ccaf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4386396 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Lubosz Sarnecki ebdbae9b 2022-04-28T15:35:41 crash_handler_posix: Fix symbol path resolution. Use POSIX realpath function to resolve absolute paths of modules. Fix incorrect path resolution for libVkLayer_khronos_validation.so, which is given a relative path from the executable directory instead of cwd. Leave the treatment of overlapping paths in place, which is only required if a backtrace is triggered during the runtime of ScopedVkLoaderEnvironment. Remove symlink resolution, as it is done by using realpath. Print warning if symbol path cannot be resolved. This fixes the following error: /usr/bin/addr2line: '/home/user/angle/angle/angledata/../ libVkLayer_khronos_validation.so': No such file Bug: angleproject:7311 Change-Id: I46f4af93a4a27d8d09c3786933dbbb8390aa34eb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3644584 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lubosz Sarnecki cdad9363 2022-04-28T14:38:24 crash_handler_posix: Use execvp. To avoid using an absolute path for the addr2line executable, use execvp instead of execv to make the shell search for the executable in the PATH. Bug: angleproject:7310 Change-Id: I777e5f369011d910afffe86f8fb2372dc333a665 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3644582 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
Brian Sheedy 727cd8ef 2022-04-08T16:36:22 Fix pointer sscanf for ChromeOS Fixes several sscanf calls in crash_handler_posix.cpp failing to compile when compiling for ChromeOS kevin (arm-based) devices due to trying to format an unsigned int as an unsigned long. This is fixed by switching to SCNxPTR/PRIXPTR for the format strings instead of hard coding %lX. Bug: chromium:1314515 Change-Id: I012a1a74312ba653e34145883955f2d0e1ef031f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3579867 Commit-Queue: Brian Sheedy <bsheedy@chromium.org> Auto-Submit: Brian Sheedy <bsheedy@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 3f99e4d3 2021-06-18T15:21:45 Better stack traces on Linux. Checks the memory information for the process to compute a more accurate address for each function. Bug: angleproject:6070 Change-Id: I57f927f3641298af7921522da0ece683f8fd8faf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2971838 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Shahbaz Youssefi 67eb2605 2020-11-12T17:16:05 Faster stack traces on Linux Previously addr2line was called for every symbol separately. This was glacially slow as every module's debug info was repeatedly reloaded. With this change, contiguous symbols from the same module are batched together and one call to addr2line is done. Potential future optimization is to batch every symbol from the same module, but capture the output of addr2line calls and interleave them to match the stack. For example, currently 4 calls to addr2line are made for the following stack trace: moduleA(+addr1) moduleA(+addr2) moduleB(+addr3) moduleB(+addr4) moduleA(+addr5) moduleA(+addr6) moduleB(+addr7) moduleB(+addr8) while technically only two calls are necessary. Bug: angleproject:5239 Change-Id: I58742b85409b0b74bb87272bc63e251a2d0fe0e5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2535682 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
Jamie Madill 2edec864 2020-10-25T15:55:45 Improve stack backtraces on Linux. This switches the Linux crash handler to use addr2line when it is available. Addr2line is much better at converting addresses into readable information. The downside is that we must use a system call to a binary since it's not easy to integrate with addr2line source. Bug: angleproject:5239 Change-Id: I13cbaa4ba30166718fb12d924c76ba4f2675453c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2515265 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Tim Van Patten <timvp@google.com>
Jamie Madill 5407aaa0 2019-12-16T15:50:12 Re-land "Add new test runner harness." (#2) Re-land #2 changes: * export labels are fixed for the CFI build * crash test disabled because of flakiness and issues with asan Re-land changes: * Unit test is suppressed in ASAN * --deqp-case is fixed * Debug layer errors should correctly work with failure expectations Original message: The ANGLE test harness is a harness around GoogleTest that provides functionality similar to the Chromium test harness. It supports: * splitting a test set into shards * catching and reporting crashes and timeouts * outputting to the Chromium JSON test results format * multi-process execution Unit tests are added in test_utils_unittest.cpp. Bug: angleproject:3162 Bug: chromium:1030192 Change-Id: I71d66a407ea0e53d73cbe75b5b4bfb9e73791534 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1965091 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill b92ec244 2019-12-06T15:08:54 Revert "Re-land "Add new test runner harness."" This reverts commit e20560faf1de86c01198143ef7733a12a098a90b. Reason for revert: Now fails on Linux CFI and also is a bit flaky. Original change's description: > Re-land "Add new test runner harness." > > Re-land changes: > > * Unit test is suppressed in ASAN > * --deqp-case is fixed > * Debug layer errors should correctly work with failure expectations > > Original message: > > The ANGLE test harness is a harness around GoogleTest that provides > functionality similar to the Chromium test harness. It supports: > > * splitting a test set into shards > * catching and reporting crashes and timeouts > * outputting to the Chromium JSON test results format > * multi-process execution > > Unit tests are added in test_utils_unittest.cpp. > > Bug: angleproject:3162 > Change-Id: I841f2b5dfe51f7f44dac68324bdf6afd418b8bfb > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948240 > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=ynovikov@chromium.org,ianelliott@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ibfd65b8b18ead3a232abb6cb75fd6489b0ff5f38 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1954570 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill e20560fa 2019-12-04T13:18:36 Re-land "Add new test runner harness." Re-land changes: * Unit test is suppressed in ASAN * --deqp-case is fixed * Debug layer errors should correctly work with failure expectations Original message: The ANGLE test harness is a harness around GoogleTest that provides functionality similar to the Chromium test harness. It supports: * splitting a test set into shards * catching and reporting crashes and timeouts * outputting to the Chromium JSON test results format * multi-process execution Unit tests are added in test_utils_unittest.cpp. Bug: angleproject:3162 Change-Id: I841f2b5dfe51f7f44dac68324bdf6afd418b8bfb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1948240 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 8f31872c 2019-12-03T18:34:52 Revert "Add new test runner harness." This reverts commit fb40d231c3e2ee7c38f8445ef5defc0ab0f5f15d. Reason for revert: Has a bug with the ASan build and also has a few bugs with ANGLE standalone test expectations an filter. Bug: chromium:1030192 Bug: angleproject:4193 Original change's description: > Add new test runner harness. > > The ANGLE test harness is a harness around GoogleTest that provides > functionality similar to the Chromium test harness. It supports: > > * splitting a test set into shards > * catching and reporting crashes and timeouts > * outputting to the Chromium JSON test results format > * multi-process execution > > Unit tests are added in test_utils_unittest.cpp. > > Bug: angleproject:3162 > Change-Id: Idb15f113de8eb32db12bc93542de93b08d7c1447 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1478016 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Yuly Novikov <ynovikov@chromium.org> TBR=ynovikov@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: I647e747571784b1ca7c1d0687193c70a63eb08d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1947456 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill fb40d231 2019-12-02T16:39:18 Add new test runner harness. The ANGLE test harness is a harness around GoogleTest that provides functionality similar to the Chromium test harness. It supports: * splitting a test set into shards * catching and reporting crashes and timeouts * outputting to the Chromium JSON test results format * multi-process execution Unit tests are added in test_utils_unittest.cpp. Bug: angleproject:3162 Change-Id: Idb15f113de8eb32db12bc93542de93b08d7c1447 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1478016 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill 95a736bd 2019-10-09T10:26:25 Reland "Add more test_utils functions." This is a reland of 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c Re-land uses static linking with angle_util. The root cause of the CFI error wasn't solved. Static linking works around the problem by not using any export rules. Second re-land fixes missing imports for libEGL and libGLESv2 static varieties. Original change's description: > Add more test_utils functions. > > Includes methods for creating temporary files, deleting files, and > reading files into a string. Also renames GetPathSeparator to mention > it's only used for environment variables. Includes a new virtual type > angle::Process that will be used to implement cross-platform async > Process launching for tests. Also includes a way to specify a custom > crash handler callback. > > Also adds a few unit tests for the new functionality. They are disabled > on Android because the functions are not needed by the new test runner. > > Bug: angleproject:3162 > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Bug: chromium:1015810 Bug: angleproject:3162 Change-Id: I2a18b819b0f91df610ad12ffedea2b38349fe7cf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879859 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Yuly Novikov <ynovikov@chromium.org>
Jamie Madill f939cb63 2019-10-20T21:44:36 Revert "Reland "Add more test_utils functions."" This reverts commit 7923e234bc458eda5936b8cb4f09fa19e28c0452. Reason for revert: Fails compilation on rollers: [2097/6048] SOLINK ./lib_angle_unittests__library.cr.so FAILED: lib_angle_unittests__library.cr.so lib_angle_unittests__library.cr.so.TOC lib.unstripped/lib_angle_unittests__library.cr.so python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="../../third_party/android_ndk/toolch...(too long) ld.lld: error: undefined symbol: glCreateShader >>> referenced by shader_utils.cpp >>> angle_util_static/shader_utils.o:(CompileShader(unsigned int, char const*)) in archive obj/third_party/angle/libangle_util_static.a ld.lld: error: undefined symbol: glShaderSource Original change's description: > Reland "Add more test_utils functions." > > This is a reland of 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c > > Re-land uses static linking with angle_util. The root cause > of the CFI error wasn't solved. Static linking works around > the problem by not using any export rules. > > Original change's description: > > Add more test_utils functions. > > > > Includes methods for creating temporary files, deleting files, and > > reading files into a string. Also renames GetPathSeparator to mention > > it's only used for environment variables. Includes a new virtual type > > angle::Process that will be used to implement cross-platform async > > Process launching for tests. Also includes a way to specify a custom > > crash handler callback. > > > > Also adds a few unit tests for the new functionality. They are disabled > > on Android because the functions are not needed by the new test runner. > > > > Bug: angleproject:3162 > > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > > Commit-Queue: Jamie Madill <jmadill@chromium.org> > > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > > Bug: chromium:1015810 > Bug: angleproject:3162 > Change-Id: I6a2c1e7b585a13ca846759f32da0777c00d7f7e6 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869541 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=ynovikov@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: I975b2214411906cb981bffa04fa50e0a65ff8b4e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1015810, angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1870811 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 7923e234 2019-10-09T10:26:25 Reland "Add more test_utils functions." This is a reland of 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c Re-land uses static linking with angle_util. The root cause of the CFI error wasn't solved. Static linking works around the problem by not using any export rules. Original change's description: > Add more test_utils functions. > > Includes methods for creating temporary files, deleting files, and > reading files into a string. Also renames GetPathSeparator to mention > it's only used for environment variables. Includes a new virtual type > angle::Process that will be used to implement cross-platform async > Process launching for tests. Also includes a way to specify a custom > crash handler callback. > > Also adds a few unit tests for the new functionality. They are disabled > on Android because the functions are not needed by the new test runner. > > Bug: angleproject:3162 > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Bug: chromium:1015810 Bug: angleproject:3162 Change-Id: I6a2c1e7b585a13ca846759f32da0777c00d7f7e6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869541 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
Lan Wei 0cb09633 2019-10-18T15:50:10 Revert "Add more test_utils functions." This reverts commit 5fcfcea4a9379633a83a67fc1d94938cb31f2a9c. Reason for revert: 1 Test Suite(s) failed. angle_unittests failed because of: TestUtils.RunApp on Linux CFI https://ci.chromium.org/p/chromium/builders/ci/Linux%20CFI Original change's description: > Add more test_utils functions. > > Includes methods for creating temporary files, deleting files, and > reading files into a string. Also renames GetPathSeparator to mention > it's only used for environment variables. Includes a new virtual type > angle::Process that will be used to implement cross-platform async > Process launching for tests. Also includes a way to specify a custom > crash handler callback. > > Also adds a few unit tests for the new functionality. They are disabled > on Android because the functions are not needed by the new test runner. > > Bug: angleproject:3162 > Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 > Commit-Queue: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> TBR=ynovikov@chromium.org,jonahr@google.com,jmadill@chromium.org Change-Id: I1441bfbae31712f72b4aebeeea9cd711c3975a5d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:3162 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1869254 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
Jamie Madill 5fcfcea4 2019-10-09T10:26:25 Add more test_utils functions. Includes methods for creating temporary files, deleting files, and reading files into a string. Also renames GetPathSeparator to mention it's only used for environment variables. Includes a new virtual type angle::Process that will be used to implement cross-platform async Process launching for tests. Also includes a way to specify a custom crash handler callback. Also adds a few unit tests for the new functionality. They are disabled on Android because the functions are not needed by the new test runner. Bug: angleproject:3162 Change-Id: I3e2c2e9837608884c98379fa0f78c9ffbe158d73 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1821940 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jonah Ryan-Davis <jonahr@google.com>
Jamie Madill 57b37b6b 2019-09-25T18:29:28 Rename util/system_utils to util/test_utils. This removes a GN naming conflict between util/system_utils and common/system_utils. This conflict was preventing us from adding unit tests to utils' version of system_utils. Since these functions are only useful to tests and samples rename them test_utils for simplicity. Will enable further development of ANGLE's standalone testing harness. Bug: angleproject:3162 Change-Id: I9e34fb69f96c5de6dc2453fce4148a0f285e15ed Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1825268 Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> Reviewed-by: Yuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>