! 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 crashes on startup on OpenBSD
Status:
RESOLVED: FIXED

Comments

Description Sebastien Marie 2019-12-28 12:37:48 CET
on OpenBSD -current, I am experiencing systematical crashes at thunar startup.

at thunar startup, the thunar crashes with the following backtrace, which is similar to #16138 backtrace, but here we run with the fix:

Thread 1 received signal SIGSEGV, Segmentation fault.
strchr () at /usr/src/lib/libc/arch/amd64/string/strchr.S:60
60      /usr/src/lib/libc/arch/amd64/string/strchr.S: No such file or directory.
(gdb) bt
#0  strchr () at /usr/src/lib/libc/arch/amd64/string/strchr.S:60
#1  0xe7d14bcd633d2712 in ?? ()
#2  0x000017e8dad850a5 in g_param_spec_pool_lookup (pool=0x17e8be27aca0, param_name=0x4b500000000 <error: Cannot access memory at address 0x4b500000000>, owner_type=26287860700672, walk_ancestors=1) at ../glib-2.62.4/gobject/gparam.c:1071
#3  0x000017e8dad7e962 in g_object_new_valist (object_type=26287860700672, first_property_name=<optimized out>, var_args=0x7f7ffffee2d0) at ../glib-2.62.4/gobject/gobject.c:2121
#4  0x000017e8dad7e61a in g_object_new (object_type=26287860700672, first_property_name=0x3a <error: Cannot access memory at address 0x3a>) at ../glib-2.62.4/gobject/gobject.c:1670
#5  0x000017e5e43b7a6f in thunar_standard_view_init (standard_view=0x17e8b18b9c70) at thunar-standard-view.c:716
#6  0x000017e8dad941ea in g_type_create_instance (type=<optimized out>) at ../glib-2.62.4/gobject/gtype.c:1861
#7  0x000017e8dad82de5 in g_object_constructor (type=5175435591680, n_construct_properties=2, construct_params=0x17e8a8a22520) at ../glib-2.62.4/gobject/gobject.c:2178
#8  0x000017e5e43b7cea in thunar_standard_view_constructor (type=5175435591680, n_construct_properties=58, construct_properties=0x3a3a3a3a3a3a3a3a) at thunar-standard-view.c:763
#9  0x000017e8dad7f0ba in g_object_new_with_custom_constructor (class=<optimized out>, params=0x7f7ffffee4b0, n_params=1) at ../glib-2.62.4/gobject/gobject.c:1745
#10 g_object_new_internal (class=<optimized out>, params=0x7f7ffffee4b0, n_params=1) at ../glib-2.62.4/gobject/gobject.c:1825
#11 0x000017e8dad7ec10 in g_object_new_valist (object_type=26288860026624, first_property_name=<optimized out>, var_args=<optimized out>) at ../glib-2.62.4/gobject/gobject.c:2152
#12 0x000017e8dad7e61a in g_object_new (object_type=26288860026624, first_property_name=0x3a <error: Cannot access memory at address 0x3a>) at ../glib-2.62.4/gobject/gobject.c:1670
#13 0x000017e5e43ce94d in thunar_window_notebook_insert (window=0x17e89c4fa270, directory=0x17e815b5c810) at thunar-window.c:1845
#14 0x000017e5e43cf4d9 in thunar_window_action_view_changed (action=<optimized out>, current=<optimized out>, window=0x17e89c4fa270) at thunar-window.c:2851
#15 0x000017e5e43cf0cd in thunar_window_set_current_directory (window=0x17e89c4fa270, current_directory=0x17e815b5c810) at thunar-window.c:3865
#16 0x000017e5e435ee63 in thunar_application_open_window (application=0x17e8cb7840f0, directory=0x17e815b5c810, screen=<optimized out>, startup_id=0x0, force_new_window=<optimized out>) at thunar-application.c:1346
#17 0x000017e5e43789b6 in thunar_file_launch (file=0x17e815b5c810, parent=0x0, startup_id=0x0, error=<optimized out>) at thunar-file.c:1801
#18 0x000017e5e43616f9 in thunar_application_process_files_finish (browser=<optimized out>, file=0x17e815b5c810, target_file=0x17e815b5c810, error=0x0, unused=<optimized out>) at thunar-application.c:1511
#19 0x000017e5e4361a3c in thunar_browser_poke_file (browser=0x4b500000000, file=0x17e815b5c810, widget=0x101010101010101, func=0x8080808080808080, user_data=0x0) at thunar-browser.c:528
#20 0x000017e5e435f2d2 in thunar_application_process_filenames (application=0x17e8cb7840f0, working_directory=0x17e85a9bf140 "/home/semarie", filenames=<optimized out>, screen=0x0, startup_id=0x0, error=0x7f7ffffeea68) at thunar-application.c:1663
#21 0x000017e5e43611bb in thunar_application_command_line (gapp=0x17e8cb7840f0, command_line=0x17e86505bd60) at thunar-application.c:530
#22 0x000017e8bc7dba5a in _g_cclosure_marshal_INT__OBJECTv (closure=0x17e854603aa0, return_value=0x7f7ffffeeb90, instance=0x17e8cb7840f0, args=<optimized out>, marshal_data=<optimized out>, n_params=<optimized out>, param_types=0x17e896530070) at ../glib-2.62.4/gio/gmarshal-internal.c:845
#23 0x000017e8dad77f44 in _g_closure_invoke_va (closure=0x17e854603aa0, return_value=0x7f7ffffeeb90, instance=0x17e8cb7840f0, args=0x7f7ffffeed80, n_params=1, param_types=0x17e896530070) at ../glib-2.62.4/gobject/gclosure.c:873
#24 0x000017e8dad91912 in g_signal_emit_valist (instance=0x17e8cb7840f0, signal_id=<optimized out>, detail=0, var_args=0x7f7ffffeed80) at ../glib-2.62.4/gobject/gsignal.c:3306
#25 0x000017e8dad922c1 in g_signal_emit (instance=0x4b500000000, signal_id=58, detail=976894522) at ../glib-2.62.4/gobject/gsignal.c:3453
#26 0x000017e8bc847f83 in g_application_call_command_line (application=0x17e8cb7840f0, arguments=<optimized out>, options=<optimized out>, exit_status=0x7f7ffffeeefc) at ../glib-2.62.4/gio/gapplication.c:1076
#27 0x000017e8bc84a24e in g_application_real_local_command_line (application=0x17e8cb7840f0, arguments=0x7f7ffffeeef0, exit_status=<optimized out>) at ../glib-2.62.4/gio/gapplication.c:1130
#28 0x000017e8bc847d0a in g_application_run (application=<optimized out>, argc=<optimized out>, argv=<optimized out>) at ../glib-2.62.4/gio/gapplication.c:2528
#29 0x000017e5e435cac7 in main (argc=1, argv=0x7f7ffffeefd8) at main.c:161

