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 725164 - [crash] update_current_folder_get_info_cb at gtkfilechooserwidget.c
[crash] update_current_folder_get_info_cb at gtkfilechooserwidget.c
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.11.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-02-25 16:59 UTC by Christoph Reiter (lazka)
Modified: 2015-01-24 22:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
FileChooserWidget: remove dead code (2.56 KB, patch)
2015-01-19 19:46 UTC, Christoph Reiter (lazka)
reviewed Details | Review
GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder. (2.94 KB, patch)
2015-01-19 19:47 UTC, Christoph Reiter (lazka)
needs-work Details | Review
GtkFileChooserWidget: remove unused fields and cleanup code. (2.70 KB, patch)
2015-01-20 16:56 UTC, Christoph Reiter (lazka)
committed Details | Review
GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder. (1.49 KB, patch)
2015-01-20 16:57 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2014-02-25 16:59:54 UTC
This is with current trunk, but happens in 3.10.7 as well.

Program received signal SIGSEGV, Segmentation fault.
update_current_folder_get_info_cb (cancellable=0x2cf6340, info=0x0, error=0x1700f60, user_data=0x1bf31f0) at gtkfilechooserwidget.c:4420
4420	  if (cancellable != priv->update_current_folder_cancellable)

Thread 1 (Thread 0x7ffff7fbd700 (LWP 23922))

  • #0 update_current_folder_get_info_cb
    at gtkfilechooserwidget.c line 4420
  • #1 query_info_callback
    at gtkfilesystem.c line 419
  • #2 g_task_return_now
    at gtask.c line 1076
  • #3 complete_in_idle_cb
    at gtask.c line 1085
  • #4 g_main_dispatch
    at gmain.c line 3064
  • #5 g_main_context_dispatch
    at gmain.c line 3663
  • #6 g_main_context_iterate
    at gmain.c line 3734
  • #7 g_main_context_iteration
    at gmain.c line 3795
  • #8 gtk_main_iteration
    at gtkmain.c line 1293
  • #9 ffi_call_unix64
    from /usr/lib/x86_64-linux-gnu/libffi.so.6
  • #10 ffi_call
    from /usr/lib/x86_64-linux-gnu/libffi.so.6

Comment 1 Matthias Clasen 2014-03-03 22:28:01 UTC
Not enough detail here, I'm afraid. What are you you doing when this happens ?
Comment 2 Christoph Reiter (lazka) 2014-03-04 12:04:37 UTC
Some more info:

* It's happening during my unit tests only
* There is no main loop running and it's basically creating the widget, settings some things and calling destroy().
* Adding a gtk_main_iteration() loop before the destroy() fixes it.
* Sadly the test causing the segv doesn't segv if run alone, only running all tests triggers it somehow.
Comment 3 Milan Crha 2014-11-04 05:07:52 UTC
Downstream bug report about the same with gtk3-3.14.4-1.fc21.x86_64:
https://bugzilla.redhat.com/show_bug.cgi?id=1160111
Comment 4 Christoph Reiter (lazka) 2015-01-19 19:46:21 UTC
Created attachment 294918 [details] [review]
FileChooserWidget: remove dead code

[PATCH 1/2] FileChooserWidget: remove dead code
Comment 5 Christoph Reiter (lazka) 2015-01-19 19:47:18 UTC
Created attachment 294919 [details] [review]
GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder.

GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder.

Keep a reference to the widget while the async operation is ongoing.
Comment 6 Matthias Clasen 2015-01-19 23:59:20 UTC
Review of attachment 294918 [details] [review]:

Would be good if the commit message said something to the extent of:

These fields are never set, so we don't need the code to clean them up.
Comment 7 Matthias Clasen 2015-01-20 00:02:07 UTC
Review of attachment 294919 [details] [review]:

The actual change (taking a ref) looks good to me.

::: gtk/gtkfilechooserwidget.c
@@ +1487,3 @@
+  GtkFileChooserWidget *impl; /* owned */
+  gchar **uris; /* owned full */
+  GFile *file; /* owned */

We don't really use such annotations in gtk, so please leave them out.
Comment 8 Christoph Reiter (lazka) 2015-01-20 16:56:58 UTC
Created attachment 295022 [details] [review]
GtkFileChooserWidget: remove unused fields and cleanup code.
Comment 9 Christoph Reiter (lazka) 2015-01-20 16:57:33 UTC
Created attachment 295023 [details] [review]
GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder.
Comment 10 Matthias Clasen 2015-01-20 18:20:22 UTC
Review of attachment 295022 [details] [review]:

sure, thanks
Comment 11 Matthias Clasen 2015-01-20 18:20:40 UTC
Review of attachment 295023 [details] [review]:

ok
Comment 12 Matthias Clasen 2015-01-24 22:32:28 UTC
Attachment 295022 [details] pushed as c235747 - GtkFileChooserWidget: remove unused fields and cleanup code.
Attachment 295023 [details] pushed as 8fc9201 - GtkFileChooserWidget: Fix a crash for when the widget was unrefed right after setting a current folder.