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 …
@mfukar @whitequark @jfbastien @johnregehr Yes, arm is missing a proper a_crash. What's the right guaranteed-undefined instruction to use?
-
-
@RichFelker@mfukar@whitequark@johnregehr you want UDF #65006 in ARM and Thumb, most OSes translate that to SIGTRAP. -
@jfbastien@RichFelker or just __builtin_trap() -
@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! - 2 more replies
New conversation -
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.