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 752478 - Crash in progress_dialog_response() after calling "file-roller --extract archive.gz"
Crash in progress_dialog_response() after calling "file-roller --extract arch...
Status: RESOLVED OBSOLETE
Product: file-roller
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: file-roller-maint
file-roller-maint
Depends on:
Blocks:
 
 
Reported: 2015-07-16 11:26 UTC by David King
Modified: 2020-11-11 19:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proof-of-concept patch, taking a ref on the main window (1.58 KB, patch)
2015-07-16 13:53 UTC, David King
none Details | Review
updated proof-of-concept (1.25 KB, patch)
2015-07-17 10:25 UTC, David King
none Details | Review
add a g_object_ref() (1.83 KB, patch)
2015-07-17 12:24 UTC, David King
reviewed Details | Review

Description David King 2015-07-16 11:26:57 UTC
When calling "file-roller --extract" with a valid archive, and closing the "Extraction completed successfully dialogue (this step has to be done quickly, within 10 seconds), there is a crash in progress_dialog_response() while trying to dereference the "window->priv" pointer, which does not point to valid data as the object has been disposed (points to 0xaaaaaaaaaaaaaaaa).

Stack trace:

  • #0 progress_dialog_response
    at fr-window.c line 2158
  • #1 g_cclosure_marshal_VOID__ENUMv
    at gmarshal.c line 1496
  • #2 _g_closure_invoke_va
    at gclosure.c line 864
  • #3 g_signal_emit_valist
    at gsignal.c line 3246
  • #4 g_signal_emit
    at gsignal.c line 3393
  • #5 gtk_dialog_delete_event_handler
    at gtkdialog.c line 741
  • #6 _gtk_marshal_BOOLEAN__BOXED
    at gtkmarshalers.c line 85
  • #7 g_closure_invoke
    at gclosure.c line 801
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3581
  • #9 g_signal_emit_valist
    at gsignal.c line 3347
  • #10 g_signal_emit
    at gsignal.c line 3393
  • #11 gtk_widget_event_internal
    at gtkwidget.c line 7815
  • #12 gtk_main_do_event
    at gtkmain.c line 1691
  • #13 send_delete_event
    at gtkwindow.c line 1324
  • #14 gdk_threads_dispatch
    at gdk.c line 719
  • #15 g_main_dispatch
    at gmain.c line 3122
  • #16 g_main_context_dispatch
    at gmain.c line 3737
  • #17 g_main_context_iterate
    at gmain.c line 3808
  • #18 g_main_context_iteration
    at gmain.c line 3869
  • #19 g_application_run
    at gapplication.c line 2311
  • #20 main
    at main.c line 38

After a bit of investigation, leaving the dialogue open until the SERVICE_TIMEOUT triggers (10 seconds), g_application_release() is called and the application is terminated without a crash, as the dialogue response is not emitted.

I am not sure of the best fix. The progress dialogue could take a full reference (with g_object_ref()) on the main window, but this could get into problems with circular references. It might make sense to use g_object_weak_ref(), stuffing a pointer to the main window into the dialogue and clearing that pointer when the GWeakNotify is triggered. Do you have any preference, or suggestion of an alternative fix?
Comment 1 David King 2015-07-16 13:53:12 UTC
Created attachment 307556 [details] [review]
proof-of-concept patch, taking a ref on the main window

The attached patch is a quick hack to take a reference on the main window. It seems to work, but needs more testing, and I probably made a mistake with the reference-counting.
Comment 2 David King 2015-07-17 10:25:18 UTC
Created attachment 307612 [details] [review]
updated proof-of-concept

Fix an undesired g_object_unref().
Comment 3 David King 2015-07-17 12:24:59 UTC
Created attachment 307615 [details] [review]
add a g_object_ref()
Comment 4 Michael Catanzaro 2015-11-29 22:39:38 UTC
Review of attachment 307615 [details] [review]:

Are you still not sure whether this is right?

If you're confident in the fix, then don't wait months for a review; after waiting a few weeks to give the maintainer a chance to review, please just go ahead and push!
Comment 5 David King 2015-11-30 01:18:29 UTC
It's a workaround, and not really a fix. A suitable fix would likely need a lot of refactoring.
Comment 6 Paolo Bacchilega 2015-12-20 16:21:06 UTC
I cannot reproduce the problem with current master, can someone test and see if current master still crashes?

Note that the behaviour changed a bit, to show the confirmation dialog you need to use the --notify option as well, only using --extract will not show the dialog anymore, this was the intented behaviour since the beginning.
Comment 7 Sebastien Bacher 2016-01-11 10:30:56 UTC
it seems to not segfault with master indeed ... do you plan to make a new tarball including those changes/fixes?
Comment 8 Paolo Bacchilega 2016-01-11 17:38:27 UTC
(In reply to Sebastien Bacher from comment #7)
> it seems to not segfault with master indeed ... do you plan to make a new
> tarball including those changes/fixes?

next monday.
Comment 9 André Klapper 2020-11-11 19:13:08 UTC
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports and feature requests in GNOME Bugzilla which have not seen updates for a long time.

If you still use file-roller and if you still see this bug / want this feature in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/file-roller/-/issues/

Thank you for creating this report and we are sorry it could not be implemented (volunteer workforce and time is limited).