vifm / vifm

Vifm is a file manager with curses interface, which provides Vim-like environment for managing objects within file systems, extended with some useful ideas from mutt.
https://vifm.info
GNU General Public License v2.0
2.76k stars 125 forks source link

Crash on :comp huge directories #1036

Open nteodosio opened 5 days ago

nteodosio commented 5 days ago

I tried to :comp two Chromium trees and Vifm crashed.

#0  fill_side_by_side.isra.0 (group_paths=group_paths@entry=1, other=..., curr=...)
    at /usr/src/vifm-0.12-1build2/src/compare.c:317
#1  0x0000636756b28a78 in compare_two_panes (ct=CT_CONTENTS, lt=LT_ALL, group_paths=1,
    skip_empty=<optimized out>) at /usr/src/vifm-0.12-1build2/src/compare.c:152
#2  0x0000636756b17323 in compare_cmd (cmd_info=<optimized out>)
    at /usr/src/vifm-0.12-1build2/src/cmd_handlers.c:2021
#3  0x0000636756b15b5f in vle_cmds_run (cmd=0x63678407aa24 "") at engine/cmds.c:302
#4  execute_command (view=0x636756bb7020 <rwin>, command=<optimized out>, menu=0)
    at /usr/src/vifm-0.12-1build2/src/cmd_core.c:548
#5  0x0000636756b16a4b in exec_commands (cmdline=<optimized out>, view=0x636756bb7020 <rwin>,
    type=CIT_COMMAND) at /usr/src/vifm-0.12-1build2/src/cmd_core.c:820
#6  0x0000636756adbb9b in cmd_return (key_info=..., keys_info=<optimized out>)
    at modes/cmdline.c:1354
#7  0x0000636756b71d36 in execute_mapping_handler.isra.0 (key_info=..., keys_info=0x7ffee7b65eb0,
    info=<optimized out>) at engine/keys.c:1223
#8  0x0000636756a8ea69 in dispatch_key (key_info=..., keys_info=keys_info@entry=0x7ffee7b65eb0,
    curr=curr@entry=0x636784015930, keys=0x7ffee7b66024 L"") at engine/keys.c:693
#9  0x0000636756a8f123 in execute_next_keys (curr=curr@entry=0x636784015930,
    keys=keys@entry=0x7ffee7b66024 L"", key_info=key_info@entry=0x7ffee7b65df0,
    keys_info=keys_info@entry=0x7ffee7b65eb0, has_duplicate=<optimized out>,
    no_remap=no_remap@entry=0) at engine/keys.c:659
#10 0x0000636756a8f5bc in dispatch_keys_at_root (keys=<optimized out>, keys_info=0x7ffee7b65eb0,
    root=0x63678400e4f0, key_info=..., no_remap=0) at engine/keys.c:466
#11 0x0000636756b672bf in dispatch_keys.constprop.0 (keys=<optimized out>,
    keys@entry=0x7ffee7b66020 L"\r", keys_info=keys_info@entry=0x7ffee7b65eb0,
    no_remap=no_remap@entry=0, prev_count=-1) at engine/keys.c:352
#12 0x0000636756a8e996 in execute_keys_general (keys=0x7ffee7b66020 L"\r",
    timed_out=<optimized out>, mapped=0, no_remap=0) at engine/keys.c:319
#13 0x0000636756b2d94a in execute_keys_general_wrapper (mapped=0, no_remap=0, timed_out=0,
    keys=0x7ffee7b66020 L"\r") at engine/keys.c:299
#14 vle_keys_exec (keys=0x7ffee7b66020 L"\r") at engine/keys.c:267
#15 event_loop (quit=0x636756b901c0 <quit>) at /usr/src/vifm-0.12-1build2/src/event_loop.c:245
#16 0x0000636756b6581c in vifm_main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/vifm-0.12-1build2/src/vifm.c:355
#17 0x0000636756a7cc3d in main (argc=<optimized out>, argv=<optimized out>)
    at /usr/src/vifm-0.12-1build2/src/vifm.c:120

I'm glad to give further context or help with testing if that would be helpful.

Version: 0.12
Git info: built out of repository

Support of extended keys is on
Parsing of .desktop files is enabled
Without GTK+ library
With magic library
With X11 library
With dynamic loading of X11 library
With file program
With -n option for cp and mv
With remote command execution
xaizek commented 5 days ago

Thanks for the backtrace, it makes things simpler.

vifm-0.12-1build2

It probably tried to allocate too much memory and either failed immediately or later when ran out of RAM. The code has changed in v0.13 to allocate much less memory and also correctly handle out of memory situation, so this should be fixed already.