1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 14:32:42 +01:00
nix/src
Félix Baylac Jacqué fabf4a55c3 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:09 +00: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:40:21 +01:00
internal-api-docs Format .nix files 2025-01-24 20:40:21 +01:00
libcmd {libexpr,libcmd}: Make debugger significantly faster 2025-03-14 13:22:45 +00:00
libexpr stack overflow is EvalBaseError 2025-03-21 14:12:36 +00:00
libexpr-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libexpr-test-support Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libexpr-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libfetchers libfetchers: fix double quote in path printed in logger 2025-03-19 22:24:28 +00:00
libfetchers-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libflake Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libflake-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libflake-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libmain Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libmain-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libstore Fix macos sandbox issue 2025-03-19 20:21:40 +00:00
libstore-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libstore-test-support Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libstore-tests Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libutil MonitorFdHup: replace pthread_cancel trick with a notification pipe 2025-03-23 23:54:09 +00:00
libutil-c Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libutil-test-support Write just ./.version on all components 2025-02-19 01:04:04 +01:00
libutil-tests MonitorFdHup: replace pthread_cancel trick with a notification pipe 2025-03-23 23:54:09 +00:00
nix port crash-handler from lix to nix 2025-03-21 15:30:03 +00:00
nix-build Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-channel Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-collect-garbage Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-copy-closure Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-env Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-instantiate Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
nix-store Move code related to NIX_MAN_DIR from libstore to nix-cli 2025-02-18 14:37:28 +00:00
perl Fix perl store bindings 2025-02-21 14:47:37 +00: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