Add a TSAN workaround and re-enable the test

This reverts commit 865602e8d1.
This commit is contained in:
ridiculousfish 2022-12-19 15:14:07 -08:00
parent 8a50d47a46
commit 5f23da9939
2 changed files with 15 additions and 6 deletions

View File

@ -117,12 +117,9 @@ jobs:
- name: make - name: make
run: | run: |
make make
# This is, once again, broken as of 2022-12-19. - name: make test
# It just hangs indefinitely. Github probably upgraded clang/Ubuntu. run: |
# Because that is unhelpful, we disable the tests once more. make test
# - name: make test
# run: |
# make test
macos: macos:

View File

@ -366,6 +366,18 @@ void signal_set_handlers(bool interactive) {
if (interactive) { if (interactive) {
set_interactive_handlers(); set_interactive_handlers();
} }
#ifdef FISH_TSAN_WORKAROUNDS
// Work around the following TSAN bug:
// The structure containing signal information for a thread is lazily allocated by TSAN.
// It is possible for the same thread to receive two allocations, if the signal handler
// races with other allocation paths (e.g. a blocking call). This results in the first signal
// being potentially dropped.
// The workaround is to send ourselves a SIGCHLD signal now, to force the allocation to happen.
// As no child is associated with this signal, it is OK if it is dropped, so long as the
// allocation happens.
(void)kill(getpid(), SIGCHLD);
#endif
} }
void signal_set_handlers_once(bool interactive) { void signal_set_handlers_once(bool interactive) {