[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#396071: segfaults when attempting to take a screenshot while wget is running



Robert Millan wrote:
On Sun, Oct 29, 2006 at 09:14:57PM +0100, Attilio Fiandrotti wrote:

Frans Pop wrote:

reassign 396071 cdebconf-gtk-udeb
thanks

On Sunday 29 October 2006 17:23, Robert Millan wrote:


If you hit the Screenshot button while wget is fetching [1] your
mirror's Release file, d-i will segfault.  Inmediately after that, you
see [2], and after a console switch, the d-i logs [3].


Known issue and the reason why the screenshot button is disabled when a progress bar is running.
Apparently we are disabling the screenshot button too late here.

Reassigning to cdebconf-gtk-udeb as that is what causes the crash, and it would be good to investigate the actual cause of the crash and seeing if we can solve that. Disabling the button was only a workaround.

Note that in the mean time we may need to fix this in choose-mirror after all by displaying a progress bar at this point.

Accessing the GdkWindow by a thread while the window is being updated by another thread in the gtk_main_loop() causes crashes, and this is the reason why i made the screenshot button disappear during a progress_xxx() call, in fact past experiments aimed at gaining exclusive access to the gdkwidow led to deadlocks between threads. Robert, did you press the button before the progressbar was displayed or were you able to press it while the progressbar was running?


When I pressed it no progress bar was being displayed.  I don't know if one was
going to show up eventualy, but it was taking too much time and in fact the
system appeared to be hang because of this.

I've been able to reproduce the crash as Robert described it.
The problem is that i forgot to disable the screenshot button when exiting from a frontend_go(), like i did for the "next" and "back" ones. When the user clicks "back" or "next", the GTK application exits the gtk's main loop and there the callback function associated to the screenshot button, which is still active, causes the crash as expected. This is also the reason why i disabled the screenshot button while a progessbar is being updated: the callback would have arrived between two progress_xxx() calls, outside gtk main loop. The attached patch fixes this bug: the screenshot button is disabled after the user exits from a questions, and a bit earlier than before to prevent possible nasty timing issues.

cheers

attilio
Index: gtk.c
===================================================================
--- gtk.c       (revisione 42389)
+++ gtk.c       (copia locale)
@@ -1661,6 +1661,10 @@

     gdk_threads_enter();

+    gtk_widget_set_sensitive (data->button_prev, FALSE);
+    gtk_widget_set_sensitive (data->button_next, FALSE);
+    gtk_widget_set_sensitive (data->button_screenshot, FALSE);
+
     if (data->button_val == DC_OK)
     {
         call_setters(obj);
@@ -1679,9 +1683,6 @@
     else
         gtk_widget_destroy(questionbox_scroll);

-    gtk_widget_set_sensitive (data->button_prev, FALSE);
-    gtk_widget_set_sensitive (data->button_next, FALSE);
-
     gdk_threads_leave();

     if (data->button_val == DC_OK)

Reply to: