Ticket #4398 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Crash with quick view enabled when hovering .ods files

Reported by: krop Owned by: andrew_b
Priority: major Milestone: 4.8.29
Component: mc-core Version: 4.8.28
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Using mc package from openSUSE Tumbleweed.

With default settings, F3 works to view the ODS file (created with libreoffice sheets), but with the right panel set up to show a quick view, MC crashes and prints a buffer overflow message.

I already tried deleting the local settings and cache

# LC_MESSAGES=C mc -V

GNU Midnight Commander 4.8.28
Built with GLib 2.72.2
Built with S-Lang 2.3.2 with terminfo database
Built with libssh2 1.10.0
With builtin Editor
With subshell support as default
With support for background operations
With mouse support on xterm and Linux console
With support for X11 events
With internationalization support
With multiple codepages support
With ext2fs attributes support
Virtual File Systems:
 cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs
Data types:
 char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;


# LC_MESSAGES=C mc -F

Home directory: /home/krop
Profile root directory: /home/krop

[System data]
    Config directory: /etc/mc/
    Data directory:   /usr/share/mc/
    File extension handlers: /usr/libexec/mc/ext.d/
    VFS plugins and scripts: /usr/libexec/mc/
        extfs.d:        /usr/libexec/mc/extfs.d/

[User data]
    Config directory: /home/krop/.config/mc/
    Data directory:   /home/krop/.local/share/mc/
        skins:          /home/krop/.local/share/mc/skins/
        extfs.d:        /home/krop/.local/share/mc/extfs.d/
        mcedit macros:  /home/krop/.local/share/mc/mc.macros
        mcedit external macros: /home/krop/.local/share/mc/mcedit/macros.d/macro.*
    Cache directory:  /home/krop/.cache/mc/

# mc --configure-options

 '--host=x86_64-suse-linux-gnu' '--build=x86_64-suse-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--localstatedir=/var/lib' '--enable-charset' '--disable-vfs-fish' 'build_alias=x86_64-suse-linux-gnu' 'host_alias=x86_64-suse-linux-gnu' 'CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -W -Wall -Wstrict-prototypes -Wpointer-arith -Wformat-security -Wno-unused-parameter' 'LDFLAGS=-flto=auto' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'


(gdb) bt

#0  0x00007f9e65cd76bc in __pthread_kill_implementation () from /lib64/libc.so.6
#1  0x00007f9e65c846f6 in raise () from /lib64/libc.so.6
#2  0x00007f9e65c6d814 in abort () from /lib64/libc.so.6
#3  0x00007f9e65cca79e in __libc_message () from /lib64/libc.so.6
#4  0x00007f9e65d6f89a in __fortify_fail () from /lib64/libc.so.6
#5  0x00007f9e65d6de96 in __chk_fail () from /lib64/libc.so.6
#6  0x0000557e5ae7b15c in memcpy (__len=3, __src=0x557e5aeb9584 <replch>, __dest=0x557e5af15a90) at /usr/include/bits/string_fortified.h:29
#7  str_utf8_make_make_term_form (text=0x557e5c457bcd '\272' <repeats 200 times>..., length=length@entry=18446744073709551615) at ../lib/strutil/strutilutf8.c:498
#8  0x0000557e5ae7b250 in str_utf8_term_width2 (length=18446744073709551615, text=<optimized out>) at ../lib/strutil/strutilutf8.c:803
#9  str_utf8_term_width1 (text=<optimized out>) at ../lib/strutil/strutilutf8.c:812
#10 0x0000557e5ae792ac in str_term_width1 (text=0x557e5c45711c '\272' <repeats 200 times>...) at ../lib/strutil/strutil.c:655
#11 str_msg_term_size (text=<optimized out>, lines=0x7ffc5b0ed248, columns=0x7ffc5b0ed24c) at ../lib/strutil/strutil.c:948
#12 0x0000557e5ae959ab in query_dialog (header=header@entry=0x557e5aeb2b39 "Error", 
    text=text@entry=0x557e5c4525d0 "\nSFS virtual file system:\ngzip: stdin has more than one entry--rest ignored\n", '\272' <repeats 124 times>..., flags=flags@entry=1, count=count@entry=0)
    at ../lib/widget/wtools.c:304
#13 0x0000557e5ae96415 in do_create_message (flags=1, title=title@entry=0x557e5aeb2b39 "Error", 
    text=text@entry=0x557e5c4550a0 "SFS virtual file system:\ngzip: stdin has more than one entry--rest ignored\n", '\272' <repeats 125 times>...) at ../lib/widget/wtools.c:127
