Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 700708 - app-misc/mc-4.8.23-r1 segfaults or starts to misbehave after opening .zip or .rar archive
Summary: app-misc/mc-4.8.23-r1 segfaults or starts to misbehave after opening .zip or ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Sergei Trofimovich (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-19 19:47 UTC by Paul Osmialowski
Modified: 2019-11-21 14:12 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Osmialowski 2019-11-19 19:47:59 UTC
I've received ZIP archive by e-mail, opened it in mc, and soon after that mc segfaulted. Few days later, I downloaded RAR archive from this address: https://srv-file7.gofile.io/download/Zcf75H/_CPM.rar 
opened it, and mc started to misbehave. I killed it, opened the same RAR archive again and this time mc segfaulted.


Reproducible: Always

Steps to Reproduce:
1. Download RAR archive
2. Open in mc
3. Try to use it, view files, copy them to local directory
Actual Results:  
A crash after a while or misbehave (as if mc was haunted)

Expected Results:  
No crash, normal operation.

Portage 2.3.76 (python 2.7.16-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-9.2.0, glibc-2.29-r2, 4.19.82-gentoo x86_64)
=================================================================
System uname: Linux-4.19.82-gentoo-x86_64-Intel-R-_Core-TM-_i7-6700_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:    16399188 total,   5514028 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Mon, 18 Nov 2019 09:00:01 +0000
Head commit of repository gentoo: 0321db0109929cb1a892be35f089eb2ba0fd3c0c
sh bash 4.4_p23-r1
ld GNU gold (Gentoo 2.32 p2 2.32.0) 1.16
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.16::gentoo, 3.5.7::gentoo, 3.6.9::gentoo, 3.7.3::gentoo
dev-util/cmake:           3.14.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.10.3-r3::gentoo, 1.11.6-r3::gentoo, 1.12.6::gentoo, 1.13.4-r2::gentoo, 1.14.1::gentoo, 1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            9.2.0-r2::gentoo
sys-devel/gcc-config:     2.1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24

telred
    location: /var/lib/layman/telred
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.3/conf /usr/share/maven-bin-3.6/conf /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.3/ext-active/ /etc/php/cgi-php7.3/ext-active/ /etc/php/cli-php7.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core2 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="C"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="pl"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2019-11-20 10:46:11 UTC
"You are not authorized to download this file."
Comment 2 Paul Osmialowski 2019-11-20 11:11:56 UTC
Ok, the link was taken from this message on some Spanish forum:


https://www.va-de-retro.com/foros/viewtopic.php?f=18&t=8207#p145656

The link to _CPM.rar file originally looked like this:

https://gofile.io/?c=Zcf75H

...which resolved to the link (which also remained in Chrome's history) that you could not access.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-20 20:39:24 UTC
I'll try to reproduce locally.

id you manage to get a core dump and a backtrace from mc? https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-20 20:44:13 UTC
Oh, getting myself a nice crash on exit from mc:

(gdb) bt
#0  0x000055c987f410a8 in vfs_stamp_compare (a=0x0, b=0x7ffcf6717340) at gc.c:130
#1  0x00007fb5f7e12381 in g_slist_find_custom (list=0x55c9893c9840 = {...}, data=data@entry=0x7ffcf6717340, func=func@entry=0x55c987f410a0 <vfs_stamp_compare>)
    at ../glib-2.60.7/glib/gslist.c:729
#2  0x000055c987f410fd in vfs_stamp (v=v@entry=0x55c988071600 <extfs_subclass>, id=id@entry=0x55c989420100) at gc.c:165
#3  0x000055c987fc9493 in extfs_get_path (vpath=<optimized out>, archive=archive@entry=0x7ffcf6717488, flags=flags@entry=0) at extfs.c:699
#4  0x000055c987fca228 in extfs_open (vpath=<optimized out>, flags=flags@entry=0, mode=mode@entry=0) at extfs.c:896
#5  0x000055c987fca4a2 in extfs_ungetlocalcopy (vpath=<optimized out>, local=0x55c9893f6120, has_changed=0) at extfs.c:1403
#6  0x000055c987fc81c5 in extfs_free_archive (me=<optimized out>, psup=0x55c989424310) at extfs.c:380
#7  0x000055c987f843e0 in vfs_s_free_super (me=0x55c988071600 <extfs_subclass>, super=0x55c989424310) at direntry.c:351
#8  0x000055c987f4141f in vfs_expire (now=1) at gc.c:282
#9  vfs_expire (now=1) at gc.c:251
#10 0x000055c987f71f9b in vfs_shut () at vfs.c:500
#11 0x000055c987f30444 in main (argc=<optimized out>, argv=<optimized out>) at main.c:421

Looks like file list is corrupted. Looking.
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-21 07:36:42 UTC
mc-9999 seems to work better. I failed at bisecting into a fix as master is quite broken in intermediate commits. Will try to bisect into failure.
Comment 6 Larry the Git Cow gentoo-dev 2019-11-21 09:41:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9bebf5560d10a6264e05cdb38ebca50978b5aef8

commit 9bebf5560d10a6264e05cdb38ebca50978b5aef8
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2019-11-21 09:41:27 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2019-11-21 09:41:42 +0000

    app-misc/mc: fix VFS SEGV in GC, bug #700708
    
    Paul reports that nested archives cause corruption
    of mc's data structures.
    
    Picked upstream patch that avoids dereference of stale entries.
    
    Reported-by: Paul Osmialowski
    Closes: https://bugs.gentoo.org/700708
    Package-Manager: Portage-2.3.79, Repoman-2.3.18
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 app-misc/mc/files/mc-4.8.23-vfs-gc-SEGV.patch |  37 ++++++++
 app-misc/mc/mc-4.8.23-r2.ebuild               | 116 ++++++++++++++++++++++++++
 2 files changed, 153 insertions(+)
Comment 7 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-21 09:42:41 UTC
Please give 4.8.23-r2 a try. It fixes at least exit-time crash for me.
Comment 8 Paul Osmialowski 2019-11-21 14:12:11 UTC
app-misc/mc-4.8.23-r2 seems OK, I guess you can stabilize it, at least for amd64.