Closed JakeSFR closed 4 years ago
Hmm it seems OK. I will check the code more though. Are you using purge dir cache option? Did you run the copy by rox or another app?
Hmm it seems OK. I will check the code more though.
Ok, thanks.
Are you using purge dir cache option?
No, it's unchecked. My Options file: Options.tar.gz
Dose the copy run by rox or another app?
By ROX.
Hi. I fixed suspected code. Yes it is not verified though.
Great, thanks! I'll let you know if it happens again (hopefully not!). I think 2-3 months without a crash should be enough to be sufficiently certain.
Ah, it happened again, sooner than I thought... This time I was extracting a large archive, entered the output folder, scrolling up and down and looking at the files as they were being extracted, and at some point ROX crashed:
Thread 1 "ROX-Filer" received signal SIGSEGV, Segmentation fault.
0x00007f822ba902c3 in g_type_check_instance_is_fundamentally_a (
type_instance=type_instance@entry=0xb4,
fundamental_type=fundamental_type@entry=0x50 [GObject]) at gtype.c:4023
4023 gtype.c: No such file or directory.
(gdb) thread apply all bt
Thread 4967 (Thread 0x7f821e7fc700 (LWP 4053)):
#0 0x00007f822a7de899 in syscall () at /lib64/libc.so.6
#1 0x00007f822b7ec280 in g_cond_wait_until (cond=cond@entry=0x7f8218000bd8, mutex=mutex@entry=0x7f8218000bd0, end_time=end_time@entry=20567791485)
at gthread-posix.c:1449
#2 0x00007f822b79cdde in g_async_queue_pop_intern_unlocked (queue=queue@entry=0x7f8218000bd0, wait=wait@entry=1, end_time=end_time@entry=20567791485) at gasyncqueue.c:422
#3 0x00007f822b79d22c in g_async_queue_timeout_pop (queue=0x7f8218000bd0, timeout=timeout@entry=15000000) at gasyncqueue.c:545
#4 0x00007f822b7d7b80 in g_thread_pool_wait_for_new_pool () at gthreadpool.c:167
#5 0x00007f822b7d7b80 in g_thread_pool_thread_proxy (data=<optimized out>) at gthreadpool.c:364
#6 0x00007f822b7d7550 in g_thread_proxy (data=0x3fd70a0) at gthread.c:784
#7 0x00007f82290885aa in start_thread () at /lib64/libpthread.so.0
#8 0x00007f822a7e3c5f in clone () at /lib64/libc.so.6
Thread 2 (Thread 0x7f82249cf700 (LWP 8855)):
#0 0x00007f822a7d9619 in poll () at /lib64/libc.so.6
#1 0x00007f822b7bce47 in g_main_context_poll (priority=<optimized out>, n_fds=2, fds=0x18be2f0, timeout=-1, context=0x18be070) at gmain.c:4221
#2 0x00007f822b7bce47 in g_main_context_iterate (context=context@entry=0x18be070, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3915
#3 0x00007f822b7bcf36 in g_main_context_iteration (context=0x18be070, may_block=may_block@entry=1) at gmain.c:3981
#4 0x00007f822b7bcf66 in glib_worker_main (data=<optimized out>) at gmain.c:5861
#5 0x00007f822b7d7550 in g_thread_proxy (data=0x18bd4a0) at gthread.c:784
#6 0x00007f82290885aa in start_thread () at /lib64/libpthread.so.0
#7 0x00007f822a7e3c5f in clone () at /lib64/libc.so.6
Thread 1 (Thread 0x7f822dfec900 (LWP 2309)):
#0 0x00007f822ba902c3 in g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0xb4, fundamental_type=fundamental_type@entry=0x50 [GObject]) at gtype.c:4023
#1 0x00007f822ba800b9 in g_object_unref (_object=0xb4) at gobject.c:3243
#2 0x0000000000431c08 in diritem_free (item=0x3b79f90) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/diritem.c:301
#3 0x000000000043092f in _inlist_clear (item=0x3b79f90, user_data=0x0)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:895
#4 0x00007f822b79cbba in g_ptr_array_foreach (array=0x7f8220039c00, func=0x430903 <_inlist_clear>, user_data=0x0) at garray.c:1611
#5 0x0000000000430969 in inlist_clear (pta=0x7f8220039c00) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:901
#6 0x000000000043119d in dir_scan (dir=0x3c711a0 [Directory]) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:1138
#7 0x000000000042ec6e in rescan_timeout_cb (data=0x3c711a0) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:107
#8 0x00007f822b7bd3cc in g_timeout_dispatch (source=0x394ab40, callback=<optimized out>, user_data=<optimized out>) at gmain.c:4667
#9 0x00007f822b7bcc75 in g_main_dispatch (context=0x17f97c0) at gmain.c:3182
#10 0x00007f822b7bcc75 in g_main_context_dispatch (context=context@entry=0x17f97c0) at gmain.c:3847
#11 0x00007f822b7bce9d in g_main_context_iterate (context=0x17f97c0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at gmain.c:3920
#12 0x00007f822b7bd14a in g_main_loop_run (loop=0x1785160) at gmain.c:4116
#13 0x00007f822d937a17 in IA__gtk_main () at gtkmain.c:1270
#14 0x0000000000453097 in main (argc=4, argv=0x7ffd81abed88) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/main.c:661
(gdb)
Moreover, after restarting ROX I selected all of the files (16,000+) with CTRL+A, then 'Delete' and ROX crashed again after deleting only some of them.
Anyway, I think I found a relatively reliable way to reproduce it:
while true; do f="${RANDOM}${RANDOM}"; dd if=/dev/urandom | head -c 123456 > "$f"; chmod +x "$f"; done
The chmod +x
might be important, because executable files are somehow slowing down ROX (the "Scanning" phase, where files' icons are still empty squares), what may make this crash more likely to happen.
It crashes every time (Veracrypt NTFS) or ~10% of times (just NTFS) for me at this point.
While playing with the above, I encountered a different segfault, just by selecting (CTRL+A) 7000+ files and immediately right-clicking:
Thread 1 "ROX-Filer" received signal SIGSEGV, Segmentation fault.
0x00000000004584cc in menu_selection_type (fw=0x1d67200)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/menu.c:2009
2009 /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/menu.c: No such file or directory.
(gdb) thread apply all bt
Thread 31 (Thread 0x7f4dd77fe700 (LWP 5323)):
#0 0x00007f4de22fc0d4 in read () at /lib64/libc.so.6
#1 0x00007f4de228d782 in __GI__IO_file_xsgetn () at /lib64/libc.so.6
#2 0x00007f4de22820a1 in fread () at /lib64/libc.so.6
#3 0x0000000000493052 in xdg_mime_get_mime_type_for_file (file_name=0x226c240 "/mnt/sda2/AA/46124133", statbuf=0x7f4dd77fd9b0)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/xdgmime.c:538
#4 0x000000000047f53d in type_from_path (path=0x226c240 "/mnt/sda2/AA/46124133")
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/type.c:326
#5 0x0000000000431836 in diritem_restat (path=0x226c240 "/mnt/sda2/AA/46124133", retitem=0x1daa9a0, parent=0x1f394d0, examine_now=0)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/diritem.c:215
#6 0x00000000004303ae in _insert_item (dir=0x1f394a0 [Directory], item=0x1daa9a0, leafname=0x1daa8c0 "46124133", examine_now=0)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:739
#7 0x000000000042f817 in do_recheck (data=0x1f394a0) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:467
#8 0x000000000042fd64 in scan_thread (data=0x1f394a0) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/dir.c:611
#9 0x00007f4de32fe550 in g_thread_proxy (data=0x1eb6000) at gthread.c:784
#10 0x00007f4de0baf5aa in start_thread () at /lib64/libpthread.so.0
#11 0x00007f4de230ac5f in clone () at /lib64/libc.so.6
Thread 29 (Thread 0x7f4dd5ffb700 (LWP 5321)):
#0 0x00007f4de2305899 in syscall () at /lib64/libc.so.6
#1 0x00007f4de3313280 in g_cond_wait_until (cond=cond@entry=0x7f4dd0000bd8, mutex=mutex@entry=0x7f4dd0000bd0, end_time=end_time@entry=24822041574)
at gthread-posix.c:1449
#2 0x00007f4de32c3dde in g_async_queue_pop_intern_unlocked (queue=queue@entry=0x7f4dd0000bd0, wait=wait@entry=1, end_time=end_time@entry=24822041574) at gasyncqueue.c:422
#3 0x00007f4de32c422c in g_async_queue_timeout_pop (queue=0x7f4dd0000bd0, timeout=timeout@entry=15000000) at gasyncqueue.c:545
#4 0x00007f4de32feb80 in g_thread_pool_wait_for_new_pool () at gthreadpool.c:167
#5 0x00007f4de32feb80 in g_thread_pool_thread_proxy (data=<optimized out>) at gthreadpool.c:364
#6 0x00007f4de32fe550 in g_thread_proxy (data=0x20be370) at gthread.c:784
#7 0x00007f4de0baf5aa in start_thread () at /lib64/libpthread.so.0
#8 0x00007f4de230ac5f in clone () at /lib64/libc.so.6
Thread 2 (Thread 0x7f4dd7fff700 (LWP 26659)):
#0 0x00007f4de2300619 in poll () at /lib64/libc.so.6
#1 0x00007f4de32e3e47 in g_main_context_poll (priority=<optimized out>, n_fds=2, fds=0x1d720d0, timeout=-1, context=0x1d72b30) at gmain.c:4221
---Type <return> to continue, or q <return> to quit---
#2 0x00007f4de32e3e47 in g_main_context_iterate (context=context@entry=0x1d72b30, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3915
#3 0x00007f4de32e3f36 in g_main_context_iteration (context=0x1d72b30, may_block=may_block@entry=1) at gmain.c:3981
#4 0x00007f4de32e3f66 in glib_worker_main (data=<optimized out>) at gmain.c:5861
#5 0x00007f4de32fe550 in g_thread_proxy (data=0x20bc630) at gthread.c:784
#6 0x00007f4de0baf5aa in start_thread () at /lib64/libpthread.so.0
#7 0x00007f4de230ac5f in clone () at /lib64/libc.so.6
Thread 1 (Thread 0x7f4de5b13900 (LWP 26286)):
#0 0x00000000004584cc in menu_selection_type (fw=0x1d67200) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/menu.c:2009
#1 0x00000000004230a3 in appmenu_add (slctwin=0x1d67200, app_dir=0x0, app_item=0x0, menu=0x20b6b10 [GtkMenu])
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/appmenu.c:112
#2 0x0000000000456002 in show_filer_menu (filer_window=0x1d67200, event=0x2168f40, iter=0x7fffe61353a0)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/menu.c:1012
#3 0x000000000043f149 in filer_perform_action (fw=0x1d67200, event=0x2168f40)
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/filer.c:3428
#4 0x00000000004869e7 in coll_button_press (widget=0x212d090 [Collection], event=0x2168f40, view_collection=0x20ad270 [ViewCollection])
at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/view_collection.c:1279
#9 0x00007f4de35b2d6a in <emit signal ??? on instance 0x212d090 [Collection]> (instance=instance@entry=0x212d090, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3447
#5 0x00007f4de5460b30 in _gtk_marshal_BOOLEAN__BOXED (closure=0x20b53e0, return_value=0x7fffe6135560, n_param_values=<optimized out>, param_values=0x7fffe61355e0, invocation_hint=<optimized out>, marshal_data=<optimized out>) at gtkmarshalers.c:84
#6 0x00007f4de35a3066 in g_closure_invoke (closure=0x20b53e0, return_value=0x7fffe6135560, n_param_values=2, param_values=0x7fffe61355e0, invocation_hint=0x7fffe6135588) at gclosure.c:810
#7 0x00007f4de35aef89 in signal_emit_unlocked_R (node=node@entry=0x1cb58d0, detail=detail@entry=0, instance=instance@entry=0x212d090, emission_return=emission_return@entry=0x7fffe6135698, instance_and_params=instance_and_params@entry=0x7fffe61355e0) at gsignal.c:3635
#8 0x00007f4de35b2b59 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffe6135748) at gsignal.c:3401
#10 0x00007f4de55387ed in gtk_widget_event_internal (widget=widget@entry=0x212d090 [Collection], event=event@entry=0x2168f40) at gtkwidget.c:5010
#11 0x00007f4de5538989 in IA__gtk_widget_event (widget=widget@entry=0x212d090 [Collection], event=event@entry=0x2168f40) at gtkwidget.c:4807
#12 0x00007f4de545f3f2 in IA__gtk_propagate_event (widget=0x212d090 [Collection], event=0x2168f40) at gtkmain.c:2503
#13 0x00007f4de545f7bc in IA__gtk_main_do_event (event=<optimized out>) at gtkmain.c:1698
#14 0x00007f4de50fa50d in gdk_event_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gdkevents-x11.c:2425
#15 0x00007f4de32e3c75 in g_main_dispatch (context=0x1cacd00) at gmain.c:3182
#16 0x00007f4de32e3c75 in g_main_context_dispatch (context=context@entry=0x1cacd00) at gmain.c:3847
#17 0x00007f4de32e3e9d in g_main_context_iterate (context=0x1cacd00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
at gmain.c:3920
#18 0x00007f4de32e414a in g_main_loop_run (loop=0x1c38160) at gmain.c:4116
#19 0x00007f4de545ea17 in IA__gtk_main () at gtkmain.c:1270
#20 0x0000000000453097 in main (argc=4, argv=0x7fffe6135c58) at /tmp/rox-filer-622fe5b85c39116dfa75f8971604a9fd1fb39a9a/ROX-Filer/src/main.c:661
(gdb)
This one is even easier to reproduce (just plain NTFS, no need for Veracrypt). When there's enough files in the output folder (~5000), enter it, CTRL+A and right-click. Crashes every time for me.
Reproduced! thank you!
Hi I fixed a bug but it happens only with deleting. I hope the first bug that with copy is fixed by first commit ;P
I tried the most prone variation (Veracrypt NTFS) a few times and couldn't reproduce it anymore. Thank you! :)
Btw, were you able to reproduce also the second segfault (CTRL+A -> right-click)? I was trying to figure it out today and came up with this:
--- OLD/menu.c 2020-02-07 08:11:23.000000000 +0100
+++ NEW/menu.c 2020-02-09 13:19:53.270263238 +0100
@@ -1998,6 +1998,7 @@
view_get_iter(fw->view, &iter, VIEW_ITER_SELECTED);
while ((item = iter.next(&iter)))
{
+ while(!item->mime_type) g_usleep(10000);
if(!type)
type=item->mime_type;
else
It's not crashing anymore, but am not sure if it's actually a valid fix. Maybe the loop should bail out and move on to another element (continue) at some point, because what if, for some reason, the _item->mimetype never gets set? I don't know the codebase well enough to tell if it's possible, but wouldn't want to stuck in an infinite loop.
Ah does it still happen? The code seems cause crash though somehow in my env it not heppens. The mime_type will be filled because of https://github.com/jun7/rox-filer/blob/master/ROX-Filer/src/diritem.c#L257
though I don't want to block ui process, just adding null check is good I think.
Ah sorry I had misunderstand it. I thought that the code is same as literocks I'm using but literrocks has null check.
Ah does it still happen?
Only the 2nd one (CTRL+A -> right-click), the 1st crash (CTRL+A -> UP icon) has been fixed by you previously.
The code seems cause crash though somehow in my env it not heppens.
Ah sorry I had misunderstand it. I thought that the code is same as literocks I'm using but literrocks has null check.
Oh, so that's why you couldn't repro it?
The mime_type will be filled because of https://github.com/jun7/rox-filer/blob/master/ROX-Filer/src/diritem.c#L257
Ok, so it's safe.
though I don't want to block ui process, just adding null check is good I think.
Just tried and it works either, thanks! There's one downside of such an approach, though. If all files are of the same type, the first time context menu shows up, there are only options for different types:
The second time (when every _item->mimetype is not NULL anymore) it shows correct options:
But I guess it's not a bigge. ;) Thanks again!
Oh, so that's why you couldn't repro it?
Yes, sorry.
It's very rare (once a month or so), but sometimes ROX crashes with one of these:
The trigger seems to be entering a folder with many (hundreds+) items and maybe also copying a file into it, but IIRC it can happen just by entering such a folder. Finally, I was able to gather a backtrace, so hopefully it will help you with figuring out why it happens.