jun7 / rox-filer

ROX file manager
24 stars 6 forks source link

Rare segfaults #206

Closed JakeSFR closed 4 years ago

JakeSFR commented 4 years ago

It's very rare (once a month or so), but sometimes ROX crashes with one of these:

[ 1559.044920] ROX-Filer[1071]: segfault at 73 ip 00007f1b586f62c3 sp 00007ffca83a9be8 error 4 in libgobject-2.0.so.0.5800.1[7f1b586d2000+3c000]
[ 1597.251344] ROX-Filer[14282]: segfault at 407 ip 00007f411a7092cb sp 00007ffc0c098bf8 error 4 in libgobject-2.0.so.0.5800.1[7f411a6e5000+3c000]
[35750.017729] ROX-Filer[1073]: segfault at 30 ip 00007f9c40b532c3 sp 00007ffe496a14c8 error 4 in libgobject-2.0.so.0.5800.1[7f9c40b2f000+3c000]
[35750.060065] traps: ROX-Filer[5917] trap int3 ip:7f9c40883ded sp:7ffe496a07f0 error:0 in libglib-2.0.so.0.5800.1[7f9c4083e000+ef000]
[35774.665150] ROX-Filer[6219]: segfault at 7fa400000010 ip 00007fa49d36bbf8 sp 00007ffd7c3a8250 error 4 in libglib-2.0.so.0.5800.1[7fa49d32a000+ef000]
[25620.231421] traps: ROX-Filer[994] general protection ip:7fb89c34d2cb sp:7fff3de269b8 error:0 in libgobject-2.0.so.0.5800.1[7fb89c329000+3c000]
[45099.347355] traps: ROX-Filer[4956] trap int3 ip:7fc756f3aded sp:7ffc6e6e1730 error:0 in libglib-2.0.so.0.5800.1[7fc756ef5000+ef000]
[51256.574757] ROX-Filer[26785]: segfault at 8 ip 00007fe44d2175c9 sp 00007ffdc8951370 error 4 in libgtk-x11-2.0.so.0.2400.32[7fe44d094000+3ad000]

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.

