[libc-commits] [PATCH] D74949: [libc] Create abort and _Exit
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Fri Feb 28 16:16:21 PST 2020
sivachandra added inline comments.
================
Comment at: libc/spec/stdc.td:175-176
+ [
+ FunctionSpec<"abort", RetValSpec<VoidType>, [ArgSpec<VoidType>]>,
+ FunctionSpec<"_Exit", RetValSpec<VoidType>, [ArgSpec<IntType>]>,
+ ]
----------------
abrachet wrote:
> These should both be `_Noreturn` or `__attribute__((noreturn))` I'm not sure how best to express this. Should I add a `noreturn` macro to include/__llvm_libc_common.h? Then how would I express this in stdc.td?
Will this help: https://reviews.llvm.org/D75393
================
Comment at: libc/src/stdlib/abort.cpp:19
+ __llvm_libc::raise(SIGABRT);
+ __llvm_libc::raise(SIGKILL);
+ __llvm_libc::_Exit(127);
----------------
abrachet wrote:
> MaskRay wrote:
> > If there is a signal handler for SIGABRT, the code should try blocking the signal. Since signals are not available, this is fine.
> I have added the above TODO. Maybe it is wrong as I think more about it though, maybe `sigprocmask` is a better choice to remove the signal handler.
>
> I think there also needs to be some kind of lock once we start playing with signal handlers. WDYT?
Yeah. Please add a big TODO comment explaining what you intend to do in follow-up patches. To get it right, I agree with you that we will need a lock (or multiple locks). So, once the mutex patch lands, we can get back to finishing this.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74949/new/
https://reviews.llvm.org/D74949
More information about the libc-commits
mailing list