(please note I am suspecting gdb to print garbage for some variables which should be optimized-out).

thunar is build and run with the following libraries/packages:
at-spi2-atk-2.34.1
atk-2.34.1p1
cairo-1.16.0
desktop-file-utils-0.24p0
exo-0.12.10
fribidi-1.0.7p2
gdk-pixbuf-2.40.0p2
gettext-runtime-0.20.1p0
glib2-2.62.3
graphite2-1.3.13p0
gtk+3-3.24.13
gtk-update-icon-cache-3.24.13
gvfs-1.42.2
harfbuzz-2.6.4p1
libexif-0.6.21p2
libffi-3.2.1p6
libiconv-1.16p0
libnotify-0.7.8
libxfce4ui-4.14.1p0
libxfce4util-4.14.0p0
pango-1.44.7p0
pcre-8.41p2
png-1.6.37
startup-notification-0.12p6
xfce4-panel-4.14.1p0
xfconf-4.14.1p0

I am able to workaround the problem by commenting thunar_pango_attr_disable_hyphens() call in thunar-standard-view.c (see https://git.xfce.org/xfce/thunar/tree/thunar/thunar-standard-view.c#n733)
Comment 1 alexxcons editbugs 2019-12-28 22:38:45 CET
Gna, that one again. Thanks for all the details !

So the difference to #16138 is, that you actually use the required version 1.44 of pango.
Comment 2 Andre Miranda editbugs 2019-12-29 15:32:10 CET
Created attachment 9337 
sample.c

No crashes for me with thunar 1.8.11 and pango 1.44.7.
Let me know if the attached sample works well for you or not.
Comment 3 Sebastien Marie 2019-12-29 18:40:42 CET
the attached sample run fine.
Comment 4 Landry Breuil editbugs 2020-01-02 19:46:01 CET
Fwiw i see the same startup crash on OpenBSD-current, so definitely can confirm it.

(gdb) bt
#0  strchr () at /usr/src/lib/libc/arch/amd64/string/strchr.S:60
#1  0x34f6df128787cb61 in ?? ()
#2  0x0000060107fcd0a5 in g_param_spec_pool_lookup () from /usr/local/lib/libgobject-2.0.so.4200.10
#3  0x0000060107fc6962 in g_object_new_valist () from /usr/local/lib/libgobject-2.0.so.4200.10
#4  0x0000060107fc661a in g_object_new () from /usr/local/lib/libgobject-2.0.so.4200.10
#5  0x000005fe2c2b7a6f in thunar_standard_view_init (standard_view=0x60110d74470) at thunar-standard-view.c:716
#6  0x0000060107fdc1ea in g_type_create_instance () from /usr/local/lib/libgobject-2.0.so.4200.10
#7  0x0000060107fcade5 in ?? () from /usr/local/lib/libgobject-2.0.so.4200.10
#8  0x000005fe2c2b7cea in thunar_standard_view_constructor (type=5308579577856, n_construct_properties=58, construct_properties=0x3a3a3a3a3a3a3a3a) at thunar-standard-view.c:763
#9  0x0000060107fc70ba in ?? () from /usr/local/lib/libgobject-2.0.so.4200.10
#10 0x0000060107fc6c10 in g_object_new_valist () from /usr/local/lib/libgobject-2.0.so.4200.10
#11 0x0000060107fc661a in g_object_new () from /usr/local/lib/libgobject-2.0.so.4200.10
#12 0x000005fe2c2ce94d in thunar_window_notebook_insert (window=0x6005be743a0, directory=0x600aa007000) at thunar-window.c:1845
#13 0x000005fe2c2cf4d9 in thunar_window_action_view_changed (action=<optimized out>, current=<optimized out>, window=0x6005be743a0) at thunar-window.c:2851
#14 0x000005fe2c2cf0cd in thunar_window_set_current_directory (window=0x6005be743a0, current_directory=0x600aa007000) at thunar-window.c:3865
#15 0x000005fe2c25ee63 in thunar_application_open_window (application=0x600e5a620f0, directory=0x600aa007000, screen=<optimized out>, startup_id=0x0, force_new_window=<optimized out>) at thunar-application.c:1346
#16 0x000005fe2c2789b6 in thunar_file_launch (file=0x600aa007000, parent=0x0, startup_id=0x0, error=<optimized out>) at thunar-file.c:1801
#17 0x000005fe2c2616f9 in thunar_application_process_files_finish (browser=<optimized out>, file=0x600aa007000, target_file=0x600aa007000, error=0x0, unused=<optimized out>) at thunar-application.c:1511
#18 0x000005fe2c261a3c in thunar_browser_poke_file (browser=0x4d400000000, file=0x600aa007000, widget=0x101010101010101, func=0x8080808080808080, user_data=0x0) at thunar-browser.c:528
#19 0x000005fe2c25f2d2 in thunar_application_process_filenames (application=0x600e5a620f0, working_directory=0x600bf27b4f0 "/home/landry", filenames=<optimized out>, screen=0x0, startup_id=0x0, 
    error=0x7f7ffffc4338) at thunar-application.c:1663
