7 Bug-Reported-by: scorp.dev.null@gmail.com
8 Bug-Reference-ID: <E1WxXw8-0007iE-Bi@pcm14>
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html
13 Using nested pipelines within loops with the `lastpipe' option set can result
14 in a segmentation fault.
16 Patch (apply with `patch -p0'):
20 @@ -2413,7 +2413,16 @@ execute_pipeline (command, asynchronous,
22 lstdin = wait_for (lastpid);
23 #if defined (JOB_CONTROL)
24 - exec_result = job_exit_status (lastpipe_jid);
25 + /* If wait_for removes the job from the jobs table, use result of last
26 + command as pipeline's exit status as usual. The jobs list can get
27 + frozen and unfrozen at inconvenient times if there are multiple pipelines
28 + running simultaneously. */
29 + if (INVALID_JOB (lastpipe_jid) == 0)
30 + exec_result = job_exit_status (lastpipe_jid);
31 + else if (pipefail_opt)
32 + exec_result = exec_result | lstdin; /* XXX */
33 + /* otherwise we use exec_result */
36 unfreeze_jobs_list ();
41 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
42 looks for to find the patch level (for the sccs version string). */
44 -#define PATCHLEVEL 21
45 +#define PATCHLEVEL 22
47 #endif /* _PATCHLEVEL_H_ */