1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-10 04:43:53 +02:00
nix/src/libutil-tests
Félix Baylac Jacqué ea19cb2f50 MonitorFdHup: replace pthread_cancel trick with a notification pipe
On https://github.com/NixOS/nix/issues/8946, we faced a surprising
behaviour wrt. exception when using pthread_cancel. In a nutshell when
a thread is inside a catch block and it's getting pthread_cancel by
another one, then the original exception is bubbled up and crashes the
process.

We now poll on the notification pipe from the thread and exit when the
main thread closes its end. This solution does not exhibit surprising
behaviour wrt. exceptions.

Co-authored-by: Mic92 <joerg@thalheim.io>

Fixes https://github.com/NixOS/nix/issues/8946

See also Lix https://gerrit.lix.systems/c/lix/+/1605 which is very
similar by coincidence. Pulled a comment from that.

(cherry picked from commit 1c636284a3)
2025-03-23 23:54:10 +00:00
..
data/git Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
.version Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
args.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
canon-path.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
checked-arithmetic.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
chunked-vector.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
closure.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
compression.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
config.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
executable-path.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
file-content-address.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
file-system.cc makeParentCanonical: test case where parent is empty 2025-01-07 05:42:04 +00:00
git.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
hash.cc Add BLAKE3 hashing algorithm 2025-02-05 17:49:15 -07:00
hilite.cc fix(treewide): remove unnecessary copying in range for loops 2024-11-26 00:06:29 +03:00
json-utils.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
logging.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
lru-cache.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
meson.build packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
monitorfdhup.cc MonitorFdHup: replace pthread_cancel trick with a notification pipe 2025-03-23 23:54:10 +00:00
nix-meson-build-support rename: build-utils-meson -> nix-meson-build-support 2024-12-09 16:54:42 +01:00
nix_api_util.cc chore: get rid of dead code and unused variables where appropriate 2024-11-22 18:05:53 +03:00
package.nix Write just ./.version on all components 2025-02-18 11:41:35 +01:00
pool.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
position.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
processes.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
references.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
spawn.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
strings.cc Implement shellSplitString for proper handling of NIX_SSHOPTS with spaces and quotes 2024-12-14 15:54:16 +00:00
suggestions.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
terminal.cc try to calculate character width 2024-12-28 12:01:32 +01:00
url.cc ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
util.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00
xml-writer.cc Move unit tests to the location Meson expects them to be 2024-10-17 15:42:16 -04:00