1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-14 22:42:41 +01:00
nix/src
Dominique Martinet afac093b34 libutil: thread-pool: ensure threads finished on error
This fixes segfaults with nix copy when there was an error processing
addMultipleToStore.

Running with ASAN/TSAN pointed at an use-after-free with threads from
the pool accessing the graph declared in processGraph after the function
was exiting and destructing the variables.

It turns out that if there is an error before pool.process() is called,
for example while we are still enqueuing tasks, then pool.process()
isn't called and threads are still left to run.

By creating the pool last we ensure that it is stopped first before
running other destructors even if an exception happens early.

[ lix porting note: nix does not name threads so the patch has been
adapted to not pass thread name ]

Link: https://git.lix.systems/lix-project/lix/issues/618
Link: https://gerrit.lix.systems/c/lix/+/2355
2025-01-12 15:11:13 +09:00
..
build-remote build-remote: only allocate storeUri once 2024-07-25 14:04:03 +02:00
external-api-docs Add nix-flake-c, nix_flake_init_global, nix_flake_settings_new 2024-11-24 23:57:24 +01:00
internal-api-docs Fix most DoxyGen warnings 2024-11-12 15:34:24 +01:00
libcmd packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libexpr correctly parse strings with null bytes and throw error 2025-01-04 16:14:06 +01:00
libexpr-c packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libexpr-test-support packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libexpr-tests packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libfetchers ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
libfetchers-tests packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libflake parsePathFlakeRefWithFragment(): Handle query params in the non-git case 2025-01-09 12:17:09 +01:00
libflake-c packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libflake-tests Attempt to make the FlakeRef test succeed on macOS 2025-01-09 16:42:37 +01:00
libmain packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libmain-c packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libstore libutil: thread-pool: ensure threads finished on error 2025-01-12 15:11:13 +09:00
libstore-c packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libstore-test-support packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libstore-tests packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libutil libutil: thread-pool: ensure threads finished on error 2025-01-12 15:11:13 +09:00
libutil-c packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libutil-test-support packaging: use optimization level 3 and LTO by default 2025-01-01 21:59:37 -08:00
libutil-tests ParsedURL: Remove base field 2025-01-07 14:52:00 +01:00
nix Merge pull request #12167 from RossComputerGuy/fix/unsupported-type-docker 2025-01-11 20:44:06 +00:00
nix-build Fix issue 11892 2024-11-18 21:04:04 +01:00
nix-channel Don't use OS_STR in nix-channel.cc 2024-08-18 18:27:20 +05:30
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 Work around gcc warning 2024-11-28 15:25:51 +01:00
nix-instantiate feat(nix-instantiate): add --raw flag 2024-12-31 16:36:49 +01:00
nix-store fix: Resolve CLI parent symlinks before adding to store 2025-01-07 05:42:03 +00:00
perl src/perl/meson.build: fall back to 'bz2' library lookup 2024-11-26 18:37:53 +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