Bug 2158164 - [abrt] mc: extfs_find_entry_int(): mc killed by SIGSEGV
Summary: [abrt] mc: extfs_find_entry_int(): mc killed by SIGSEGV
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: mc
Version: 38
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:7f9327938e7c9155bd4cc0c58b3...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-04 12:16 UTC by Mikhail
Modified: 2023-02-07 15:04 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
File: proc_pid_status (1.40 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: maps (3.95 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: limits (1.29 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: environ (3.29 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: open_fds (814 bytes, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: mountinfo (3.40 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: os_info (770 bytes, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: cpuinfo (2.97 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: core_backtrace (5.25 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: exploitable (81 bytes, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: dso_list (774 bytes, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
File: backtrace (29.06 KB, text/plain)
2023-01-04 12:17 UTC, Mikhail
no flags Details
archive which caused this crash (3.39 MB, application/zip)
2023-01-04 12:18 UTC, Mikhail
no flags Details
screenshot (79.30 KB, image/png)
2023-01-04 14:33 UTC, Mikhail
no flags Details
PowerZip screenshot (1.27 MB, image/png)
2023-01-05 02:11 UTC, Mikhail
no flags Details

Description Mikhail 2023-01-04 12:16:57 UTC
Description of problem:
It happening when I try list content of archive retromod_digital_1_demo_content_v1_install_script.zip

Version-Release number of selected component:
mc-1:4.8.28-3.fc37

Additional info:
reporter:       libreport-2.17.6
type:           CCpp
reason:         mc killed by SIGSEGV
journald_cursor: s=b4a46d32f9cb494fb977313b87857e14;i=3338d0;b=071ed2dcf12d44d9b4ba8c0ca0c7c07e;m=c39d90807;t=5f16f1711f975;x=7fa52feff52d116b
executable:     /usr/bin/mc
cmdline:        /usr/bin/mc -P /var/tmp/mc-mikhail/mc.pwd.39807
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-8c7cfe1c-ea5c-4051-94d8-75595ef3b594.scope
rootdir:        /
uid:            1000
kernel:         6.2.0-0.rc2.20230103git69b41ac87e4a.19.fc38.x86_64
package:        mc-1:4.8.28-3.fc37
runlevel:       N 5
backtrace_rating: 4
crash_function: extfs_find_entry_int
comment:        It happening when I try list content of archive retromod_digital_1_demo_content_v1_install_script.zip

Truncated backtrace:
Thread no. 1 (27 frames)
 #0 extfs_find_entry_int at vfs/extfs/extfs.c:257
 #1 extfs_find_entry at vfs/extfs/extfs.c:314
 #2 extfs_add_file at vfs/extfs/extfs.c:434
 #3 extfs_read_archive at vfs/extfs/extfs.c:683
 #4 extfs_open_and_read_archive at vfs/extfs/extfs.c:753
 #5 extfs_get_path at vfs/extfs/extfs.c:803
 #6 extfs_opendir at vfs/extfs/extfs.c:1151
 #7 extfs_chdir at vfs/extfs/extfs.c:1466
 #8 mc_chdir at ../lib/vfs/interface.c:678
 #9 panel_do_cd_int at filemanager/panel.c:3271
 #10 panel_do_cd at filemanager/panel.c:4649
 #11 panel_cd at filemanager/panel.c:5053
 #12 exec_extension_cd at filemanager/ext.c:411
 #13 exec_extension at filemanager/ext.c:446
 #14 regex_command_for at filemanager/ext.c:1033
 #15 regex_command at filemanager/ext.h:30
 #16 do_enter_on_file_entry.isra.0 at filemanager/panel.c:2813
 #17 do_enter at filemanager/panel.c:2864
 #18 panel_execute_cmd at filemanager/panel.c:3456
 #19 send_message at ../lib/widget/../../lib/widget/widget-common.h:254
 #20 group_handle_key at ../lib/widget/group.c:508
 #21 group_default_callback at ../lib/widget/group.c:640
 #22 dlg_key_event at ../lib/widget/dialog.c:251
 #23 dlg_process_event at ../lib/widget/dialog.c:566
 #24 frontend_dlg_run at ../lib/widget/dialog.c:320
 #25 dlg_run at ../lib/widget/dialog.c:600
 #26 do_nc at filemanager/filemanager.c:1829

Comment 1 Mikhail 2023-01-04 12:17:02 UTC
Created attachment 1935707 [details]
File: proc_pid_status

Comment 2 Mikhail 2023-01-04 12:17:03 UTC
Created attachment 1935708 [details]
File: maps

Comment 3 Mikhail 2023-01-04 12:17:05 UTC
Created attachment 1935709 [details]
File: limits

Comment 4 Mikhail 2023-01-04 12:17:06 UTC
Created attachment 1935710 [details]
File: environ

Comment 5 Mikhail 2023-01-04 12:17:07 UTC
Created attachment 1935711 [details]
File: open_fds

Comment 6 Mikhail 2023-01-04 12:17:09 UTC
Created attachment 1935712 [details]
File: mountinfo

Comment 7 Mikhail 2023-01-04 12:17:10 UTC
Created attachment 1935713 [details]
File: os_info

Comment 8 Mikhail 2023-01-04 12:17:12 UTC
Created attachment 1935714 [details]
File: cpuinfo

Comment 9 Mikhail 2023-01-04 12:17:13 UTC
Created attachment 1935715 [details]
File: core_backtrace

Comment 10 Mikhail 2023-01-04 12:17:15 UTC
Created attachment 1935716 [details]
File: exploitable

Comment 11 Mikhail 2023-01-04 12:17:16 UTC
Created attachment 1935717 [details]
File: dso_list

Comment 12 Mikhail 2023-01-04 12:17:19 UTC
Created attachment 1935718 [details]
File: backtrace

Comment 13 Mikhail 2023-01-04 12:18:57 UTC
Created attachment 1935719 [details]
archive which caused this crash

Comment 14 Jindrich Novy 2023-01-04 13:52:50 UTC
Hi Mikhail, does a file in your archive start with ".." - two dots in its name?

Comment 15 Mikhail 2023-01-04 14:33:48 UTC
Created attachment 1935750 [details]
screenshot

(In reply to Jindrich Novy from comment #14)
> Hi Mikhail, does a file in your archive start with ".." - two dots in its
> name?

Yes, but not idea how it's possible. It not mine archive, I downloaded it from tracktion.com site.

https://cdn.tracktion.com/file/tracktiondownloader/retromod/digital1/content/10/demo/retromod_digital_1_demo_content_v1_install_script.zip?Authorization=3_20230104143111_0859a4d4a662579e1ec353a5_d037d232b5e580141e0b5c6fca1a4ef02b500125_001_20230105023111_0033_dnld

Comment 16 Jindrich Novy 2023-01-04 15:17:16 UTC
Wrote a simple patch to "fix" this:

diff -up mc-4.8.28/src/vfs/extfs/extfs.c.jnovy mc-4.8.28/src/vfs/extfs/extfs.c
--- mc-4.8.28/src/vfs/extfs/extfs.c.jnovy	2022-03-27 13:54:06.000000000 +0200
+++ mc-4.8.28/src/vfs/extfs/extfs.c	2023-01-04 15:55:08.081396288 +0100
@@ -254,8 +254,15 @@ extfs_find_entry_int (struct vfs_s_inode
         *q = '\0';
 
         if (DIR_IS_DOTDOT (p))
-            pent = pent->dir->ent;
-        else
+        {
+            if (pent->dir)
+            {
+              pent = pent->dir->ent;
+            } else
+            {
+              pent = NULL;
+            }
+        } else
         {
             GList *pl;

But ultimately I suggest to contact upstream - and report it there given it's so easily reproducible: http://midnight-commander.org/report

Comment 17 Jindrich Novy 2023-01-04 15:43:53 UTC
Just created the upstream report here: https://midnight-commander.org/ticket/4422

Comment 18 Mikhail 2023-01-05 02:11:35 UTC
Created attachment 1935826 [details]
PowerZip screenshot

(In reply to Jindrich Novy from comment #16)
> Wrote a simple patch to "fix" this:
> 
> diff -up mc-4.8.28/src/vfs/extfs/extfs.c.jnovy
> mc-4.8.28/src/vfs/extfs/extfs.c
> --- mc-4.8.28/src/vfs/extfs/extfs.c.jnovy	2022-03-27 13:54:06.000000000 +0200
> +++ mc-4.8.28/src/vfs/extfs/extfs.c	2023-01-04 15:55:08.081396288 +0100
> @@ -254,8 +254,15 @@ extfs_find_entry_int (struct vfs_s_inode
>          *q = '\0';
>  
>          if (DIR_IS_DOTDOT (p))
> -            pent = pent->dir->ent;
> -        else
> +        {
> +            if (pent->dir)
> +            {
> +              pent = pent->dir->ent;
> +            } else
> +            {
> +              pent = NULL;
> +            }
> +        } else
>          {
>              GList *pl;
 
After applying this patch I am unable to enter in this archive with mc. So it still looks like an error. If displaying ".." is problematic, you can replace them with the word "__Parent__". This is what some archivators on MacOS do, for example PowerZip.

Comment 19 Tomasz Kłoczko 2023-01-05 03:32:55 UTC
(In reply to Jindrich Novy from comment #16)
> Wrote a simple patch to "fix" this:
> 
> diff -up mc-4.8.28/src/vfs/extfs/extfs.c.jnovy
> mc-4.8.28/src/vfs/extfs/extfs.c
> --- mc-4.8.28/src/vfs/extfs/extfs.c.jnovy	2022-03-27 13:54:06.000000000 +0200
> +++ mc-4.8.28/src/vfs/extfs/extfs.c	2023-01-04 15:55:08.081396288 +0100
> @@ -254,8 +254,15 @@ extfs_find_entry_int (struct vfs_s_inode
>          *q = '\0';
>  
>          if (DIR_IS_DOTDOT (p))
> -            pent = pent->dir->ent;
> -        else
> +        {
> +            if (pent->dir)
> +            {
> +              pent = pent->dir->ent;
> +            } else
> +            {
> +              pent = NULL;
> +            }
> +        } else
>          {
>              GList *pl;
> 
> But ultimately I suggest to contact upstream - and report it there given
> it's so easily reproducible: http://midnight-commander.org/report

{leasse submit that patch as PR on https://github.com/MidnightCommander/mc/

Comment 20 Yury V. Zaytsev 2023-01-05 19:24:19 UTC
(In reply to Tomasz Kłoczko from comment #19)

> > But ultimately I suggest to contact upstream - and report it there given
> > it's so easily reproducible: http://midnight-commander.org/report
> 
> {leasse submit that patch as PR on https://github.com/MidnightCommander/mc/

Please don't do this, we ask to use our bug tracker instead of PRs on GitHub.

Comment 21 Tomasz Kłoczko 2023-01-06 16:09:59 UTC
> Please don't do this, we ask to use our bug tracker instead of PRs on GitHub.

This is not about tracking bug but about evaluating proposed fix by mc maintainer.

Comment 22 Yury V. Zaytsev 2023-01-06 16:21:39 UTC
(In reply to Tomasz Kłoczko from comment #21)
> > Please don't do this, we ask to use our bug tracker instead of PRs on GitHub.
> 
> This is not about tracking bug but about evaluating proposed fix by mc
> maintainer.

I *am* the maintainer and I'm kindly asking you to please NOT encourage others send us PRs, but send patches to our tracker instead if necessary instead.

Comment 23 Ben Cotton 2023-02-07 15:04:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.


Note You need to log in before you can comment on or make changes to this bug.