Bug 981580

Summary: Glib regression related to SIGCHLD warnings
Product: [Fedora] Fedora Reporter: Renich Bon Ciric <renich>
Component: glib2Assignee: Matthias Clasen <mclasen>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: alex.ploumistos, bugzilla.redhat.com, mark.harfouche, mcatanzaro+wrong-account-do-not-cc, mclasen, robert, stefw, tiagomatos, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1092044 (view as bug list) Environment:
Last Closed: 2015-02-17 15:51:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1092044, 1093123, 1093125    
Attachments:
Description Flags
strace log of 'seahorse-tool --encrypt /path/to/file' none

Description Renich Bon Ciric 2013-07-05 07:54:05 UTC
Description of problem:
seahorse-tool is not working.

Version-Release number of selected component (if applicable):
seahorse-nautilus-3.8.0-1.fc19.x86_64

How reproducible:
Just try installing it and encrypting some text file.

Actual results:
seahorse-tool -e test.txt 

** (seahorse-tool:19339): WARNING **: couldn't load all the keys (1/2) from GPGME

(seahorse-tool:19339): GLib-WARNING **: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). Most likely the process is ignoring SIGCHLD, or some other thread is invoking waitpid() with a nonpositive first argument; either behavior can break applications that use g_child_watch_add()/g_spawn_sync() either directly or indirectly.


Expected results:
it should just work

Additional info:

Comment 1 Stef Walter 2013-07-24 15:38:00 UTC
This is a regression in glib.

Comment 2 Stef Walter 2013-07-24 15:39:10 UTC
*** Bug 987556 has been marked as a duplicate of this bug. ***

Comment 3 Rui Matos 2013-08-15 14:04:43 UTC
*** Bug 991029 has been marked as a duplicate of this bug. ***

Comment 4 Stef Walter 2013-08-16 13:56:50 UTC
This bug is caused by this commit from Colin: 
https://git.gnome.org/browse/glib/commit/?id=ce0022933c255313e010b27f977f4ae02aad1e7e

This commit was partially reverted by Ryan: https://git.gnome.org/browse/glib/commit/?id=eb860fd898a6a2bd86c11d245294cd0e8cd4304b

Comment 5 Colin Walters 2013-08-16 14:08:58 UTC
Do note that while we'll likely keep the GLib behavior as it is now, I consider it a very bad idea to install a SIGCHLD handler in an application that links to glib, and such code should be fixed.

Comment 6 Stef Walter 2013-08-16 14:42:47 UTC
Bad idea or not this is an big ABI break in glib.

In addition it's completely bogus to have glib expect to be the only one to install a SIGCHLD handler. It gets linked with all sorts of libraries, any of which could imagine itself in exactly the same position "I should be the only one to install a SIGCHLD handler".

Besides that, it's not application code that is installing such a handler. It's one of the libraries, likely gpgme or one of it's deps. 

Lastly, I'm attaching an strace log, it looks like the there is no other SIGCHLD handler being installed. This is the only 'rt_sigaction(SIGCHLD' line:

rt_sigaction(SIGCHLD, {0x3dbf444c60, [], SA_RESTORER|SA_RESTART|SA_NOCLDSTOP, 0x3dbcc0efa0}, NULL, 8) = 0

And this memory is part of the libglib so:

3dbf400000-3dbf52a000 r-xp 00000000 08:01 1727858                        /usr/lib64/libglib-2.0.so.0.3600.3

So it would appear that no other library installing a handler, and glib is falling over anyway. I may be mistaken here, so please do feel free to do investigation on your own. Either using the attached log or running seahorse-tool on your own:

$ yum install seahorse-nautilus
$ seahorse-tool --encrypt ~/.bashrc

Comment 7 Stef Walter 2013-08-16 14:45:42 UTC
Created attachment 787297 [details]
strace log of 'seahorse-tool --encrypt /path/to/file'

Comment 8 Colin Walters 2013-08-16 15:05:48 UTC
(In reply to Stef Walter from comment #6)
> Bad idea or not this is an big ABI break in glib.

It's been reverted.

> In addition it's completely bogus to have glib expect to be the only one to
> install a SIGCHLD handler. It gets linked with all sorts of libraries, any
> of which could imagine itself in exactly the same position "I should be the
> only one to install a SIGCHLD handler".

Of course, it sucks.  Signal handlers have always sucked.  We're still waiting for 
http://www.macieira.org/blog/2012/07/forkfd-part-1-launching-processes-on-unix/
or something like it.

Until that, there's nothing we can do better in GLib.  (Ok, we could spawn a thread per child process dedicated to blocking in waitpid(), but...).

That said, I definitely am not going to hide that GLib should be at the technological center of the OS =)

> Besides that, it's not application code that is installing such a handler.
> It's one of the libraries, likely gpgme or one of it's deps. 
... 
> $ yum install seahorse-nautilus
> $ seahorse-tool --encrypt ~/.bashrc

Investigating.

Comment 9 Stef Walter 2013-08-16 15:25:58 UTC
(In reply to Colin Walters from comment #8)
> (In reply to Stef Walter from comment #6)
> > Bad idea or not this is an big ABI break in glib.
> 
> It's been reverted.

But is it reverted in Fedora 19 and/or RHEL 7? Should it be? Here's what I see for Ryan's patch:

[stef@stef glib]$ git tag --contains eb860fd898a6a2bd86c11d245294cd0e8cd4304b
2.37.0
2.37.1
2.37.2
2.37.3
2.37.4
2.37.5

> > In addition it's completely bogus to have glib expect to be the only one to
> > install a SIGCHLD handler. It gets linked with all sorts of libraries, any
> > of which could imagine itself in exactly the same position "I should be the
> > only one to install a SIGCHLD handler".
> 
> Of course, it sucks.  Signal handlers have always sucked.  We're still
> waiting for 
> http://www.macieira.org/blog/2012/07/forkfd-part-1-launching-processes-on-
> unix/
> or something like it.
> 
> Until that, there's nothing we can do better in GLib.  (Ok, we could spawn a
> thread per child process dedicated to blocking in waitpid(), but...).
> 
> That said, I definitely am not going to hide that GLib should be at the
> technological center of the OS =)

Heh heh :)

Comment 10 Colin Walters 2013-08-16 16:57:12 UTC
This turned out to be a bug in seahorse-nautilus, it needs to specify G_SPAWN_DO_NOT_REAP_CHILD.

Comment 11 Colin Walters 2013-08-16 17:02:56 UTC
So...while the commit to silence this warning is in GLib 2.36.4, I personally don't like doing stable updates for things like this since we don't have useful testing mechanisms.

If there are more affected applications and/or the issue was something more than just a warning, I'd reconsider.

Comment 12 Stef Walter 2013-08-16 17:04:28 UTC
Although a warning was printed, both seahorse-nautilus and pidgin actually broke due to this. It wasn't just a warning.

Comment 13 Michael Catanzaro 2013-11-23 15:41:04 UTC
seahorse-nautilus is still broken in F19, can we please get an update?

Comment 14 Fedora End Of Life 2015-01-09 18:40:56 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Fedora End Of Life 2015-02-17 15:51:58 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.