Closed Creteil closed 1 year ago
Does this happen every time or randomly? Can you reprproduce with -v 3? Don't worry if you can't, I think I need to rig up some kind of torture test for AsyncTask to find a race condition somewhere. Needless to say I'm not seeing this, with the same command line, including sudo, though on 22.10. But I think AsyncTask is still not water tight.
Though I think it's just a cosmetic error at this point. IE, the child thread ran, did it's job, and the parent thread collected the results, and the data was all correct. Your output looks normal aside from the warning (ie, nothing missing, unless you have other kernels installed), merely the runtime environment is complaining that the code tried to do something that was already done.
Actually while writng this I think I have an idea for something to do in AsyncTask that might catch this.
I think I figured it out, and it's something I added recently. Trying to be extra robust actually was wrong, I added an extra way to detect the end of the process because I felt the original way of "when reading stdout fails" was not 100% certain, and now I understand a note in the manual.
I added this after spawn_async_with_pipes() :
ChildWatch.add(child_pid, (pid, status) => {
Process.close_pid(pid);
is_running = false;
});
and the manual for ChildWatch says
If you obtain pid from spawn_async or spawn_async_with_pipes you will need to pass g_spawn_do_not_reap_child as flag to the spawn function for the child watching to work.
and I indeed do not have that flag on the spawn_async_with_pipes() call.
So I should either add that flag, or remove the pid watch.
I have only see your fix right now...
Checked it and it work without anymore « GLib-WARNING »... 👍