After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 363015 - crash in Four-in-a-Row: Invoking network mode of...
crash in Four-in-a-Row: Invoking network mode of...
Status: RESOLVED FIXED
Product: gnome-games-superseded
Classification: Deprecated
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GGZ Gaming Zone bugtracker gateway
GGZ Gaming Zone bugtracker gateway
Depends on:
Blocks:
 
 
Reported: 2006-10-18 00:04 UTC by Abel Cheung
Modified: 2012-01-31 23:28 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Possible fix against svn revision 7384. (3.42 KB, patch)
2008-02-17 12:02 UTC, Roger Light
committed Details | Review

Description Abel Cheung 2006-10-18 00:04:36 UTC
What were you doing when the application crashed?
Invoking network mode of four-in-a-row (already connected to games.gnome.org), select "Help -> About" in menu.


Distribution: Ubuntu 6.10 (edgy)
Gnome Release: 2.16.1 2006-10-02 (Ubuntu)
BugBuddy Version: 2.16.0

Memory status: size: 64815104 vsize: 0 resident: 64815104 share: 0 rss: 22425600 rss_rlim: 0
CPU usage: start_time: 1161129441 rtime: 0 utime: 962 stime: 0 cutime:919 cstime: 0 timeout: 43 it_real_value: 0 frequency: 0

Backtrace was generated from '/usr/games/gnect'

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1224853840 (LWP 12539)]
(no debugging symbols found)
0xffffe410 in __kernel_vsyscall ()

Thread 1 (Thread -1224853840 (LWP 12539))

  • #0 __kernel_vsyscall
  • #1 __waitpid_nocancel
    from /lib/tls/i686/cmov/libpthread.so.0
  • #2 gnome_gtk_module_info_get
    from /usr/lib/libgnomeui-2.so.0
  • #3 <signal handler called>
  • #4 __kernel_vsyscall
  • #5 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #6 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #7 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #8 g_log
    from /usr/lib/libglib-2.0.so.0
  • #9 ggz_list_create_str
  • #10 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #12 g_signal_chain_from_overridden
    from /usr/lib/libgobject-2.0.so.0
  • #13 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #14 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #15 gtk_widget_realize
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 gtk_window_new
    from /usr/lib/libgtk-x11-2.0.so.0
  • #17 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #18 g_value_set_boxed
    from /usr/lib/libgobject-2.0.so.0
  • #19 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #20 g_signal_chain_from_overridden
    from /usr/lib/libgobject-2.0.so.0
  • #21 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #22 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #23 gtk_widget_show
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 ggz_list_create_str
  • #25 _ggzcore_player_destroy
  • #26 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #27 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #28 g_signal_chain_from_overridden
    from /usr/lib/libgobject-2.0.so.0
  • #29 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #30 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #31 gtk_widget_activate
    from /usr/lib/libgtk-x11-2.0.so.0
  • #32 gtk_menu_shell_activate_item
    from /usr/lib/libgtk-x11-2.0.so.0
  • #33 gtk_menu_shell_append
    from /usr/lib/libgtk-x11-2.0.so.0
  • #34 gtk_menu_reorder_child
    from /usr/lib/libgtk-x11-2.0.so.0
  • #35 _gtk_marshal_BOOLEAN__BOXED
    from /usr/lib/libgtk-x11-2.0.so.0
  • #36 g_value_set_boxed
    from /usr/lib/libgobject-2.0.so.0
  • #37 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #38 g_signal_chain_from_overridden
    from /usr/lib/libgobject-2.0.so.0
  • #39 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #40 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #41 gtk_widget_get_default_style
    from /usr/lib/libgtk-x11-2.0.so.0
  • #42 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #43 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #44 _gdk_events_init
    from /usr/lib/libgdk-x11-2.0.so.0
  • #45 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #46 g_main_context_check
    from /usr/lib/libglib-2.0.so.0
  • #47 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #48 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #49 ??
  • #50 ??
  • #51 ??
  • #0 __kernel_vsyscall

