Bug 654027 - GLib-WARNING when emacs ran as root.
Summary: GLib-WARNING when emacs ran as root.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: glib2
Version: 14
Hardware: x86_64
OS: Linux
low
low
Target Milestone: ---
Assignee: Matthias Clasen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 708012 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-16 16:49 UTC by NM
Modified: 2012-08-16 19:17 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-16 19:17:14 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 676167 0 None None None Never

Description NM 2010-11-16 16:49:26 UTC
1) As root from command prompt open 'test' file with emacs:     emacs test
2) Observe warnings:

(emacs:4994): GLib-WARNING **: In call to g_spawn_sync(), exit status of a child process was requested but SIGCHLD action was set to SIG_IGN and ECHILD was received by waitpid(), so exit status can't be returned. This is a bug in the program calling g_spawn_sync(); either don't request the exit status, or don't set the SIGCHLD action.
GConf Error: Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See http://projects.gnome.org/gconf/ for information. (Details -  1: Failed to get connection to session: Abnormal program termination spawning command line `dbus-launch --autolaunch=1ad94a059341377eb2746e4f00000013 --binary-syntax --close-stderr': )

3) This is not happening without test file i.e. just:      emacs
4) This is not happening for non-root users too. 

Thanks
NM

Comment 1 Karel Klíč 2010-11-24 16:12:05 UTC
I observed slightly different behaviour -- and pretty much the same on F-14 and Rawhide. If the dbus per-user daemon is not running for the root user, the GLib-WARNING and GConf Error messages are displayed, and the daemon is started. Next time, no messages are displayed, because the daemon is already running. If I kill the daemon and its launcher, the messages appear next time again. It does not matter if a 'test' file is provided as a parameter or not on my machine.

$ su -

$ ps aux | grep dbus
dbus       946  0.1  0.1  13140  2020 ?        Ssl  10:41   0:00 dbus-daemon --system
karel     1616  0.0  0.0   3784   528 ?        S    10:41   0:00 dbus-launch --sh-syntax --exit-with-session
karel     1617  0.0  0.1  12748  1904 ?        Ssl  10:41   0:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

