1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 05:26:02 +01:00
nix/src/libutil/unix
Félix Baylac Jacqué 1c636284a3 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.
2025-03-23 18:34:52 -04:00
..
environment-variables.cc Factor out lookupExecutable and other PATH improvments 2024-08-07 18:12:58 -04:00
file-descriptor.cc libutil/file-descriptor: handle EAGAIN in read/write operations 2025-03-19 22:02:18 +01:00
file-path.cc Factor out lookupExecutable and other PATH improvments 2024-08-07 18:12:58 -04:00
file-system.cc Build the local store on Windows 2024-05-10 13:05:23 -04:00
meson.build Make sure we have an execvpe on Windows too 2024-08-26 15:45:55 -04:00
monitor-fd.hh MonitorFdHup: replace pthread_cancel trick with a notification pipe 2025-03-23 18:34:52 -04:00
muxable-pipe.cc More work on the scheduler for windows 2024-05-28 11:39:49 -04:00
os-string.cc Factor out lookupExecutable and other PATH improvments 2024-08-07 18:12:58 -04:00
processes.cc refactor: RAII logger suspension 2025-03-04 19:48:22 +01:00
signals-impl.hh fix missing includes in various headers 2024-12-17 22:00:34 +01:00
signals.cc Split ignoreException for destructors or interrupt-safe 2024-09-30 11:50:25 +02:00
users.cc More support for std::filepath in libnixutil 2024-08-26 17:23:56 -04:00