bkw777 / mainline

Install mainline kernel packages from kernel.ubuntu.com
GNU General Public License v3.0
1.04k stars 72 forks source link

Latest commit (1.3.12-23-gd8fb007) usage show « GLib-WARNING » ... #273

Closed Creteil closed 1 year ago

Creteil commented 1 year ago
bigbob@bigbob-ux331un:~$ sudo mainline --install-latest
mainline 1.3.21
Distribution: Ubuntu 22.04.2 LTS
Architecture: amd64
Running kernel: 6.4.0-060400-generic
Updating from: 'https://kernel.ubuntu.com/~kernel-ppa/mainline/'
Fetching individual kernel indexes...

(process:11960): GLib-WARNING **: 22:03:42.018: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). See the documentation of g_child_watch_source_new() for possible causes.
Found installed: linux-image-unsigned-6.4.0-060400-generic (running)  
No updates
mainline: done
bigbob@bigbob-ux331un:~$
bkw777 commented 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.

bkw777 commented 1 year ago

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.

Creteil commented 1 year ago

I have only see your fix right now...

Checked it and it work without anymore « GLib-WARNING »... 👍