! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Thunar: thunar_device_eject(): thunar killed by SIGSEGV
Status:
RESOLVED: FIXED

Comments

Description Mukundan Ragavan 2017-03-04 04:44:48 CET
I got this bug report on Fedora 25 against Thunar 1.6.11.

https://bugzilla.redhat.com/show_bug.cgi?id=1428981


Description of problem:
Press "Eject" in Thunar on the internal memory of the connected by USB-cable mobile phone.

Version-Release number of selected component:
Thunar-1.6.11-1.fc25

Additional info:
reporter:       libreport-2.8.0
backtrace_rating: 4
cmdline:        /usr/bin/Thunar /tmp/mozilla_user0
crash_function: thunar_device_eject
executable:     /usr/bin/thunar
global_pid:     3631
kernel:         4.9.12-200.fc25.x86_64
pkg_fingerprint: 4089 D8F2 FDB1 9C98
pkg_vendor:     Fedora Project
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 thunar_device_eject at thunar-device.c:702
 #1 thunar_shortcuts_view_eject at thunar-shortcuts-view.c:1920
 #6 gtk_widget_activate at gtkwidget.c:5048
 #7 gtk_menu_shell_activate_item at gtkmenushell.c:1303
 #8 gtk_menu_shell_button_release at gtkmenushell.c:730
 #9 _gtk_marshal_BOOLEAN__BOXED at gtkmarshalers.c:86
 #14 gtk_widget_event_internal at gtkwidget.c:5017
 #15 gtk_widget_event at gtkwidget.c:4814
 #16 gtk_propagate_event at gtkmain.c:2501
 #17 gtk_main_do_event at gtkmain.c:1696
Comment 1 Mukundan Ragavan 2017-03-04 04:45:44 CET
A possibly related bug report - 

https://bugzilla.redhat.com/show_bug.cgi?id=1427965


The downstream reporter has mentioned connecting a USB device (a phone).
Comment 2 Theo Linkspfeifer editbugs 2020-04-25 19:59:02 CEST
#0  0x0000557e91d1abe2 in thunar_device_eject (device=0x0, mount_operation=0x557e927cd930, cancellable=0x0, callback=0x557e91d52ab0 <thunar_shortcuts_view_eject_finish>, user_data=0x557e92ab33c0) at thunar-device.c:702
        __inst = <optimized out>
        __t = 94002111895856
        __r = <optimized out>
        op = <optimized out>
        mount = 0x0
        volume = <optimized out>
        drive = <optimized out>
#1  0x0000557e91d51343 in thunar_shortcuts_view_eject (view=view@entry=0x557e92ab33c0) at thunar-shortcuts-view.c:1981
        selection = <optimized out>
        model = 0x557e92a920c0
        iter = {stamp = -1029537973, user_data = 0x557e92ab9130, user_data2 = 0x557e92abcdc0, user_data3 = 0x0}
        device = 0x0
        mount_operation = 0x557e927cd930
        child_model = 0x557e92be6400

Thunar 1.8.9
Comment 3 Theo Linkspfeifer editbugs 2020-04-25 20:01:46 CEST
Created attachment 9797 
diff

Is this the fix?
Comment 4 alexxcons editbugs 2020-04-26 23:12:58 CEST
(In reply to Theo Linkspfeifer from comment #3)
> Created attachment 9797 
> diff
> 
> Is this the fix?

So you just added two NULL checks .. I guess that is not a bad idea.
And it fixed the bug for you ? What happens now on the faulty "eject" ?  Just nothing ?

You did not provide the fix as a patch, so I guess you think it is not complete/sufficient ?

Not sure how I could reproduce it .. if I plug-in my phone I have:
mtp://SAMSUNG_SAMSUNG_Android_addcac04/
That mount consists of two folders "dsik" (think thats my sd-card) and "Interner gemeinsamer Speicher" (internal memory)
So afaik I cannot press "eject" only on the internal memory for my phone.
Comment 5 Theo Linkspfeifer editbugs 2020-05-08 10:50:30 CEST
Created attachment 9844 
patch

> And it fixed the bug for you ?
The fix is simply based on the given stacktrace (not mine). I did not encounter the crash.

> You did not provide the fix as a patch, so I guess you think it is not complete/sufficient ?
It only tries to prevent Thunar from crashing. Further investigation may be needed.
Comment 6 alexxcons editbugs 2020-05-08 23:41:32 CEST
(In reply to Theo Linkspfeifer from comment #5)
> > You did not provide the fix as a patch, so I guess you think it is not complete/sufficient ?
> It only tries to prevent Thunar from crashing. Further investigation may be
> needed.

Uh, now that I checked the code changes, and having AndreLDM's hint in mind, that diff makes alot of sense :)
Thanks Theo !

@Mukundan Ragavan
Do you still get that crash ? If so, would be great if you could take a try for the patch (or the patched 4.14/master branch)
Comment 7 alexxcons editbugs 2020-05-08 23:49:26 CEST
I would just tweak that "if" a little bit to:

> if (G_LIKELY (THUNAR_IS_DEVICE (device)))

That as well checks for NULL

Ok for you if I commit it like that ? I can put me as co-author in case blaming is needed later :)
Comment 8 Theo Linkspfeifer editbugs 2020-05-09 10:57:18 CEST
Sure. The change could be applied to these functions too:

thunar_shortcuts_view_open
thunar_shortcuts_view_create_shortcut
thunar_shortcuts_view_mount
Comment 9 Git Bot editbugs 2020-05-09 12:28:19 CEST
Theo Linkspfeifer referenced this bugreport in commit 39cfd20e97fd075cbf09307145cbefc5943e4ffb

Replace 'thunar_return_if_fail (THUNAR_IS_DEVICE (device))' with standard 'if (..)' to prevent possible crashes. (Bug #13404)

https://gitlab.xfce.org/xfce/thunar/commit/39cfd20e97fd075cbf09307145cbefc5943e4ffb
Comment 10 Git Bot editbugs 2020-05-09 12:30:42 CEST
Theo Linkspfeifer referenced this bugreport in commit ac909a86a06d6ed0ecf6ea20d5a20f7116a60f05

Replace 'thunar_return_if_fail (THUNAR_IS_DEVICE (device))' with standard 'if (..)' to prevent possible crashes. (Bug #13404)

https://gitlab.xfce.org/xfce/thunar/commit/ac909a86a06d6ed0ecf6ea20d5a20f7116a60f05
Comment 11 alexxcons editbugs 2020-05-09 12:34:52 CEST
(In reply to Theo Linkspfeifer from comment #8)
> Sure. The change could be applied to these functions too:
> 
> thunar_shortcuts_view_open
> thunar_shortcuts_view_create_shortcut
> thunar_shortcuts_view_mount
Ok, as well fixed these occurances

pushed to master and the 4.14 branch, to be released in 1.9.0 and 1.8.15

@Mukundan Ragavan
If the bug should still occur in 1.9.0 or 1.8.15 (or above), please feel free to reopen this bug!

Bug #13404

Reported by:
Mukundan Ragavan
Reported on: 2017-03-04
Last modified on: 2020-05-09

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Version:
1.6.11

Attachments

diff (3.74 KB, patch)
2020-04-25 20:01 CEST , Theo Linkspfeifer
no flags
patch (4.11 KB, patch)
2020-05-08 10:50 CEST , Theo Linkspfeifer
no flags

Additional information