Thread 1 "ROX-Filer" received signal SIGSEGV, Segmentation fault.
0x00007ffbf4c522c3 in g_type_check_instance_is_fundamentally_a (
    type_instance=type_instance@entry=0xffd1d3d1ffd1d3d1, 
    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 3360 (Thread 0x7ffbed0ca700 (LWP 7046)):
#0  0x00007ffbf39a0899 in syscall () at /lib64/libc.so.6
#1  0x00007ffbf49ae280 in g_cond_wait_until (cond=cond@entry=0x7ffbe0000bd8, mutex=mutex@entry=0x7ffbe0000bd0, end_time=end_time@entry=40390320637)
    at gthread-posix.c:1449
#2  0x00007ffbf495edde in g_async_queue_pop_intern_unlocked (queue=queue@entry=0x7ffbe0000bd0, wait=wait@entry=1, end_time=end_time@entry=40390320637) at gasyncqueue.c:422
#3  0x00007ffbf495f22c in g_async_queue_timeout_pop (queue=0x7ffbe0000bd0, timeout=timeout@entry=15000000) at gasyncqueue.c:545
#4  0x00007ffbf4999b80 in g_thread_pool_wait_for_new_pool () at gthreadpool.c:167
#5  0x00007ffbf4999b80 in g_thread_pool_thread_proxy (data=<optimized out>) at gthreadpool.c:364
#6  0x00007ffbf4999550 in g_thread_proxy (data=0x2e38320) at gthread.c:784
#7  0x00007ffbf224a5aa in start_thread () at /lib64/libpthread.so.0
#8  0x00007ffbf39a5c5f in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7ffbedc52700 (LWP 2883)):
#0  0x00007ffbf399b619 in poll () at /lib64/libc.so.6
#1  0x00007ffbf497ee47 in g_main_context_poll (priority=<optimized out>, n_fds=2, fds=0x90d350, timeout=-1, context=0xc60880) at gmain.c:4221
#2  0x00007ffbf497ee47 in g_main_context_iterate (context=context@entry=0xc60880, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3915
#3  0x00007ffbf497ef36 in g_main_context_iteration (context=0xc60880, may_block=may_block@entry=1) at gmain.c:3981
#4  0x00007ffbf497ef66 in glib_worker_main (data=<optimized out>) at gmain.c:5861
#5  0x00007ffbf4999550 in g_thread_proxy (data=0xc4cf20) at gthread.c:784
#6  0x00007ffbf224a5aa in start_thread () at /lib64/libpthread.so.0
#7  0x00007ffbf39a5c5f in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7ffbf71ae900 (LWP 1043)):
#0  0x00007ffbf4c522c3 in g_type_check_instance_is_fundamentally_a (type_instance=type_instance@entry=0xffd1d3d1ffd1d3d1, fundamental_type=fundamental_type@entry=0x50 [GObject]) at gtype.c:4023
#1  0x00007ffbf4c420b9 in g_object_unref (_object=0xffd1d3d1ffd1d3d1) at gobject.c:3243
#2  0x0000000000431bdb in diritem_free (item=0x2e475c0) at /tmp/rox-filer-master/ROX-Filer/src/diritem.c:301
#3  0x0000000000430902 in _inlist_clear (item=0x2e475c0, user_data=0x0) at /tmp/rox-filer-master/ROX-Filer/src/dir.c:892
#4  0x00007ffbf495ebba in g_ptr_array_foreach (array=0x7ffbcc000e40, func=0x4308d6 <_inlist_clear>, user_data=0x0) at garray.c:1611
#5  0x000000000043093c in inlist_clear (pta=0x7ffbcc000e40) at /tmp/rox-filer-master/ROX-Filer/src/dir.c:898
#6  0x0000000000431170 in dir_scan (dir=0x2132160 [Directory]) at /tmp/rox-filer-master/ROX-Filer/src/dir.c:1135
#7  0x000000000042ec6e in rescan_timeout_cb (data=0x2132160) at /tmp/rox-filer-master/ROX-Filer/src/dir.c:107
#8  0x00007ffbf497f3cc in g_timeout_dispatch (source=0x1b43810, callback=<optimized out>, user_data=<optimized out>) at gmain.c:4667
#9  0x00007ffbf497ec75 in g_main_dispatch (context=0x847e80) at gmain.c:3182
#10 0x00007ffbf497ec75 in g_main_context_dispatch (context=context@entry=0x847e80) at gmain.c:3847
#11 0x00007ffbf497ee9d in g_main_context_iterate (context=0x847e80, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>)
    at gmain.c:3920
#12 0x00007ffbf497f14a in g_main_loop_run (loop=0x7d1160) at gmain.c:4116
#13 0x00007ffbf6af9a17 in IA__gtk_main () at gtkmain.c:1270
#14 0x0000000000452f8d in main (argc=4, argv=0x7ffe0f310ce8) at /tmp/rox-filer-master/ROX-Filer/src/main.c:661
(gdb) 
jun7 commented 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?

JakeSFR commented 4 years ago

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.

jun7 commented 4 years ago

Hi. I fixed suspected code. Yes it is not verified though.

JakeSFR commented 4 years ago

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.

JakeSFR commented 4 years ago

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:

  1. Create lots of files (15,000+) on some slow filesystem (NTFS is good, but even better: a Veracrypt encrypted volume formatted to NTFS on NTFS partition) using:

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.

  1. Enter the folder with those random files, select all of them and Delete.
  2. While the deletion is in progress, click the UP arrow to get to the parent directory.

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.

jun7 commented 4 years ago

Reproduced! thank you!

jun7 commented 4 years ago

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

JakeSFR commented 4 years ago

I tried the most prone variation (Veracrypt NTFS) a few times and couldn't reproduce it anymore. Thank you! :)

JakeSFR commented 4 years ago

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.

jun7 commented 4 years ago

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.

jun7 commented 4 years ago

Ah sorry I had misunderstand it. I thought that the code is same as literocks I'm using but literrocks has null check.

JakeSFR commented 4 years ago

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:

1

The second time (when every _item->mimetype is not NULL anymore) it shows correct options:

2

But I guess it's not a bigge. ;) Thanks again!

jun7 commented 4 years ago

Oh, so that's why you couldn't repro it?

Yes, sorry.