! 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 !
Update to exo 0.12.1 causes thunar to crash on startup on FreeBSD
Status:
RESOLVED: FIXED

Comments

Description Guido Falsi 2018-06-18 23:39:54 CEST
Hi,

While testing the update of the FreeBSD port of exo I have observed thunar to consistently crash on startup only when using libexo 0.12.1.

I have tested reverting the update, installing the previous version and the problem disappears, while it persists if I recompile thunar after the upgrade of libexo.

Interesting thing, if I compile libexo with -O0 -g to get debuffing symbols thunar does not crash anymore. Thunar crashes consistently if compiled with -g though.

before crashing thunar hits an assertion in glib and outputs this:

GLib-GObject:ERROR:gobject.c:4284:g_weak_ref_set: assertion failed: (weak_locations != NULL)

This is the best backtrace I was able to get:

#0  0x0000000800f42dba in thr_kill () from /lib/libc.so.7
#1  0x0000000800f42d84 in raise () from /lib/libc.so.7
#2  0x0000000800f42cf9 in abort () from /lib/libc.so.7
#3  0x0000000800de98c3 in g_assertion_message () from /usr/local/lib/libglib-2.0.so.0
#4  0x0000000800de992e in g_assertion_message_expr () from /usr/local/lib/libglib-2.0.so.0
#5  0x0000000800cdc89a in g_weak_ref_set () from /usr/local/lib/libgobject-2.0.so.0
#6  0x0000000800cdc8b0 in g_weak_ref_clear () from /usr/local/lib/libgobject-2.0.so.0
#7  0x000000000026cd65 in weak_ref_free (ref=0x8051de690) at thunar-file.c:239
#8  0x0000000800db2ff8 in ?? () from /usr/local/lib/libglib-2.0.so.0
#9  0x000000000026d390 in thunar_file_finalize (object=0x805f3cc20) at thunar-file.c:441
#10 0x0000000800cd8433 in g_object_unref () from /usr/local/lib/libgobject-2.0.so.0
#11 0x0000000800dbf42c in g_list_free_full () from /usr/local/lib/libglib-2.0.so.0
#12 0x0000000800334e9c in thunarx_file_info_list_free (file_infos=0x8048e8120) at thunarx-file-info.c:446
#13 0x000000000027a1f7 in _thunar_io_jobs_ls (job=0x804ff6bb0, param_values=0x804ecda30, error=0x7fffdfdfcea0)
    at thunar-io-jobs.c:1216
#14 0x00000000002b6fe5 in thunar_simple_job_execute (job=0x804ff6bb0, error=0x7fffdfdfcef0)
    at thunar-simple-job.c:119
#15 0x0000000800379d99 in ?? () from /usr/local/lib/libexo-1.so.0
#16 0x0000000800bee1ce in ?? () from /usr/local/lib/libgio-2.0.so.0
#17 0x0000000800c16925 in ?? () from /usr/local/lib/libgio-2.0.so.0
#18 0x0000000800dec563 in ?? () from /usr/local/lib/libglib-2.0.so.0
#19 0x0000000800deb64a in ?? () from /usr/local/lib/libglib-2.0.so.0
#20 0x0000000801233425 in ?? () from /lib/libthr.so.3
#21 0x0000000000000000 in ?? ()
Backtrace stopped: Cannot access memory at address 0x7fffdfdfd000


I have had a look at the code but I have no idea which function is being referenced in libexo at slot 15, nor how this is actually interacting with thunar, which is apparently trying to list files in my home directory.

Looking at the commits to libexo since 0.12.0(which works fine) I have not identified anything specific altough I have some suspect regarding https://git.xfce.org/xfce/exo/commit/?id=66bea2cce71828cb7c0dbb6e09890e0aa78f376d

I'm investigating more, but I have no idea how to fix this.

Any help appreciated! Thanks in advance.
Comment 1 Guido Falsi 2018-06-19 00:54:53 CEST
I got a better backtrace, this one has everything except libexo compiled with -g. Unluckily enabling -g for libexo makes the crash disappear.

