GNOME Bugzilla – Bug 344152
gdmflexiserver coredumps
Last modified: 2006-06-09 23:09:57 UTC
Steps to reproduce: gdmflexiserver --command="GET_CONFIG_FILE" Stack trace: Other information: build/gnome/gdm > gdmflexiserver --command="GET_CONFIG_FILE" Failed to connect to socket, sleep 1 second and retry Trying failed command again. Try 2 of 5. Failed to connect to socket, sleep 1 second and retry Trying failed command again. Try 3 of 5. Failed to connect to socket, sleep 1 second and retry Trying failed command again. Try 4 of 5. Failed to connect to socket, sleep 1 second and retry Trying failed command again. Try 5 of 5. Command failed 5 times, aborting. Could not access configuration key <daemon/PidFile=/var/run/gdm.pid> Using compiled in value </var/run/gdm.pid> for <daemon/PidFile=/var/run/gdm.pid> (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: gtype.c:2215: initialization assertion failed, use IA__g_type_init() prior to this function (process:21592): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed Segmentation fault (core dumped)
Could you provide a stack trace? Also, does changing the gdm_comm_check function so you pass in FALSE instead of TRUE in gui/gdmflexiserver.c fix this problem for you?
Well, using FALSE prevents the SEGV. Unfortunately there is still something wiered . Log shows beside the "cannot connect" messages something like, Jun 8 00:19:37 wh58-307 gdmlogin[15673]: Could not access configuration key <daemon/HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now> Jun 8 00:19:37 wh58-307 gdmlogin[15673]: Using compiled in value </usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now> for <daemon/HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shutdown -h now> Well, /opt/gnome2/share/gdm/defaults.conf has the entry (gdm was compiled with prefix /opt/gnome2): HaltCommand=/usr/sbin/shutdown -h now;/sbin/shutdown -h now;/usr/bin/poweroff;/sbin/poweroff So ... ? BTW: If you still need a stack trace, please let me know.
I think the SEGV is because gdmflexiserver tries to pop-up a dialog window when the failure happens and it clearly doesn't have access to the display and, for some reason, cores. The "FALSE" prevents the SEGV, but the connection failure that prompted the dialog is stil happening. I think removing the dialog is fine, since the errors get logged anyway, and users can run "gdmflexiserver --command" without needing access to a valid display. Try turning on Enable=true in the [debug] section and we can see why it is failing. It would also be useful if you could hack the code a bit. + hardcode debug_in = TRUE in the code so that gdmcomm_set_debug is passed a TRUE + Add a call to gdmflexiserver like this before the call to gdm_comm_check: gdm_common_openlog ("gdmchooser", LOG_PID, LOG_DAEMON); This will cause gdmflexiserver communication details to get sent to syslog which would be useful to see. Can you do this?
"Enable" already done (after compiling the 2.14.8) - still the same problem wrt. connection. See: http://www.linofee.org/~jel/develop/gdm/log.txt It is the cycle: 1) /etc/init.d/gdm start 2) ctrl+alt+f7 - wait, until the login panel is displayed 3) back to console and /etc/init.d/gdm stop Trying now to test with hardcode debug enabled ...
Made the hardcode changes, but the output looks not much different: See: http://www.linofee.org/~jel/develop/gdm/log.flexi2.txt The changes I made: http://www.linofee.org/~jel/develop/gdm/flexi.debug.patch
Okay, it looks like something strange is going on. the slave program is requesting a config value and it seems to be returning "server busy" message, which the client will say when it gets an empty response from the daemon. Can you put a gdm_debug() message in the code in gdm.c in the function gdm_handle_user_message in the else block where we are handling GDM_SUP_GET_CONFIG and print out the value. Also near the top of this function put a gdm_debug statement just before we print out "ERROR 200 Too many messages" and see if we are falling into that code.
Hmmm - are we talking about different source? 2.14.8 gdm.c already has those debug_messages: static void gdm_handle_user_message (GdmConnection *conn, const gchar *msg, gpointer data) { gdm_debug ("Handling user message: '%s'", msg); if (gdm_connection_get_message_count (conn) > GDM_SUP_MAX_MESSAGES) { gdm_debug ("Closing connection, %d messages reached", GDM_SUP_MAX_MESSAGES); gdm_connection_write (conn, "ERROR 200 Too many messages\n"); gdm_connection_close (conn); return; } ... Or do you mean something different? BTW: Sending me a patch with the modifications you want, would speed up things a lot (I trust you, that you are not sending viral code ;-)) and saves me quite a bit time, too ... Last but not least: Since you mentioned the config stuff: gdmconfig.c:625: warning: no previous prototype for 'gdm_get_per_display_custom_config_file' gdmconfig.c: In function `gdm_get_per_display_custom_config_file': gdmconfig.c:627: warning: no return statement in function returning non-void gdmconfig.c: At top level: gdmconfig.c:1300: warning: no previous prototype for '_gdm_set_value_int' gdmconfig.c:1890: warning: no previous prototype for 'gdm_load_config_option' gdmconfig.c: In function `gdm_get_per_display_custom_config_file': gdmconfig.c:627: warning: control reaches end of non-void function gdmconfig.c: In function `gdm_update_config': gdmconfig.c:1641: warning: 'rc' might be used uninitialized in this function gdmconfig.c: At top level: gdmconfig.c:97: warning: 'GdmGtkRC' defined but not used gdmconfig.c:110: warning: 'GdmDisplayInit' defined but not used gdmconfig.c:117: warning: 'GdmHaltReal' defined but not used gdmconfig.c:119: warning: 'GdmRebootReal' defined but not used gdmconfig.c:121: warning: 'GdmSuspendReal' defined but not used
Because I couldn't sleep, I thought, I start digging a little bit deeper and found at least a workaround: inserting debug statements into gdm_config_to_string(...) see patch: http://www.linofee.org/~jel/develop/gdm/gdmconfig.debug.patch Sounds strange, but who knows. Without the patch, messages say: ... Jun 9 17:48:25 wh58-307 gdm[10585]: gdm_socket_handler: Accepting new connection fd 8 Jun 9 17:48:25 wh58-307 gdm[10585]: Handling user message: 'VERSION' Jun 9 17:48:25 wh58-307 gdm[10585]: Trying to handle 'VERSION' Jun 9 17:48:25 wh58-307 gdm[10585]: done handling user message. Jun 9 17:48:25 wh58-307 gdm[10585]: Handling user message: 'GET_CONFIG debug/Enable :0' Jun 9 17:48:25 wh58-307 gdm[10585]: Trying to handle 'GET_CONFIG'; split[0] = 'debug/Enable'; split[1] = 'debug/Enable' Jun 9 17:48:25 wh58-307 gdm[10585]: calling gdm_config_to_string('debug/Enable', ':0') Jun 9 17:48:25 wh58-307 gdmgreeter[10730]: Command failed, daemon busy. Jun 9 17:48:25 wh58-307 gdmgreeter[10730]: Trying failed command again. Try 2 of 5. ... With the patch is says: ... Jun 9 17:37:39 wh58-307 gdm[27947]: gdm_socket_handler: Accepting new connection fd 8 Jun 9 17:37:39 wh58-307 gdm[27947]: Handling user message: 'VERSION' Jun 9 17:37:39 wh58-307 gdm[27947]: Trying to handle 'VERSION' Jun 9 17:37:39 wh58-307 gdm[27947]: done handling user message. Jun 9 17:37:39 wh58-307 gdm[27947]: Handling user message: 'GET_CONFIG debug/Enable :0' Jun 9 17:37:39 wh58-307 gdm[27947]: Trying to handle 'GET_CONFIG'; split[0] = 'debug/Enable'; split[1] = 'debug/Enable' Jun 9 17:37:39 wh58-307 gdm[27947]: calling gdm_config_to_string('debug/Enable', ':0') Jun 9 17:37:39 wh58-307 gdm[27947]: lookup hash type Jun 9 17:37:39 wh58-307 gdm[27947]: gdm_config_key_to_string_per_display(':0', 'debug/Enable') Jun 9 17:37:39 wh58-307 gdm[27947]: key per display not found Jun 9 17:37:39 wh58-307 gdm[27947]: lookup type value Jun 9 17:37:39 wh58-307 gdm[27947]: returned 'true' Jun 9 17:37:39 wh58-307 gdm[27947]: done handling user message. ... Hmmm, very very strange ... Double checked it, behavior is with both binaries always reproducable...
This is strange. So you are saying adding a few debug lines makes the problem disappear? There is probably some memory problem in the code, making it corrupt data - perhaps memory is being freed that should not be? If you compile the code with -g (set CFLAGS=-g before running configure;make) does the problem also go away? If not, it would be useful if you could attach the gdb debugger to the daemon gdm-binary process and put a breakpoint in the gdm_config_to_string function and see where it is failing.
Well, had this idea too: removed all debug changes (i.e. using the original src) and changed -O3 to -O2. Now it seems to work. (BTW: Without the -O2 change but debugs in gdmconfigure in place gdm dies, if one chooses to configure it). Anyway, I guess, fixing the bad code, i.e. declaring all used functions properly, returning initialized values, where functions are declared to return something and removing unused vars is probably the first step, which should be taken to tackle the problem. Perhaps these problems may cause gcc to optimize a little bit to much ... ? I'm using: Reading specs from /usr/local/bin/../lib/gcc/i686-pc-linux-gnu/3.4.3/specs Configured with: ../configure --prefix=/usr --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,f77 --disable-libgcj --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu Thread model: posix gcc version 3.4.3 In case your compiler doe not return the warnings I'm referring to, here the output I get: gdmconfig.c:625: warning: no previous prototype for 'gdm_get_per_display_custom_config_file' gdmconfig.c:1300: warning: no previous prototype for '_gdm_set_value_int' gdmconfig.c:1890: warning: no previous prototype for 'gdm_load_config_option' gdmconfig.c: In function `gdm_get_per_display_custom_config_file': gdmconfig.c:627: warning: control reaches end of non-void function gdmconfig.c: In function `gdm_update_config': gdmconfig.c:1641: warning: 'rc' might be used uninitialized in this function gdmconfig.c: At top level: gdmconfig.c:97: warning: 'GdmGtkRC' defined but not used gdmconfig.c:110: warning: 'GdmDisplayInit' defined but not used gdmconfig.c:117: warning: 'GdmHaltReal' defined but not used gdmconfig.c:119: warning: 'GdmRebootReal' defined but not used gdmconfig.c:121: warning: 'GdmSuspendReal' defined but not used gdmconfig.c: In function `gdm_config_get_xservers': gdmconfig.c:194: warning: unused variable `p' gdmconfig.c:198: warning: unused variable `temp' gdmconfig.c: At top level: gdmconfig.c:533: warning: no previous prototype for '_gdm_config_get_bool' gdmconfig.c:634: warning: no previous prototype for 'gdm_config_reload_translated_string' gdmdynamic.c: In function `main': gdmdynamic.c:82: warning: unused variable `gdm_running' gdmlogin.c: In function `update_clock': gdmlogin.c:2267: warning: passing arg 2 of `g_timeout_add' from incompatible pointer type gdmsetup.c:333: warning: no previous prototype for 'gdm_setup_config_set_bool' gdmsetup.c:351: warning: no previous prototype for 'gdm_setup_config_set_int' gdmsetup.c:369: warning: no previous prototype for 'gdm_setup_config_set_string'gdmsetup.c: In function `xserver_entry_timeout': gdmsetup.c:4290: warning: 'string_old' might be used uninitialized in this function gdmsetup.c: In function `xserver_toggle_timeout': gdmsetup.c:4340: warning: 'val' might be used uninitialized in this function gdmsetup.c: At top level: gdmsetup.c:2621: warning: 'xdmcp_button_clicked' defined but not used greeter.c: In function `greeter_setup_items': greeter.c:541: warning: passing arg 2 of `greeter_item_register_action_callback' from incompatible pointer type greeter.c: In function `main': greeter.c:1038: warning: unused variable `theme_name' greeter_canvas_text.c: In function `greeter_canvas_text_get_screen_dpi': greeter_canvas_text.c:98: warning: dereferencing type-punned pointer will break strict-aliasing rules greeter_canvas_item.c:232: warning: no previous prototype for 'greeter_item_run_button_action_callback' greeter_geometry.c: In function `greeter_item_size_request': greeter_geometry.c:569: warning: unused variable `font_desc' greeter_item_pam.c:52: warning: no previous prototype for 'greeter_item_pam_error_set' greeter_parser.c: In function `parse_gtkbutton': greeter_parser.c:1203: warning: unused variable `i' greeter_system.c: In function `greeter_config_handler': greeter_system.c:127: warning: implicit declaration of function `greeter_item_ulist_disable' greeter_system.c:130: warning: implicit declaration of function `greeter_item_ulist_unset_selected_user' gdmprefetch.c:36: warning: no previous prototype for 'doout' gdmprefetch.c:59: warning: no previous prototype for 'doin' gdmprefetch.c: In function `doin': gdmprefetch.c:64: warning: implicit declaration of function `strerror' gdmprefetch.c:64: warning: format argument is not a pointer (arg 3) gdmprefetch.c: In function `main': gdmprefetch.c:110: warning: format argument is not a pointer (arg 3) gdmprefetch.c:114: warning: implicit declaration of function `strlen' gdmprefetch.c:83: warning: unused variable `i'
Created attachment 67071 [details] [review] patch to fix warnings Here is a patch that fixes the warnings. Some of them seem pretty serious, and since they are in the gdmconfig code, I am hoping this will resolve your problem. Could you test with these changes and let me know if this fixes your problem? I also put this patch into CVS head for 2.14 and head branches if you want to grab the code from there. Also let me know if I missed any warnings. My compiler (SunStudio) wasn't reporting those issues.
Yes, now it works with -O3. Missed warnings: gdmconfig.c:1885: warning: no previous prototype for 'gdm_load_config_option' gdmconfig.c: In function `gdm_config_get_xservers': gdmconfig.c:194: warning: unused variable `p' gdmconfig.c:198: warning: unused variable `temp' gdmconfig.c: At top level: gdmconfig.c:634: warning: no previous prototype for 'gdm_config_reload_translated_string' gdmlogin.c: In function `update_clock': gdmlogin.c:2267: warning: passing arg 2 of `g_timeout_add' from incompatible pointer type gdmsetup.c:1512: warning: 'setup_xdmcp_notify_toggle' defined but not used gdmsetup.c:1679: warning: 'setup_xdmcp_intspin' defined but not used greeter.c: In function `greeter_setup_items': greeter.c:541: warning: passing arg 2 of `greeter_item_register_action_callback' from incompatible pointer type greeter_canvas_text.c: In function `greeter_canvas_text_get_screen_dpi': greeter_canvas_text.c:98: warning: dereferencing type-punned pointer will break strict-aliasing rules Now I need to find out, why the background for happygnome gets not displayed and why I get Jun 9 23:52:04 wh58-307 gdm[18612]: session_child_run: Cannot find or run the base Xsession script. Running the GNOME failsafe session instead.. Perhaps you should prepare for the next report ;-)
Great. I think we should close this bug now. You can file new bugs if you find that the other issues are really problems. What value do you have in /usr/share/gdm/defaults.conf for BaseXSession. Does it point to the right location? You aren't redefining this to something in the custom.conf or gdm.conf file in /etc/X11/gdm, are you? Are you wanting to display an image background for happygnome? If so, that is not supported. You can set a color background, but it will only display before/after the greeter displays. Unless you modify the background in the gdmgreeter theme to be alpha, then some of the background color would likely show through. Note there already is a bug regarding gdmgreeter not working with image backgrounds...so you might look at that bug and see if you want to finish up the work there if you need this feature.
1) Yes 2) Ooops - my x bit fault: pkgproto $PROTO/etc/opt/gnome2/gdm=etc/gdm | awk '{ if ( $1 == "d" ) { print $1, $2, $3, $4, "bin bin" } else if ( $3 ~ "/modules/" || $3 ~ "/(Xsession|gdmprefetchlist)=" ) { print $1, "rename", $3, "0644 bin bin" } else { print $1, $2, $3, $4, "bin bin" } }' >>${TMPBUILD}/prototype.lnf ;-( 3) Not really. But the thumbnail in the selection combobox is misleading. Wrt. this my testers incl. myself expect to see something... Since it we can't, we assume, that something is not working correctly. Perhaps adding a note in the manpage + docs would make it clear, that the current behavior is expected... 4) If a bug is already filed, that's ok for me. Have already spent much more time, than I planned for eval. So can't fix it (have to take care of other projects as well ;-)).