Comment 1 Abel Cheung 2006-10-18 00:10:22 UTC
Some additional info:
This is gnome-games 2.17.1 compiled on gnome 2.16.1, though I doubt this combination really
has special effect on the crash. Besides, it seems this crash is not particularly useful;
when I have time I'll post a backtrace with debugging info enabled.
Comment 2 Abel Cheung 2006-10-18 00:17:37 UTC
Even more info:
It's not related to four-in-a-row at all. This crash happens when inside ggz room frontend,
without launching any real game.
Comment 3 Andreas Røsdal 2006-10-18 10:18:46 UTC
Hi Abel Cheung,

Thanks for testing the network support. If you find any other crashes, please submit bugreports about it. Also if you have any suggestions, I would be happy to try to improve the network support. The more bugs we can remove now this early in the release cycle, the better the network support will be in the final 2.18.0.

Comment 4 Jason Dorje Short 2006-11-15 05:32:49 UTC
Surely this is a bug in libggz-gtk.  But without debugging symbols it won't be easy to trace.
Comment 5 Jason Dorje Short 2007-01-04 03:33:29 UTC
I can get a related but different crash if I open the 'about' menu with a busted installation.

  • #4 raise
    from /lib/tls/i686/cmov/libc.so.6
  • #5 abort
    from /lib/tls/i686/cmov/libc.so.6
  • #6 g_logv
    from /usr/lib/libglib-2.0.so.0
  • #7 g_log
    from /usr/lib/libglib-2.0.so.0
  • #8 about_realize
    at about.c line 134
  • #9 g_cclosure_marshal_VOID__VOID
    from /usr/lib/libgobject-2.0.so.0
  • #10 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #11 g_signal_chain_from_overridden
    from /usr/lib/libgobject-2.0.so.0

The problem here is in about.c.

	colormap = gdk_colormap_get_system();
	pixmap = gdk_pixmap_new(widget->window, 250, 300, -1);
	bg_img = load_pixbuf("about_bg");
	if (bg_img == NULL)
		g_error("Couldn't create about background pixmap.");

