Paul Eggert
1b31ce6982
sort: fix hang with sort --compress
...
* NEWS: Document this.
* src/sort.c (UNCOMPRESSED, UNREAPED, REAPED): New constants.
(struct tempnode): New member 'state', to hold these constants.
The pid member is now undefined if state == UNCOMPRESSED.
(struct sortfile): Replace member 'pid' with member 'temp'.
(uintptr): Remove.
(proctab_hasher, proctab_comparator, register_proc, delete_proc):
Proctab entries are now struct tempnode *, not pid_t, to handle
the case where multiple tempnode objects correspond to the same
pid. This avoids a race condition that can cause a hang.
(register_proc): Arg is now struct tempnode *, not pid_t. All
callers changed.
(delete_proc): Set tempnode state to REAPED.
(create_temp_file): No need to set pid member here; it's now
done when the pid is known.
(maybe_create_temp, create_temp): Remove PPID arg. Return struct
tempnode *, not char *. All callers changed.
(maybe_create_temp): Set node state to UNCOMPRESSED or UNREAPED.
No need to set node->pid to 0.
(open_temp): Replace NAME and PID args with a single TEMP arg.
All callers changed. Wait only for unreaped children.
(zaptemp): Wait for decompressor to finish before removing its
temporary-file input. This avoids .nfsXXXX hassles with NFS
and fixes a race (leading to a hang) regardless of NFS.
(open_input_files): Adjust to new way of dealing with temp files
and their subprocesses.
* tests/Makefile.am (TESTS): Add misc/sort-compress-hang.
* tests/misc/sort-compress-hang: New file.
2010-12-16 13:55:31 -08:00
..
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:46:25 +01:00
2010-01-01 14:06:47 +01:00
2010-02-25 08:54:49 -07:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-05-26 11:33:53 +02:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-09-07 10:49:55 +01:00
2010-10-14 09:23:51 +02:00
2010-11-17 21:45:51 +01:00
2010-10-19 09:35:44 +02:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-05-23 18:10:41 +02:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-18 09:51:04 -08:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-12-11 18:44:57 +01:00
2010-11-17 21:46:22 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:46:22 +01:00
2010-11-17 21:46:22 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:46:22 +01:00
2010-11-17 21:46:22 +01:00
2010-11-17 21:46:25 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:46:57 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-08-13 15:57:52 -07:00
2010-11-17 21:45:51 +01:00
2010-12-14 10:08:04 -08:00
2010-12-16 13:55:31 -08:00
2010-12-14 10:08:04 -08:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-05-31 10:59:11 +02:00
2010-12-16 00:04:32 -08:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-12-04 11:52:21 +01:00
2010-12-13 10:02:43 -08:00
2010-11-17 21:45:51 +01:00
2010-12-01 08:15:42 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-22 01:45:15 +00:00
2010-11-22 01:45:15 +00:00
2010-11-22 01:45:15 +00:00
2010-12-08 23:36:17 +00:00
2010-11-22 01:45:15 +00:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:46:25 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-08-28 19:28:20 +02:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-05-31 10:59:11 +02:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-09-29 11:05:12 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-01-01 14:06:47 +01:00
2010-05-31 10:59:11 +02:00
2010-05-31 10:59:11 +02:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-01-01 14:06:47 +01:00
2010-11-17 21:45:51 +01:00
2010-11-17 21:46:25 +01:00
2010-01-01 14:06:47 +01:00