#0  0x000000080422184a in thr_kill () from /lib/libc.so.7
#1  0x0000000804221814 in raise () from /lib/libc.so.7
#2  0x0000000804221789 in abort () from /lib/libc.so.7
#3  0x0000000803a711a4 in g_assertion_message (
    domain=0x8037c2880 "GLib-GObject", file=0x8037c472c "gobject.c", 
    line=4284, func=0x8037c5387 "g_weak_ref_set", 
    message=0x80d30a910 "assertion failed: (weak_locations != NULL)")
    at gtestutils.c:2432
#4  0x0000000803a71224 in g_assertion_message_expr (
    domain=0x8037c2880 "GLib-GObject", file=0x8037c472c "gobject.c", 
    line=4284, func=0x8037c5387 "g_weak_ref_set", 
    expr=0x8037c53ce "weak_locations != NULL") at gtestutils.c:2455
#5  0x000000080379bf4c in g_weak_ref_set (weak_ref=0x80d340380, object=0x0)
    at gobject.c:4284
#6  0x000000080379c029 in g_weak_ref_clear (weak_ref=0x80d340380)
    at gobject.c:4187
#7  0x00000000004498d5 in weak_ref_free (ref=0x80d340380) at thunar-file.c:239
#8  0x0000000803a25250 in g_hash_table_remove_node (hash_table=0x80c592180, 
    i=13, notify=1) at ghash.c:458
#9  0x0000000803a24554 in g_hash_table_remove_internal (
    hash_table=0x80c592180, key=0x80c516680, notify=1) at ghash.c:1358
#10 0x0000000803a244b2 in g_hash_table_remove (hash_table=0x80c592180, 
    key=0x80c516680) at ghash.c:1386
#11 0x0000000000449f00 in thunar_file_finalize (object=0x80d3afb30)
    at thunar-file.c:441
#12 0x000000080379561e in g_object_unref (_object=0x80d3afb30)
    at gobject.c:3185
#13 0x0000000803a370ec in g_list_foreach (list=0x80c516720, 
    func=0x420624 <g_object_unref@plt>, user_data=0x0) at glist.c:1005
#14 0x0000000803a370a1 in g_list_free_full (list=0x80c516720, 
    free_func=0x420624 <g_object_unref@plt>) at glist.c:220
#15 0x000000080090c44c in thunarx_file_info_list_free (file_infos=0x80c516720)
    at thunarx-file-info.c:446
#16 0x0000000000456d77 in _thunar_io_jobs_ls (job=0x80d24d9b0, 
    param_values=0x80d2158c0, error=0x7fffdfbfbe80) at thunar-io-jobs.c:1216
#17 0x0000000000493b65 in thunar_simple_job_execute (job=0x80d24d9b0, 
    error=0x7fffdfbfbed0) at thunar-simple-job.c:119
#18 0x0000000800b47fd9 in exo_job_launch () from /usr/local/lib/libexo-1.so.0
#19 0x00000008033ffabf in io_job_thread (task=0x80d26ec10, source_object=0x0, 
    task_data=0x80d2fa6c0, cancellable=0x80d212ee0) at gioscheduler.c:85
#20 0x000000080343df2e in g_task_thread_pool_thread (thread_data=0x80d26ec10, 
    pool_data=0x0) at gtask.c:1304
#21 0x0000000803a75f47 in g_thread_pool_thread_proxy (data=0x80c5bbea0)
    at gthreadpool.c:307
#22 0x0000000803a74a1d in g_thread_proxy (data=0x80d2e5370) at gthread.c:784
#23 0x0000000803f38bc5 in pthread_create () from /lib/libthr.so.3
#24 0x0000000000000000 in ?? ()


Hope this helps.
Comment 2 Andre Miranda editbugs 2018-06-19 01:43:55 CEST
Just a random guess, try Thunar from master, I just pushed this fix: https://git.xfce.org/xfce/thunar/commit/?id=510c8779584edf2f113c379cb024370cf844412b

I know the backtrace is nothing alike the one from Bug # 14464, but I think the attempt is worth since it involves Thunar and thunarx.
Comment 3 Guido Falsi 2018-06-19 09:41:54 CEST
(In reply to Andre Miranda from comment #2)
> Just a random guess, try Thunar from master, I just pushed this fix:
> https://git.xfce.org/xfce/thunar/commit/
> ?id=510c8779584edf2f113c379cb024370cf844412b
> 
> I know the backtrace is nothing alike the one from Bug # 14464, but I think
> the attempt is worth since it involves Thunar and thunarx.

Thanks for the fast feedback!

I have made a quick test backporting your changes to thunar 1.6.15, and got the same failure, so it does not seem related.

I'll also test it with thunar 1.8.1 later. Testing the backporting on older version was just easier and quicker and more useful for me.

Unluckily I can't commit an update to 1.8.x to the FreeBSD ports tree. I tested it and works fine, but we'd loose integration with xfdesktop(since the stable version is still using GTK2) and the rest of xfce, unless forcing everyone on xfce 4.13, but that would force everyone on the development version.
Comment 4 Landry Breuil editbugs 2018-06-20 07:53:47 CEST
I have a similar segfault on OpenBSD too, but not at the exact same spot:


Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000191378fbd2dc in g_signal_emit_valist (instance=0x19134e317aa0, signal_id=<optimized out>, detail=0, var_args=0x19138f144f70)
    at gsignal.c:3369
3369    gsignal.c: No such file or directory.
[Current thread is 1 (process 364147)]
(gdb) bt
#0  0x0000191378fbd2dc in g_signal_emit_valist (instance=0x19134e317aa0, signal_id=<optimized out>, detail=0, var_args=0x19138f144f70)
    at gsignal.c:3369
#1  0x00001912ceea3d29 in exo_job_emit_valist_in_mainloop () from /usr/local/lib/libexo-2.so.0.0
#2  0x0000191337b504c2 in mainloop_proxy_func (data=0x19133ab04000) at gioscheduler.c:203
#3  0x00001913743d3039 in g_main_dispatch (context=<optimized out>) at gmain.c:3177
#4  g_main_context_dispatch (context=<optimized out>) at gmain.c:3830
#5  0x00001913743d3413 in g_main_context_iterate (context=<optimized out>, block=<optimized out>, dispatch=<optimized out>, 
    self=<optimized out>) at gmain.c:3903
#6  0x00001913743d34d5 in g_main_context_iteration (context=0x1912c8552800, may_block=1) at gmain.c:3964
#7  0x0000191337b909ed in g_application_run (application=0x191354713100, argc=<optimized out>, argv=<optimized out>)
    at gapplication.c:2470

This is with exo 0.12.1, glib 2.56.1 & thunar 1.8.1. Smells like memory corruption somewhere...
Comment 5 Sean Davis editbugs 2018-06-20 11:07:14 CEST
Since it seems to happen around exo-job, can one of you try patching this out locally to see if it's the offending change?

https://git.xfce.org/xfce/exo/commit/?id=a6969cface575deef4d9ab2f3b68880af67d118b
Comment 6 Guido Falsi 2018-06-20 12:05:56 CEST
(In reply to Sean Davis from comment #5)
> Since it seems to happen around exo-job, can one of you try patching this
> out locally to see if it's the offending change?
> 
> https://git.xfce.org/xfce/exo/commit/
> ?id=a6969cface575deef4d9ab2f3b68880af67d118b

I reverted that change locally and now thunar 1.6.15 is not crashing anymore in my test VM.

I'm going to implement the change on the machine I use daily for more thorough testing.

Good catch and thanks for helping!
Comment 7 Landry Breuil editbugs 2018-06-20 13:13:49 CEST
Reverting a6969cf also fixes the thunar 1.8.1 crash i'm seeing here :)
Comment 8 Git Bot editbugs 2018-06-20 23:58:27 CEST
Sean Davis referenced this bugreport in commit d18929d4747a909ab16c36dda6974e93d6952c62

Revert "CID 30799: Missing varargs init or cleanup" (bug 14465)

https://git.xfce.org/xfce/exo/commit?id=d18929d4747a909ab16c36dda6974e93d6952c62
Comment 9 Sean Davis editbugs 2018-06-20 23:59:04 CEST
Reverted commit above.

Bug #14465

Reported by:
Guido Falsi
Reported on: 2018-06-18
Last modified on: 2018-06-20

People

Assignee:
Nick Schermer
CC List:
4 users

Version

Version:
unspecified

Attachments

Additional information