ladybird/Libraries/LibC
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
..
arpa LibC: Add inet_aton, based on inet_pton 2020-05-11 09:50:42 +02:00
bits LibC: Rewrite stdio 2020-05-20 08:31:31 +02:00
net Userland: ifconfig can change the IP address of the default gateway 2020-03-15 19:09:31 +01:00
netinet LibC: Add (empty) netinet/tcp.h back 2020-05-22 23:46:24 +02:00
sys LibC: Move ssize_t from <stddef.h> to <sys/types.h> 2020-05-23 17:03:41 +02:00
alloca.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
assert.cpp LibC: Remove endless loop after abort() call 2020-05-26 14:35:10 +02:00
assert.h LibC: Hint the compiler that assertions rarely fail 2020-04-30 11:30:27 +02:00
byteswap.h Meta: Add missing copyright headers 2020-04-06 11:09:01 +02:00
CMakeLists.txt Revert "LibC: Implement Itanium C++ ABI for static variable guards" 2020-05-20 16:24:26 +02:00
crt0.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
crti.S Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
crtn.S Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ctype.cpp Revert "LibC: Implement isblank()" 2020-02-16 10:47:54 +01:00
ctype.h LibC: Don't let ctype isfoo() helpers access array out of bounds 2020-05-17 22:35:25 +02:00
cxxabi.cpp Revert "LibC: Implement Itanium C++ ABI for static variable guards" 2020-05-20 16:24:26 +02:00
dirent.cpp Kernel+LibC: Fix various build issues introduced by ssize_t 2020-05-23 15:27:33 +02:00
dirent.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
dlfcn.cpp LibELF: Move ELF classes into namespace ELF 2020-04-11 22:41:05 +02:00
dlfcn.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
endian.h LibC: Fix big endian definitions 2020-02-19 16:08:28 +01:00
errno.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
errno_numbers.h Kernel+LibC: Remove ESUCCESS 2020-04-10 13:09:35 +02:00
fcntl.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
fcntl.h Kernel+LibC: Switch isatty() to use a fcntl() 2020-05-20 08:31:31 +02:00
fd_set.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
float.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
getopt.cpp LibC: Ensure getopt error messages end with a newline 2019-09-17 21:56:42 +02:00
getopt.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
grp.cpp LibC: Fix truncated strncpy() in /etc/group parsing 2020-04-13 12:27:05 +02:00
grp.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
iconv.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
inttypes.h LibC: Add some missing macros to inttypes.h 2020-02-20 06:51:16 +01:00
ioctl.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
libcinit.cpp LibWeb: Move everything into the Web namespace 2020-03-07 10:27:02 +01:00
libgen.cpp Meta: Claim copyright for files created by me 2020-01-24 15:15:16 +01:00
libgen.h Meta: Claim copyright for files created by me 2020-01-24 15:15:16 +01:00
limits.h LibC: Use more flexible digit parsing code, deduplicate 2020-05-11 10:52:24 +02:00
locale.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
locale.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
malloc.cpp Revert "AK+LibC: Move non-placement new/delete into LibC" 2020-05-20 16:24:26 +02:00
mallocdefs.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
memory.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
mman.cpp Kernel+LibC: Add minherit() and MAP_INHERIT_ZERO 2020-04-12 20:22:26 +02:00
mman.h Kernel+LibC: Add minherit() and MAP_INHERIT_ZERO 2020-04-12 20:22:26 +02:00
mntent.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
mntent.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
netdb.cpp LibC: getprotoent() family of functions 2020-04-18 10:11:55 +02:00
netdb.h LibC: getprotoent() family of functions 2020-04-18 10:11:55 +02:00
poll.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
poll.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
pwd.cpp LibC: Fix strncpy() overflow in /etc/passwd parsing 2020-04-13 12:27:05 +02:00
pwd.h LibC: Implement putpwent() 2020-02-02 10:58:45 +01:00
qsort.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
scanf.cpp LibC: Some build fixes for strange platforms 2019-09-29 21:02:13 +02:00
sched.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
sched.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
serenity.cpp Kernel: Add sys$get_stack_bounds() for finding the stack base & size 2020-03-16 19:06:33 +01:00
serenity.h Kernel: Add sys$get_stack_bounds() for finding the stack base & size 2020-03-16 19:06:33 +01:00
setjmp.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
setjmp.S Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
signal.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
signal.h Kernel+LibC: Add some Unix signal types & definitions 2020-02-05 18:14:37 +01:00
signal_numbers.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
stat.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
stdarg.h Kernel: Absorb LibBareMetal back into the kernel 2020-05-16 12:00:04 +02:00
stdbool.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
stddef.h LibC: Move ssize_t from <stddef.h> to <sys/types.h> 2020-05-23 17:03:41 +02:00
stdint.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
stdio.cpp Kernel+LibC: Fix various build issues introduced by ssize_t 2020-05-23 15:27:33 +02:00
stdio.h Kernel+LibC: Fix various build issues introduced by ssize_t 2020-05-23 15:27:33 +02:00
stdlib.cpp LibC: Ensure abort() doesn't return 2020-05-26 14:35:10 +02:00
stdlib.h LibC: Add posix_openpt(), grantpt() and unlockpt() 2020-02-05 21:17:41 +01:00
string.cpp LibC: Implement strchrnul() 2020-02-22 21:36:54 +01:00
string.h LibC: Implement strchrnul() 2020-02-22 21:36:54 +01:00
strings.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
strings.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
syslog.cpp AK: Add a forward declaration header 2020-02-14 23:31:18 +01:00
syslog.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
termcap.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
termcap.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
termios.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
termios.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
time.cpp Kernel: Remove now-unused KernelInfoPage.h 2020-05-16 11:34:54 +02:00
time.h LibC: Add new syscall to allow changing the system date 2020-03-19 15:48:00 +01:00
times.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
ulimit.cpp LibC: Log calls to getrusage 2020-05-07 23:32:11 +02:00
ulimit.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
unistd.cpp Kernel+LibC: Switch isatty() to use a fcntl() 2020-05-20 08:31:31 +02:00
unistd.h LibC: Mark _exit() as noreturn 2020-05-26 14:35:10 +02:00
utime.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
utime.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
utmp.h LibC: Add missing <sys/time.h> include in <utmp.h> 2020-05-11 09:50:42 +02:00
utsname.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
wchar.cpp Meta: Add license header to source files 2020-01-18 09:45:54 +01:00
wchar.h Meta: Add license header to source files 2020-01-18 09:45:54 +01:00