Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Fwd (potential regression in 5.0.3): Bug#732726: zsh function freeze



On Dec 21,  1:12am, Vincent Lefevre wrote:
} Subject: Re: Fwd (potential regression in 5.0.3): Bug#732726: zsh function
}
} A better example:
} 
} foo() { printf "%d\n" {1..20000} }

Actually the "ls -R /" example was better because it ruled out problems
with SIGPIPE handling and the "print" builtin.

This has to be result of either

+       * 31549: Src/exec,c, Src/zsh.h: replace ad-hoc subsh_close file
+       descriptor for pipes with new addfilelist() job-based mechanism.

(which is the tail of a whole thread starting with 31528) or else it's

+       * 31919: Src/exec.c, Src/init.c: fix deadlock when a shell builtin
+       with a multio redirection is used on the left side of a pipeline,
+       by making sure stdin/out/err file descriptors are closed for the
+       multio copy process, which means not re-using those descriptors
+       after they are closed and marked FDT_UNUSED in fdtable[].  For
+       completeness, initialize their fdtable[] state to FDT_EXTERNAL.

because the problem is that the parent shell still holds open the file
descriptor that is the standard output of the shell function, so the
write is blocked rather than getting SIGPIPE or other failure.



Messages sorted by: Reverse Date, Date, Thread, Author