$ emacs
(emacs:14996): GLib-WARNING **: In call to g_spawn_sync(), exit status of a
child process was requested but SIGCHLD action was set to SIG_IGN and ECHILD
was received by waitpid(), so exit status can't be returned. This is a bug in
the program calling g_spawn_sync(); either don't request the exit status, or
don't set the SIGCHLD action.
GConf Error: Failed to contact configuration server; some possible causes are
that you need to enable TCP/IP networking for ORBit, or you have stale NFS
locks due to a system crash. See http://projects.gnome.org/gconf/ for
information. (Details -  1: Failed to get connection to session: Abnormal
program termination spawning command line `dbus-launch
--autolaunch=1ad94a059341377eb2746e4f00000013 --binary-syntax --close-stderr':
)

$ ps aux | grep dbus
dbus       946  0.1  0.1  13140  2020 ?        Ssl  10:41   0:00 dbus-daemon --system
karel     1616  0.0  0.0   3784   528 ?        S    10:41   0:00 dbus-launch --sh-syntax --exit-with-session
karel     1617  0.0  0.1  12748  1904 ?        Ssl  10:41   0:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
root      2146  0.0  0.0   3784   532 pts/0    S    10:44   0:00 dbus-launch --autolaunch=0e3518e1b6675f2f3f1d1b1900000011 --binary-syntax --close-stderr
root      2147  0.0  0.1  11240  1056 ?        Ssl  10:44   0:00 /bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

$ emacs
(no warnings)

$ kill -9 2146 2147

$ emacs
(Warnings displayed here again)


If you kill the user daemon and then within 2 seconds start emacs, you can see another GConf error: Failed to get connection to session: Error connecting: Connection refused.

Comment 2 Karel Klíč 2010-11-24 16:42:11 UTC
Here is the backtrace of calling g_spawn_sync function, which display one of the warnings (on Rawhide).

[root@localhost ~]# gdb emacs
(gdb) break g_spawn_sync
(gdb) run
Breakpoint 1, g_spawn_sync (working_directory=0x0, argv=0x85c61e8, envp=0x0, 
    flags=G_SPAWN_SEARCH_PATH, child_setup=0, user_data=0x0, standard_output=
    0xbfffe29c, standard_error=0xbfffe298, exit_status=0xbfffe294, error=
    0xbfffe31c) at gspawn.c:248
(gdb) bt
#0  g_spawn_sync (working_directory=0x0, argv=0x85c61e8, envp=0x0, flags=
    G_SPAWN_SEARCH_PATH, child_setup=0, user_data=0x0, standard_output=
    0xbfffe29c, standard_error=0xbfffe298, exit_status=0xbfffe294, error=
    0xbfffe31c) at gspawn.c:248
#1  0x4920be0d in g_spawn_command_line_sync (command_line=
    0x85c60f0 "dbus-launch --autolaunch=a5de3a2f10be527f7edea2ca0000000a --binary-syntax --close-stderr", standard_output=0xbfffe29c, standard_error=
    0xbfffe298, exit_status=0xbfffe294, error=0xbfffe31c) at gspawn.c:706
#2  0x49416a8b in get_session_address_dbus_launch (error=0xbfffe31c)
    at gdbusaddress.c:1039
#3  0x494187d1 in get_session_address_platform_specific (error=0xbfffe31c)
    at gdbusaddress.c:1136
#4  g_dbus_address_get_for_bus_sync (bus_type=G_BUS_TYPE_SESSION, cancellable=
    0x0, error=0xbfffe438) at gdbusaddress.c:1219
#5  0x49422ce9 in get_uninitialized_connection (bus_type=G_BUS_TYPE_SESSION, 
    cancellable=0x0, error=0xbfffe438) at gdbusconnection.c:6209
#6  0x4942b045 in g_bus_get_sync (bus_type=G_BUS_TYPE_SESSION, cancellable=
    0x0, error=0xbfffe438) at gdbusconnection.c:6268
#7  0x49b23268 in get_ior (failure_log=0x86a0d70, start_if_not_found=1)
    at gconf-internals.c:2454
#8  gconf_get_server (start_if_not_found=1, failure_log=0x86a0d70)
    at gconf-internals.c:2503
#9  0x49b23535 in gconf_activate_server (start_if_not_found=1, error=
    0xbfffe6b4) at gconf-internals.c:2853
#10 0x49b2e28c in try_to_contact_server (err=<value optimized out>, 
    start_if_not_found=<value optimized out>) at gconf.c:2315
#11 gconf_get_config_server (start_if_not_found=<value optimized out>, 
    err=<value optimized out>) at gconf.c:2359
#12 0x49b2ec95 in gconf_engine_connect (conf=0x853f2f8, start_if_not_found=1, 
    err=0xbfffe6b4) at gconf.c:359
#13 0x49b2eef7 in gconf_engine_get_database (conf=0x853f2f8, 
    err=<value optimized out>, start_if_not_found=1) at gconf.c:434
#14 0x49b31eeb in gconf_engine_get_fuller (conf=0x853f2f8, key=
    0x81fab58 "/desktop/gnome/interface/monospace_font_name", locale=
    0x861f5f8 "en_US.UTF-8", use_schema_default=1, is_default_p=0xbfffe6b8, 
    is_writable_p=0xbfffe6bc, schema_name_p=0xbfffe6b0, err=0xbfffe6b4)
    at gconf.c:1046
#15 0x49b322af in gconf_engine_get_entry (conf=0x853f2f8, key=
    0x81fab58 "/desktop/gnome/interface/monospace_font_name", locale=
    0x861f5f8 "en_US.UTF-8", use_schema_default=1, err=0xbfffe77c)
    at gconf.c:1163
#16 0x49b34fd7 in get (client=0x86ba368, key=
    0x81fab58 "/desktop/gnome/interface/monospace_font_name", use_default=1, 
    error=0xbfffe77c) at gconf-client.c:1348
#17 0x49b3762d in gconf_client_get_full (client=0x86ba368, 
    key=<value optimized out>, use_schema_default=1, err=0xbfffe7dc, locale=
    0x0) at gconf-client.c:1398
#18 0x49b37de9 in gconf_client_get_string (client=0x86ba368, key=
    0x81fab58 "/desktop/gnome/interface/monospace_font_name", err=0x0)
    at gconf-client.c:1597
#19 0x08109b6c in init_gconf ()
    at /usr/src/debug/emacs-23.2/src/xsettings.c:568

Comment 3 Karel Klíč 2010-11-24 17:21:04 UTC
To me it seems that GIO should take care of dealing with SIGCHLD setup as it's set by an application, instead of blindly running g_spawn_command_line_sync function. Or if there are some requirements that a caller must satisfy, these should be documented for g_bus_get_sync (I checked http://library.gnome.org/devel/gio/unstable/GDBusConnection.html and I do not see anything about SIGCHLD requirements).

Comment 4 Steve 2011-07-02 06:47:40 UTC
On Fedora 15 I see a similar problem.

I get the GLib-WARNING, but not the GConf Error.
It happens when I 'su' to root and run emacs, and also when I 'su' to a non-root user and run emacs.
I see the  GLib-WARNING the first time I start emacs, but not on the second or third startup of emacs.

The message says
"... This is a bug in the program calling g_spawn_sync() ..."
so shouldn't this bug be filed under the emacs component and not the glib2 component?

Comment 5 Karel Klíč 2011-11-24 16:50:28 UTC
*** Bug 708012 has been marked as a duplicate of this bug. ***

Comment 6 Colin Walters 2012-05-16 14:59:18 UTC
https://bugzilla.gnome.org/show_bug.cgi?id=676167

Comment 7 Fedora End Of Life 2012-08-16 19:17:17 UTC
This message is a notice that Fedora 14 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 14. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained.  At this time, all open bugs with a Fedora 'version'
of '14' have been closed as WONTFIX.

(Please note: Our normal process is to give advanced warning of this 
occurring, but we forgot to do that. A thousand apologies.)

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

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we were unable to fix it before Fedora 14 reached 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 to click on 
"Clone This Bug" (top right of this page) and open it against that 
version of Fedora.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


Note You need to log in before you can comment on or make changes to this bug.