#14 0x0000557e5ae9646e in fg_message (flags=<optimized out>, title=title@entry=0x557e5aeb2b39 "Error", 
    text=text@entry=0x557e5c4550a0 "SFS virtual file system:\ngzip: stdin has more than one entry--rest ignored\n", '\272' <repeats 125 times>...) at ../lib/widget/wtools.c:150
#15 0x0000557e5ae9665f in message (flags=<optimized out>, title=0x557e5aeb2b39 "Error", text=<optimized out>) at ../lib/widget/wtools.c:433
#16 0x0000557e5ae23ec0 in sfs_vfmake (vpath=<optimized out>, cache_vpath=0x557e5c43d050) at vfs/sfs/sfs.c:241
#17 0x0000557e5ae240c2 in sfs_redirect (vpath=0x557e5c43c670) at vfs/sfs/sfs.c:275
#18 0x0000557e5ae241ba in sfs_open (vpath=<optimized out>, flags=<optimized out>, mode=0) at vfs/sfs/sfs.c:300
#19 0x0000557e5ae82d0a in mc_open (vpath=<optimized out>, flags=<optimized out>) at ../lib/vfs/interface.c:215
#20 0x0000557e5ae2e673 in mcview_load (view=0x557e5c434500, command=0x0, file=0x557e5c4446f0 "rename.ods", start_line=0, search_start=0, search_end=0) at viewer/mcviewer.c:394
#21 0x0000557e5ae6d0a0 in mcview_hook (v=0x557e5c434500) at viewer/actions_cmd.c:195
#22 mcview_hook (v=0x557e5c434500) at viewer/actions_cmd.c:170
#23 0x0000557e5ae735d6 in execute_hooks (hook_list=<optimized out>) at ../lib/hook.c:89
#24 0x0000557e5ae1ed1d in move_down (panel=0x557e5c434850) at filemanager/panel.c:2112
#25 chdir_other_panel (panel=<optimized out>) at filemanager/panel.c:2908
#26 panel_execute_cmd (panel=0x557e5c434850, command=<optimized out>) at filemanager/panel.c:3444
#27 0x0000557e5ae8c0ec in send_message (data=0x0, parm=403, msg=MSG_KEY, sender=0x0, w=<optimized out>) at ../lib/widget/../../lib/widget/widget-common.h:254
#28 group_handle_key (key=403, g=0x557e5c4178e0) at ../lib/widget/group.c:508
#29 group_default_callback (w=0x557e5c4178e0, sender=<optimized out>, msg=<optimized out>, parm=403, data=<optimized out>) at ../lib/widget/group.c:640
#30 0x0000557e5ae8c65c in dlg_key_event (d_key=403, h=0x557e5c4178e0) at ../lib/widget/dialog.c:251
#31 dlg_process_event (h=0x557e5c4178e0, key=403, event=<optimized out>) at ../lib/widget/dialog.c:566
#32 0x0000557e5ae8c989 in frontend_dlg_run (h=0x557e5c4178e0) at ../lib/widget/dialog.c:320
#33 0x0000557e5adfaf47 in dlg_run (h=0x557e5c4178e0) at ../lib/widget/dialog.c:600
#34 do_nc () at filemanager/filemanager.c:1829
#35 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/mc-4.8.28-2.1.x86_64/src/main.c:455

Change History

comment:1 follow-up: ↓ 2 Changed 2 years ago by andrew_b

Could you please test this patch: [b156b53738ac9778d3d02be2e6bb24694b2729c5]?

comment:2 in reply to: ↑ 1 ; follow-up: ↓ 3 Changed 2 years ago by krop

Replying to andrew_b:

Could you please test this patch: [b156b53738ac9778d3d02be2e6bb24694b2729c5]?

Done, it no longer crashes but prints an error instead the first time the file is selected. ('SFS virtual file system: gzip: stdin has more than one entry--rest ignored').

Afterwards, it shows the file type in the preview.

Last edited 2 years ago by krop (previous) (diff)

comment:3 in reply to: ↑ 2 Changed 2 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.29

Replying to krop:

it no longer crashes

Branch: 4398-quicview_segfault
changeset:34acae6a85f68ca6b2e289ceb9e753ace50c9f3d

but prints an error instead the first time the file is selected. ('SFS virtual file system: gzip: stdin has more than one entry--rest ignored').

Probably, there is some problem in compressed type detection. ods is zip'd file, not gzip'd one.

Afterwards, it shows the file type in the preview.

That's correct for gzip'd file.

comment:4 Changed 2 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:5 Changed 2 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

comment:6 Changed 2 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.