In this case the about_bg file is simply not installed (it's a busted installation, I accidentally deleted it), and so the g_error here gets called.

But this shouldn't be a fatal error.  There should be a fallback.  Is there an error-message-without-crash that can be added here?  Whoever wrote this may not have realized that the code would crash with a core file for something that is not a code error.

-jason
Comment 6 Andreas Røsdal 2007-01-06 16:30:58 UTC
Strangely, I am not able to reproduce this crash anymore. There have been many changes to gnect and the gnect server, and to the ggz library in the meantime. So it's possible that it has been fixed. 

Abel, could you please try to reproduce this crash again now? 
Comment 7 Andreas Røsdal 2007-01-18 18:43:41 UTC
I'm now able to reproduce this crash again.

Here is a simple way to reproduce this bug:
1. start gnibbles
2. Select "Game -> Network game" on the menu.
3. Click Cancel
4. Select "Game -> Network game" on the menu (again).
5. Click the "Connect" button.

This results in a crash every time.

Here is the backtrace:

Starting program: /usr/local/bin/gnibbles 
[Thread debugging using libthread_db enabled]
[New Thread -1208771712 (LWP 3495)]

(gnibbles:3495): Pango-CRITICAL **: pango_layout_set_text: assertion `layout != NULL' failed

(gnibbles:3495): Pango-CRITICAL **: pango_layout_get_pixel_extents: assertion `PANGO_IS_LAYOUT (layout)' failed

Program received signal SIGSEGV, Segmentation fault.

Thread NaN (LWP 3495)

  • #0 gtk_xtext_adjustment_set
    at xtext.c line 759
  • #1 gtk_xtext_render_page_timeout
    at xtext.c line 4681
  • #2 g_source_get_current_time
    from /lib/libglib-2.0.so.0
  • #3 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #4 g_main_context_check
    from /lib/libglib-2.0.so.0
  • #5 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #6 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #7 main
    at main.c line 1053

Comment 8 Roger Light 2008-02-17 00:15:27 UTC
I get similar results in valgrind:

==19831== Invalid read of size 4
==19831==    at 0x442128: gtk_xtext_adjustment_set (xtext.c:759)
==19831==    by 0x448464: gtk_xtext_render_page_timeout (xtext.c:4681)
==19831==    by 0xC5FB6DA: g_timeout_dispatch (gmain.c:3488)
==19831==    by 0xC5FAFB1: g_main_context_dispatch (gmain.c:2061)
==19831==    by 0xC5FE2AC: g_main_context_iterate (gmain.c:2694)
==19831==    by 0xC5FE595: g_main_loop_run (gmain.c:2898)
==19831==    by 0x947CD61: gtk_main (gtkmain.c:1163)
==19831==    by 0x416856: main (main.c:1082)
==19831==  Address 0x14 is not stack'd, malloc'd or (recently) free'd

The complete line in question is:

adj->page_size =
    (GTK_WIDGET (buf->xtext)->allocation.height -
     buf->xtext->font->descent) / buf->xtext->fontsize;

My testing indicates that buf->xtext->font is NULL, so the access to buf->xtext->font->descent is invalid and causes the segfault. I think this is a red herring to be honest.

My understanding of what happens is this:

Doing "Game->Network game" calls gnibbles/ggz-network.c:on_network_game() which initialises the ggz-gtk dialogues and then sets the current GTK_NOTEBOOK page to NETWORK_PAGE unless ggz_network_mode is TRUE in which case it just sets the current GTK_NOTEBOOK page to NETWORK_PAGE as the dialogue has already been initialised.

Clicking the Cancel button on the login dialog (ie. NETWORK_PAGE) calls ggz-gtk/login.c:login_cancel_button_clicked() which goes on to call ggz_closed_cb() which has been set to gnibbles/ggz-network.c:ggz_closed(). ggz_closed() sets the current GTK_NOTEBOOK page to MAIN_PAGE (the normal dialogue you get when starting gnibbles), sets ggz_network_mode to FALSE and calls end_game(). end_game() eventually calls gnibbles/main.c:network_gui_update(), which uses ggz_network_mode to determine whether the some widgets should be shown or not.

When we next click "Game->Network game" ggz_network_mode is FALSE, so the ggz-gtk dialogues are reinitialised and probably duplicated on the GTK_NOTEBOOK.

By commenting out the "ggz_network_mode = FALSE;" line in ggz-network.c:ggz_closed() gnibbles no longer crashes using the procedure outlined by Andreas above, but the gui does do strange things when "Cancel" is pressed (the chat widget and other bits remain visible).


It's late now and I've been working on this for a few hours now so I've probably got a few details wrong but it does get to the heart of the problem. Hopefully that gives you enough information to figure out how to fix it.
Comment 9 Roger Light 2008-02-17 00:31:36 UTC
Although I've been talking about gnibbles here instead of gnect, it's written just the same in gnect.
Comment 10 Roger Light 2008-02-17 12:02:13 UTC
Created attachment 105426 [details] [review]
Possible fix against svn revision 7384.

The attached patch seems to work for both gnibbles and gnect, but I was unable to test it on iagno due to other problems.
Comment 11 Andreas Røsdal 2008-03-01 19:48:03 UTC
Thanks Roger! The patch looks very good, and has been applied to SVN trunk:
http://svn.gnome.org/viewvc/gnome-games?view=revision&revision=7442

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
Comment 12 Robert Ancell 2012-01-31 23:28:09 UTC
This bug is being reassigned to the "general" component so we can close the ggz bugzilla component.  Apologies for the mass email!