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 767577 - Double-free compressing remote folder
Double-free compressing remote folder
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: file-roller-maint
file-roller-maint
Depends on:
Blocks: 688714 767605
 
 
Reported: 2016-06-12 19:58 UTC by Bastien Nocera
Modified: 2016-09-15 05:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix crash when compressing remote files (916 bytes, patch)
2016-06-13 11:35 UTC, Bastien Nocera
none Details | Review
Fix crash when compressing remote files (918 bytes, patch)
2016-06-14 08:20 UTC, Bastien Nocera
none Details | Review

Description Bastien Nocera 2016-06-12 19:58:12 UTC
file-roller-3.20.2-1.fc24.x86_64

1. On an smb remote folder, I have a folder full of images
2. Right-click on the folder, choose to compress to cbz (note that you cannot use the default options, says you don't have rights to write to it, choose a local directory instead)
3. Assertion on a double-free:
https://retrace.fedoraproject.org/faf/reports/1140565/

I cannot reproduce the bug under gdb or valgrind, but the file isn't actually created in the target directory.
Comment 1 Bastien Nocera 2016-06-13 11:30:35 UTC
It crashes when doing:
g_free (data->tmp_dir);
in xfer_data_free()

But tmp_dir is a GFile, so g_object_unref() is the right call to make.
Comment 2 Bastien Nocera 2016-06-13 11:35:49 UTC
Created attachment 329683 [details] [review]
Fix crash when compressing remote files

Though the crash could possibly happen with any operation. Use the
correct destructor for ->tmp_file, g_object_unref() rather than
g_free().
Comment 3 Bastien Nocera 2016-06-13 12:15:35 UTC
That's enough to stop it crashing, but not enough to make it work. I'll file a separate bug about it.
Comment 4 Ondrej Holy 2016-06-14 08:12:24 UTC
Separate bugs for this are Bug 688714 and Bug 724497.
Comment 5 Ondrej Holy 2016-06-14 08:12:31 UTC
Review of attachment 329683 [details] [review]:

::: src/fr-command.c
@@ +80,3 @@
 	_g_object_unref (data->base_dir);
 	g_free (data->dest_dir);
+	g_object_unref (data->tmp_dir);

You should use _g_object_unref, otherwise:

(file-roller:14428): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

  • #4 g_object_unref
    at gobject.c line 3080

Comment 6 Bastien Nocera 2016-06-14 08:20:36 UTC
Created attachment 329762 [details] [review]
Fix crash when compressing remote files

Though the crash could possibly happen with any operation. Use the
correct destructor for ->tmp_file, _g_object_unref() rather than
g_free().
Comment 7 Paolo Bacchilega 2016-09-15 05:15:54 UTC
(In reply to Bastien Nocera from comment #6)
> Created attachment 329762 [details] [review] [review]
> Fix crash when compressing remote files
> 
> Though the crash could possibly happen with any operation. Use the
> correct destructor for ->tmp_file, _g_object_unref() rather than
> g_free().

pushed to master, thank you.