#20 0x000005fe2c2611bb in thunar_application_command_line (gapp=0x600e5a620f0, command_line=0x60124099160) at thunar-application.c:530
#21 0x0000060040497a5a in ?? () from /usr/local/lib/libgio-2.0.so.4200.10
#22 0x0000060107fbff44 in ?? () from /usr/local/lib/libgobject-2.0.so.4200.10
#23 0x0000060107fd9912 in g_signal_emit_valist () from /usr/local/lib/libgobject-2.0.so.4200.10
#24 0x0000060107fda2c1 in g_signal_emit () from /usr/local/lib/libgobject-2.0.so.4200.10
#25 0x0000060040503f83 in ?? () from /usr/local/lib/libgio-2.0.so.4200.10
#26 0x000006004050624e in ?? () from /usr/local/lib/libgio-2.0.so.4200.10
#27 0x0000060040503d0a in g_application_run () from /usr/local/lib/libgio-2.0.so.4200.10
#28 0x000005fe2c25cac7 in main (argc=1, argv=0x7f7ffffc48a8) at main.c:161
Comment 5 Landry Breuil editbugs 2020-01-05 09:50:39 CET
some extracts of a debugging session , in case this helps.. from my understanding it blows at the first cal lto thunar_standard_view_init in https://git.xfce.org/xfce/thunar/tree/thunar/thunar-standard-view.c#n716 (more or less this line) - first_property_name seems weird/corrupted memory ?

