1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-17 07:52:43 +01:00
nix/src
Félix Baylac Jacqué cf7d72c733 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-24 15:48:34 +01:00
..
build-remote build-remote: only allocate storeUri once 2024-07-25 14:04:03 +02:00
external-api-docs Format .nix files 2025-01-24 20:37:38 +01:00
internal-api-docs Format .nix files 2025-01-24 20:37:38 +01:00
libcmd Format .nix files 2025-01-24 20:37:38 +01:00
libexpr copyPathToStore(): Preserve symlinks 2025-02-11 21:51:38 +00:00
libexpr-c refactor: Extract EvalState::realiseString 2025-01-27 15:51:13 +00:00
libexpr-test-support Format .nix files 2025-01-24 20:37:38 +01:00
libexpr-tests Format .nix files 2025-01-24 20:37:38 +01:00
libfetchers Format .nix files 2025-01-24 20:37:38 +01:00
libfetchers-tests Format .nix files 2025-01-24 20:37:38 +01:00
libflake Format .nix files 2025-01-24 20:37:38 +01:00
libflake-tests Format .nix files 2025-01-24 20:37:38 +01:00
libmain Format .nix files 2025-01-24 20:37:38 +01:00
libmain-c Format .nix files 2025-01-24 20:37:38 +01:00
libstore Fix macos sandbox issue 2025-03-19 20:21:38 +00:00
libstore-c Format .nix files 2025-01-24 20:37:38 +01:00
libstore-test-support Format .nix files 2025-01-24 20:37:38 +01:00
libstore-tests Format .nix files 2025-01-24 20:37:38 +01:00
libutil MonitorFdHup: replace pthread_cancel trick with a notification pipe 2025-03-24 15:48:34 +01:00
libutil-c Format .nix files 2025-01-24 20:37:38 +01:00
libutil-test-support Format .nix files 2025-01-24 20:37:38 +01:00
libutil-tests MonitorFdHup: replace pthread_cancel trick with a notification pipe 2025-03-24 15:48:34 +01:00
nix Format .nix files 2025-01-24 20:37:38 +01:00
nix-build Fix issue 11892 2024-11-26 11:19:29 +00:00
nix-channel Format .nix files 2025-01-24 20:37:38 +01:00
nix-collect-garbage More std::filesystem for nix-collect-garbage 2024-08-26 17:29:23 -04:00
nix-copy-closure Restrict some code to StoreDirConfig 2023-11-04 19:05:36 -04:00
nix-env Format .nix files 2025-01-24 20:37:38 +01:00
nix-instantiate No global settings in libnixfetchers and libnixflake 2024-07-12 08:50:28 -04:00
nix-store fix: Resolve CLI parent symlinks before adding to store 2025-01-07 06:03:57 +00:00
perl Format .nix files 2025-01-24 20:37:38 +01:00
nix-functional-tests Build Functional tests with Meson 2024-08-14 15:35:40 -04:00
nix-manual Build the manual with Meson 2024-10-09 11:58:17 -04:00