diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2010-12-16 13:55:13 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2010-12-16 13:55:31 -0800 |
commit | 1b31ce6982a9151d9dfe2ea3595ad7595cb9ca86 (patch) | |
tree | 0ebd35c612f0e4c1d28b6d3ec25909535477b593 /NEWS | |
parent | f3c584d1e08646704cb46f4e5b6afc4afef3f70a (diff) | |
download | coreutils-1b31ce6982a9151d9dfe2ea3595ad7595cb9ca86.tar.xz |
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.
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -21,7 +21,8 @@ GNU coreutils NEWS -*- outline -*- sort with at least two threads no longer segfaults due to use of pointers into the stack of an expired thread. [bug introduced in coreutils-8.6] - sort --compress no longer mishandles subprocesses' exit statuses. + sort --compress no longer mishandles subprocesses' exit statuses, + and no longer hangs indefinitely due to a bug in waiting for subprocesses. sort -m -o f f ... f no longer dumps core when file descriptors are limited. |