1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:48:11 +00:00
serenity/Libraries
Sergey Bugaev 839ae82d66 LibC: Ensure abort() doesn't return
It's not enough to send ourselves a SIGABRT, as it may be ignored or handled
differently. We really, really want abort() to never return, as that will mess
up the assumptions of the calling code big time. So, if raise(SIGABRT) returns,
kill ourselves with SIGKILL, and if that somehow returns too, call _exit().

An alternative approach, which glibc apparently follows, is to reset SIGABRT
disposition to its default value and then send SIGABRT to yourself a second
time. That would also work, but I believe SIGKILL + _exit() to be a simpler
approach that is less likely to break in extremely weird situations.

Note that this only guarantees that abort() never returns, not that the process
actually gets killed. It's still possible to install a SIGABRT handler that
simply never returns (such as by longjmp'ing out, endlessly looping, or exec'ing
another image). That is a legitimate use case we want to support; at the same
time most software doesn't use that functionality and would benefit from hard
guarantees that abort() terminates the program. The following commit is going to
introduce means for ensuring SIGABRT handler is never reset to something
unexpected.
2020-05-26 14:35:10 +02:00
..
LibAudio Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibC LibC: Ensure abort() doesn't return 2020-05-26 14:35:10 +02:00
LibCore Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
LibCrypto Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibDebug LibDebug: Make sure to not single step the program twice 2020-05-24 10:42:21 +02:00
LibDesktop LaunchServer: Discover handlers from *.af files, allow launching based on a known handler 2020-05-18 11:27:27 +02:00
LibELF Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
LibGemini LibGemini: Implement rendering text/gemini documents to HTML 2020-05-17 16:35:42 +02:00
LibGfx LibGfx: Add Painter::fill_ellipse() 2020-05-24 23:30:12 +02:00
LibGUI LibGUI: Add flag to TextDocument's word break locator methods 2020-05-25 11:33:39 +02:00
LibHTTP ProtocolServer: Support request headers 2020-05-21 12:27:42 +02:00
LibIPC Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibJS LibJS: Add Array.prototype.splice 2020-05-26 12:47:11 +02:00
LibLine LibLine: Don't add empty lines to history 2020-05-26 00:50:49 +02:00
LibM LibM: Add M_SQRT2 and M_SQRT1_2 2020-05-24 23:30:12 +02:00
LibMarkdown Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibPCIDB Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibProtocol ProtocolServer: Support request headers 2020-05-21 12:27:42 +02:00
LibPthread Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem" 2020-05-20 16:24:26 +02:00
LibTextCodec Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibThread Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
LibTLS LibTLS: Do not call on_tls_finished until the client has read app data 2020-05-21 01:21:39 +02:00
LibUnwind LibUnwind: Create UnwindBase.h to capture the EH ABI in code 2020-05-14 08:50:10 +02:00
LibVT LibVT: Pass the handler name to Launcher::open_url to control what gets launched 2020-05-18 11:27:27 +02:00
LibWeb LibWeb: Add Element.getAttribute() and Element.setAttribute() :^) 2020-05-26 12:27:10 +02:00
LibX86 Build: Switch to CMake :^) 2020-05-14 20:15:18 +02:00
CMakeLists.txt Revert "LibC: Implement Itanium C++ ABI for static variable guards" 2020-05-20 16:24:26 +02:00