Thread 1 hit Breakpoint 1, thunar_standard_view_init (standard_view=0x17c61cee4c70) at thunar-standard-view.c:634
634	thunar-standard-view.c: No such file or directory.
(gdb) b thunar-standard-view.c:716
Breakpoint 2 at 0x17c40f2b7a25: file thunar-standard-view.c, line 716.
(gdb) c
Continuing.

Thread 1 hit Breakpoint 2, thunar_standard_view_init (standard_view=0x17c61cee4c70) at thunar-standard-view.c:716
716	in thunar-standard-view.c
(gdb) n
718	in thunar-standard-view.c
(gdb) 
716	in thunar-standard-view.c
(gdb) 

Thread 1 received signal SIGSEGV, Segmentation fault.
strchr () at /usr/src/lib/libc/arch/amd64/string/strchr.S:60
60		addq	$8,%rdi
(gdb) up
#1  0x308469e8ff71e471 in ?? ()
(gdb) up
#2  0x000017c6aed740a5 in g_param_spec_pool_lookup (pool=0x17c6d03609c0, param_name=0x4d400000000 <error: Cannot access memory at address 0x4d400000000>, owner_type=26143356455680, walk_ancestors=1)
    at ../glib-2.62.4/gobject/gparam.c:1071
1071	../glib-2.62.4/gobject/gparam.c: No such file or directory.
(gdb) 
#3  0x000017c6aed6d962 in g_object_new_valist (object_type=26143356455680, first_property_name=<optimized out>, var_args=0x7f7ffffea4a0) at ../glib-2.62.4/gobject/gobject.c:2121
2121	../glib-2.62.4/gobject/gobject.c: No such file or directory.
(gdb) 
#4  0x000017c6aed6d61a in g_object_new (object_type=26143356455680, first_property_name=0x3a <error: Cannot access memory at address 0x3a>) at ../glib-2.62.4/gobject/gobject.c:1670
1670	in ../glib-2.62.4/gobject/gobject.c
(gdb) 
#5  0x000017c40f2b7a6f in thunar_standard_view_init (standard_view=0x17c61cee4c70) at thunar-standard-view.c:716
716	thunar-standard-view.c: No such file or directory.
(gdb) p *standard_view
$3 = {__parent__ = {container = {container = {widget = {parent_instance = {g_type_instance = {g_class = 0x17c67dccf800}, ref_count = 1, qdata = 0x17c688c7ef02}, priv = 0x17c61cee4b80}, priv = 0x17c61cee4b60}, 
      priv = 0x17c61cee4b50}, priv = 0x17c61cee4970}, preferences = 0x17c69eb79500, clipboard = 0x0, model = 0x17c6ceebe120, action_group = 0x17c6ceebe0a0, ui_manager = 0x0, ui_merge_id = 0, icon_factory = 0x0, 
  icon_renderer = 0x17c6d6102b50, name_renderer = 0x0, loading_binding = 0x0, loading = 0, priv = 0x17c61cee4830}
