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 671819 - Crash (stack overflow) in gtk_range_grab_notify
Crash (stack overflow) in gtk_range_grab_notify
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.3.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 671684 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-03-11 11:27 UTC by Sébastien Granjoux
Modified: 2012-03-13 18:51 UTC
See Also:
GNOME target: 3.4
GNOME version: ---


Attachments
Crashing test case (1.25 KB, text/plain)
2012-03-11 11:27 UTC, Sébastien Granjoux
Details
backtrace (15.10 KB, text/plain)
2012-03-11 11:37 UTC, Sébastien Granjoux
Details

Description Sébastien Granjoux 2012-03-11 11:27:41 UTC
Created attachment 209425 [details]
Crashing test case

I have a crash in the attached program when doing the following

1. Move the mouse on the scrollbar on the right.
2. Press the left mouse button.
3. Keep the left mouse button pressed and press the right mouse button.
=> stack overflow


The first click in the scrollbar add a grab to get the slider, the second click add another grab to display a menu but enter in an endless loop.
Comment 1 Sébastien Granjoux 2012-03-11 11:37:52 UTC
Created attachment 209426 [details]
backtrace

Here a backtrace of the issue.

When the user click on the right button, there is a call to gtk_device_grab_add (widget=0x8d72010, device=0x8d1d4e0, block_others=1).

It sends a notifications to all widgets (including the scrollbar): gtk_range_grab_notify (widget=0x8d6d0b8, was_grabbed=0) 

I think the function stop_scrolling shouldn't be called here because the notification comes from the new grab used by the menu, it's not a change in the scrollbar grab.

The bugs appears in Gtk+ 3. Previously the code of gtk_range_grab_notify was:
static void
gtk_range_grab_notify (GtkWidget *widget,
		       gboolean   was_grabbed)
{
  if (!was_grabbed)
    stop_scrolling (GTK_RANGE (widget));
}

The code has been changed when merging the branch xi2-for-master.
Comment 3 Sébastien Granjoux 2012-03-13 18:51:27 UTC
*** Bug 671684 has been marked as a duplicate of this bug. ***