Properly watch the child process state
@bigon
Submitted by Laurent Bigonville Assigned to Brasero maintainer(s)
Link to original bug (#737888)
Description
Created attachment 287715 child-waiting-error-handling.patch
Hi,
This bug has been reported on the Debian BTS: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=681694
====8<==== Dear Maintainer,
Please consider answering these questions, where appropriate ***
In libbrasero-burn/burn-process.c:brasero_process_watch_child (gpointer data)
waitpid() could have returned positive value (child's pid) due to the child's change of state, e.g. child being signalled for any (obscure) reason (SIGPIPE, SIGSTOP, etc), and also child's exit status is being blindly "examined" by flat WEXITSTATUS(status), instead of first checking WIFEXITED(status) for returning true, i.e. that the child has actually exited.
This could lead to unnoticed problem with the child process state. For instance, I think the log message [1] of "process finished with status 0" could be pretty much bogus in this particular case shown in the log with a burn failure halfway around ~49-50%. (see the tail of waitpid(2) for a good example of a diligent parent waiting for their possibly naughty child)
[1] https://launchpadlibrarian.net/71440716/brasero_log.txt ====8<====
Patch 287715, "child-waiting-error-handling.patch":
child-waiting-error-handling.patch
Version: git master