musl's strlen() is a work of art except for the hopefully-harmless UB http://git.musl-libc.org/cgit/musl/tree/src/string/strlen.c …
@whitequark @jfbastien musl doesn't use __builtin_trap because some compilers lack it, and some compilers/archs make it a call to abort().
-
-
@whitequark@jfbastien Anything but an inline fault-generating instruction is unsafe because GOT, vdso syscall ptr, etc. may be corrupted. -
@whitequark@jfbastien Alternatively we could do 3 inline syscalls to: 1. block all signals, 2. getpid, 3. kill -9 self. -
@RichFelker@jfbastien -KILL? maybe -TRAP. but yeah -
@whitequark@jfbastien Being non-catchable is desirable here. If state is corrupted, any further execution is dangerous. -
@whitequark@jfbastien This is a major bug in gcc/glibc __stack_chk_fail, etc. - the handler can actually turn over code execution! -
@RichFelker@whitequark I asked a glibc maintainer about this, it sounds like that's a design philosophy difference :-) -
@jfbastien@whitequark Keep in mind, on x86, the vdso syscall pointer is in the TCB, which is just above the stack on non-main threads...
End of conversation
New conversation -
-
-
@RichFelker@whitequark wait, which ARM compiler are you worried about that lacks __builtin_trap or a sensible implementation of it? -
@bmastenbrook@whitequark musl's compiler requirements are pretty minimal. PCC and cparser/firm are known to work, other newcomers may too. -
@RichFelker@whitequark firm does not support ARM last I saw, and the pcc ARM backend looks like it might not even work
End of conversation
New conversation -
-
-
@RichFelker@jfbastien is the latter a problem?Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.