mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-08 23:59:02 -05:00
don't use sigaltstack() with USE_ASAN #2529
This commit is contained in:
parent
59eb7dd18b
commit
27b5d38ea1
@ -428,13 +428,6 @@ If things break or seem otherwise lackluster, **please** consult the
|
||||
handy if you've got a reference to a valid <code>nccell</code> anyway.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>I compiled with AddressSanitizer, and ASAN throws an exception on
|
||||
program exit.</summary>
|
||||
Yeah, I think it has something to do with our signal handling, don't know
|
||||
yet, sorry.
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>I ran my Notcurses program under <code>valgrind</code>/ASAN, and
|
||||
it shows memory leaks from <code>libtinfo.so</code>, what's up with that?</summary>
|
||||
|
@ -205,6 +205,10 @@ int setup_signals(void* vnc, bool no_quit_sigs, bool no_winch_sigs,
|
||||
handling_winch = true;
|
||||
}
|
||||
if(!no_quit_sigs){
|
||||
// AddressSanitizer doesn't want us to use sigaltstack(). we could force everyone
|
||||
// to export ASAN_OPTIONS=use_sigaltstack=0, or just not fuck with the alternate
|
||||
// signal stack when built with ASAN.
|
||||
#ifndef USE_ASAN
|
||||
alt_signal_stack.ss_sp = malloc(alt_signal_stack.ss_size);
|
||||
if(alt_signal_stack.ss_sp == NULL){
|
||||
fprintf(stderr, "warning: couldn't create alternate signal stack (%s)" NL, strerror(errno));
|
||||
@ -217,6 +221,7 @@ int setup_signals(void* vnc, bool no_quit_sigs, bool no_winch_sigs,
|
||||
alt_signal_stack.ss_sp = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
fatal_callback = handler;
|
||||
sa.sa_sigaction = fatal_handler;
|
||||
|
@ -1,5 +1,10 @@
|
||||
// Populated by CMake; not installed
|
||||
|
||||
// if we're a DFSG build, we leave out references to certain demos
|
||||
#cmakedefine DFSG_BUILD
|
||||
|
||||
// if we're an ASAN build, we don't use sigaltstack() ourselves
|
||||
#cmakedefine USE_ASAN
|
||||
#cmakedefine USE_DEFLATE
|
||||
#cmakedefine USE_GPM
|
||||
#cmakedefine USE_QRCODEGEN
|
||||
|
Loading…
x
Reference in New Issue
Block a user