(gdb) p *(standard_view->preferences)
$4 = {__parent__ = {g_type_instance = {g_class = 0x17c665eda800}, ref_count = 9, qdata = 0x17c6c231fc80}, channel = 0x17c6a12de080, property_changed_id = 51}
Comment 6 Landry Breuil editbugs 2020-01-05 09:56:42 CET
given that moving the bits from bug #16138 inside pango 1.44 check fixed the problem for us when we were using 1.42, and updating to pango 1.44 made the bug resurface, and as sebastien says disabling https://git.xfce.org/xfce/thunar/tree/thunar/thunar-standard-view.c#n733 fixes it again, i'd say there's a potential memory corruption directly inside the thunar pango extensions code ?
Comment 7 Landry Breuil editbugs 2020-01-05 10:15:23 CET
with the code disabled and with pango 1.44, i agree that hyphens are displayed in long filenames (per bug #15856) and that's a bit confusing, but at least there's no startup crash, so i've added it as a temporary fix in OpenBSD with https://marc.info/?l=openbsd-ports-cvs&m=157821531731024&w=2
Comment 8 Landry Breuil editbugs 2020-01-06 08:32:06 CET
Fwiw, nautilus implemented the same feature in https://gitlab.gnome.org/GNOME/nautilus/commit/9738d8561ed38a87b4d72db3e49653641edd9a09
Comment 9 Sebastien Marie 2020-01-06 11:33:12 CET
Created attachment 9351 
NULL is the sentinel for g_object_new

The sentinel should be NULL (a pointer) and not FALSE (an integer).

The subtility is the size of the argument. I suppose g_object_new() is reading 8 bytes (pointer size), and found some garbage on the stack after the 4 bytes (integer size here) setted for FALSE, resulting erratic behaviour.
Comment 10 David H. Gutteridge 2020-01-06 22:20:21 CET
I've hit this same issue on NetBSD. I applied Sebastien Marie's patch from Comment 9, and that resolved the problem for me. Thanks everyone for your attention to this.
Comment 11 Andre Miranda editbugs 2020-01-07 02:30:55 CET
(In reply to Sebastien Marie from comment #9)
> Created attachment 9351 
> NULL is the sentinel for g_object_new
> 
> The sentinel should be NULL (a pointer) and not FALSE (an integer).
> 
> The subtility is the size of the argument. I suppose g_object_new() is
> reading 8 bytes (pointer size), and found some garbage on the stack after
> the 4 bytes (integer size here) setted for FALSE, resulting erratic
> behaviour.

This patch makes complete sense, can you please resend it with authorship info (git format-patch)? Thanks.
P.S. If you don't care, let me know so I can push it as if I authored the commit.
Comment 12 Sebastien Marie 2020-01-07 06:24:46 CET
Created attachment 9353 
0001-NULL-is-the-proper-sentinel-for-g_object_new.patch
Comment 13 Git Bot editbugs 2020-01-07 21:52:43 CET
Sébastien Marie referenced this bugreport in commit 0f5caac32c38327d1c75a996f15c3bd4961244ad

NULL is the proper sentinel for g_object_new() (Bug #16310)

https://git.xfce.org/xfce/thunar/commit?id=0f5caac32c38327d1c75a996f15c3bd4961244ad
Comment 14 Git Bot editbugs 2020-01-07 21:53:38 CET
Sébastien Marie referenced this bugreport in commit 39cc89f5a94428a4f8b76bccb4ddae83fb958020

NULL is the proper sentinel for g_object_new() (Bug #16310)

https://git.xfce.org/xfce/thunar/commit?id=39cc89f5a94428a4f8b76bccb4ddae83fb958020
Comment 15 Andre Miranda editbugs 2020-01-07 21:55:17 CET
Thanks everyone for reporting/testing/patch and sorry for letting this fault passing unnoticed since the gtk3 port.

Bug #16310

Reported by:
Sebastien Marie
Reported on: 2019-12-28
Last modified on: 2020-01-07

People

Assignee:
Xfce Bug Triage
CC List:
4 users

Version

Version:
1.8.11

Attachments

sample.c (2.14 KB, text/x-csrc)
2019-12-29 15:32 CET , Andre Miranda
no flags
NULL is the sentinel for g_object_new (588 bytes, patch)
2020-01-06 11:33 CET , Sebastien Marie
no flags
0001-NULL-is-the-proper-sentinel-for-g_object_new.patch (961 bytes, patch)
2020-01-07 06:24 CET , Sebastien Marie
no flags

Additional information