GNOME Bugzilla – Bug 607531
Execute system() calls in subshells to ease debugging
Last modified: 2010-01-27 08:30:05 UTC
Hi, gtkdoc-scanobj already executes one command in a subshell so that if it fails, we can still see the errors. It doesn't for other commands though (like the compiler or the linker). The attached patch from Loïc Minier executes all commands in a subshell. * New patch, 50_shell-errors, causes all system() calls to spawn a subshell which should help diagnose crashes of commands such as ICE or scanner segfaults.
Created attachment 151819 [details] [review] Execute all commands in subshells Patch from Loïc Minier to execute all commands in subshells.
That looks good. One question - are subshells used like this supported by plain sh as well?
dash, which is POSIX plus only a few extensions, says: Grouping Commands Together Commands may be grouped by writing either (list) or { list; } The first of these executes the commands in a subshell. Builtin commands grouped into a (list) will not affect the current shell. [...] So I'd say yes.
ommit b37791867f938d9ab5ce5d3db63d7115981deb7a Author: Loïc Minier <lool@dooz.org> Date: Fri Jan 22 16:06:41 2010 +0200 scanobj/gobj: Execute system() calls in subshells, Fixes #607531 the tools already execute one command in a subshell so that if it fails, we can still see the errors. It doesn't for other commands though (like the compiler or the linker).
Reverted part of the patch. The next time, I'd appreciate if you would actualy try to build something before submitting the patch.
(In reply to comment #5) > Reverted part of the patch. The next time, I'd appreciate if you would actualy > try to build something before submitting the patch. That patch has been in Debian since April 2007. I guess nothing in Debian sets $RUN in the environment...