Bug 803489

Summary: MC seems to block itself on select
Product: [Fedora] Fedora Reporter: Zdenek Kabelac <zkabelac>
Component: mcAssignee: Slava Zanko <slavazanko>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dvlasenk, jpokorny, pahan, rvokal, slavazanko
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 10:05:23 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
bt full from blocked mc
none
Evidence that local-side terminal is working correctly none

Description Zdenek Kabelac 2012-03-14 20:05:51 UTC
Description of problem:

I've started 'mc' and just noticed black (reset) terminal screen with hint text written on bottom - and nothing seemed to be moving on.
I've killed 'mc' with abort and here is bt:


(gdb) bt
#0  0x00007f5e9c4d5363 in __select_nocancel () at ../sysdeps/unix/syscall-template.S:82
#1  0x00000000004155f4 in feed_subshell (how=how@entry=0, fail_on_error=fail_on_error@entry=0) at subshell.c:503
#2  0x000000000041686d in do_subshell_chdir (directory=<optimized out>, update_prompt=<optimized out>, reset_prompt=1)
    at subshell.c:1218
#3  0x000000000047bfe2 in panel_callback (w=0x1173040, msg=<optimized out>, parm=<optimized out>) at panel.c:3058
#4  0x00000000004414fd in send_message (parm=0, msg=WIDGET_FOCUS, w=0x1173040) at ../../lib/widget/widget-common.h:132
#5  dlg_focus (h=h@entry=0x1161210) at dialog.c:919
#6  0x00000000004415da in do_select_widget (h=0x1161210, w=0x115aa80 = {...}, dir=SELECT_EXACT) at dialog.c:229
#7  0x0000000000441742 in dlg_select_widget (w=<optimized out>) at dialog.c:989
#8  0x00000000004720c4 in midnight_callback (h=<optimized out>, sender=<optimized out>, msg=<optimized out>, parm=<optimized out>, 
    data=<optimized out>) at midnight.c:1365
#9  0x0000000000442154 in frontend_run_dlg (h=0x1161210) at dialog.c:544
#10 run_dlg (h=0x1161210) at dialog.c:1158
#11 0x0000000000473125 in create_panels_and_run_mc () at midnight.c:904
#12 do_nc () at midnight.c:1660
#13 0x000000000040e3e5 in main (argc=<optimized out>, argv=<optimized out>) at main.c:516


Version-Release number of selected component (if applicable):
mc-4.8.1-3.fc17.x86_64

How reproducible:
Not really sure - for long time I've not noticed any problem with 'mc'
so this lock just somehow happened to me.

Is there something I could do better next time when I'll spot such problem?

Steps to Reproduce:
1. 
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Slava Zanko 2012-03-15 09:53:18 UTC
What terminal emulator you use? 
What shell (bash, ash, zsh etc)? 
Is this behaviour constantly repeated or was raised just once?

Comment 2 Zdenek Kabelac 2012-03-15 10:28:02 UTC
Just seen this once -  with gnome-terminal & bash  - as is present in current rawhide.

bash-4.2.20-4.fc17.x86_64
gnome-terminal-3.3.0-1.fc17.x86_64

Comment 3 Zdenek Kabelac 2012-03-20 17:16:45 UTC
Created attachment 571482 [details]
bt full from blocked mc

Happened to me again - here is bt full attached to running process.
Though probably not any more helpful then original posting.

Comment 4 Slava Zanko 2012-03-20 18:25:30 UTC
Try to update mc from http://koji.fedoraproject.org/koji/buildinfo?buildID=308420

Comment 5 Zdenek Kabelac 2012-04-24 12:32:24 UTC
Looks like it might be fixed - I've not seen mc problems for a while.

I'm using mc-4.8.2-1.fc18.x86_64.

Comment 6 Fedora Update System 2012-09-11 16:33:27 UTC
mc-4.8.5-1.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/mc-4.8.5-1.fc18

Comment 7 Fedora Update System 2012-09-11 16:38:36 UTC
mc-4.8.5-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/mc-4.8.5-1.fc17

Comment 8 Fedora Update System 2012-09-11 16:57:01 UTC
mc-4.8.5-1.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/mc-4.8.5-1.fc16

Comment 9 Fedora Update System 2012-09-11 19:10:28 UTC
Package mc-4.8.5-1.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing mc-4.8.5-1.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-13795/mc-4.8.5-1.fc18
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2012-09-20 20:32:51 UTC
mc-4.8.5-1.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 11 Fedora Update System 2012-09-21 23:55:35 UTC
mc-4.8.5-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Fedora Update System 2012-09-22 00:04:58 UTC
mc-4.8.5-1.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Jan Pokorný [poki] 2012-11-08 17:55:35 UTC
This happens to me rarely, too.  And not only in one environment,
the Gentoo one I also use suffers from this as well.

Right now, I've just encountered it in Fedora 17:

#0  0x0000003d82aea9c3 in __select_nocancel
    ()
    at ../sysdeps/unix/syscall-template.S:82
#1  0x0000000000415ee4 in feed_subshell
    (how=how@entry=0, fail_on_error=fail_on_error@entry=0)
    at subshell.c:503
        read_set = {fds_bits = {80, 0 <repeats 15 times>}}
        maxfdp = <optimized out>
        bytes = <optimized out>
        wtime = {tv_sec = 10, tv_usec = 0}
        wptr = 0x0
#2  0x000000000041714c in do_subshell_chdir
    (vpath=<optimized out>, update_prompt=<optimized out>, reset_prompt=1)
    at subshell.c:1230
        pcwd = 0x25dcf00 "/home/jpokorny/wrkspc/conga-pkgs/conga/"
                         "conga-0.12.2/luci/plone"
        directory = 0x2592400 "\300\006Y\002"

#3  0x00000000004830f2 in panel_callback
    (w=0x25bf0d0, msg=<optimized out>, parm=<optimized out>)
    at panel.c:3444
        panel = 0x25bf0d0
        bb = <optimized out>
#4  0x00000000004319de in send_message
    (parm=0, msg=WIDGET_FOCUS, w=0x25bf0d0)
    at ../../lib/widget/widget-common.h:136
#5  dlg_focus (h=h@entry=0x25bee60)
    at dialog.c:1022
        current = 0x25bf0d0
#6  0x0000000000431aba in do_select_widget
    (h=0x25bee60, w=0x25ace00 = {...}, dir=SELECT_NEXT)
    at dialog.c:227
        w0 = 0x25b1b60
#7  0x0000000000432560 in dlg_key_event
    (d_key=9, h=0x25bee60)
    at dialog.c:495
        handled = <optimized out>
#8  dlg_process_event
    (h=h@entry=0x25bee60, key=9, event=event@entry=0x7fffde314050)
    at dialog.c:1259
#9  0x0000000000432814 in frontend_run_dlg
    (h=0x25bee60)
    at dialog.c:569
        d_key = <optimized out>
        event = {buttons = 0 '\000', modifiers = 101 'e', vc = 113,
                 dx = 0, dy = 0, x = -1, y = 35,
                 type = (GPM_UP | GPM_SINGLE), clicks = 7526984,
                 margin = (unknown: 0), wdx = -9664, wdy = 114}
#10 run_dlg
    (h=0x25bee60)
    at dialog.c:1291
#11 0x0000000000479eaf in create_panels_and_run_mc
    ()
    at midnight.c:962
#12 do_nc
    ()
    at midnight.c:1770
        ret = <optimized out>
        midnight_colors = {10, 10, 10, 10, 10}
#13 0x000000000040f6cc in main
    (argc=1, argv=0x7fffde3142d8)
    at main.c:567
        error = 0x0
        exit_code = 1

Strace:
> Process 9450 attached
> select(7, [4 6], NULL, NULL, NULL

This is with:
    mc-4.8.6-1.fc17.x86_64
    bash-4.2.37-2.fc17.x86_64
    guake-0.4.4-4.fc17.x86_64
    vte-0.28.2-6.fc17.x86_64


As backtrace looks almost the same with Zdeněk's one, I am reopening
the bug.

Comment 14 Jan Pokorný [poki] 2013-01-11 13:39:12 UTC
I've hit this bug again after a while (so the reproducibility is extremely
low as you can see).  In my case, it always happened when I switched from
console mode (where I'd run some commands) back to mc panels (via Ctrl-O).

mc-4.8.6-2.fc17.x86_64
bash-4.2.39-2.fc17.x86_64
guake-0.4.4-6.fc17.x86_64
vte-0.28.2-6.fc17.x86_64
slang-2.2.4-3.fc17.x86_64

Is there any additional piece of information I can provide to allow
better investigation?

Comment 15 Jan Pokorný [poki] 2013-03-22 13:21:25 UTC
Huh, another hit;  backtrace and strace as per [comment 13],
packages still as per [comment 14].

Comment 16 Fedora End Of Life 2013-04-03 19:44:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 17 Jan Pokorný [poki] 2013-05-17 12:27:09 UTC
Haven't hit this since migration to F19 but it doesn't mean it's fixed
either :)  I'll give it some more time.

This might be totally unrelated bug, but let's mention it: [bug 811046]

Comment 18 Jan Pokorný [poki] 2013-05-17 12:27:51 UTC
err, migration to F18

Comment 19 Jan Pokorný [poki] 2013-06-24 21:19:42 UTC
Unfortunately this still persists in Fedora 18.  This time, I think I wanted to switch
between panels (TAB).  Resulting backtrace:

---

#0  __select_nocancel
    at ../sysdeps/unix/syscall-template.S:81
        No locals.

#1  feed_subshell
    (how=how@entry=0, fail_on_error=fail_on_error@entry=0)
    at subshell.c:503
        read_set = {
        fds_bits = {80, 0 <repeats 15 times>}
        }
        maxfdp = <optimized out>
        bytes = <optimized out>
        i = <optimized out>
        wtime = {
        tv_sec = 10,
        tv_usec = 0
        }
        wptr = 0x0

#2  do_subshell_chdir
    (vpath=<optimized out>, update_prompt=<optimized out>, reset_prompt=1)
    at subshell.c:1237
        pcwd = 0x297f000 "/home/jpokorny/wrkspc/gbrew/el5-closed/conga"
        directory = 0x2972500 "@\241\231\002"

#3  panel_callback
    (w=0x2970f30, sender=<optimized out>, msg=<optimized out>,
    parm=<optimized out>, data=<optimized out>)
    at panel.c:3455
        panel = 0x2970f30
        bb = <optimized out>

#4  send_message
    (data=0x0, parm=0, msg=MSG_FOCUS, sender=0x0, w=0x2970f30)
    at ../../lib/widget/widget-common.h:156
        No locals.

#5  dlg_focus
    (h=h@entry=0x2966090)
    at dialog.c:1010
        current = 0x2970f30

#6  do_select_widget
    (h=0x2966090, w=0x296fc20 = {...}, dir=SELECT_NEXT)
    at dialog.c:227
        w0 = 0x296c660

#7  change_panel
    at midnight.c:1711
        No locals.

#8  chdir_other_panel
    (panel=0x2970f30)
    at panel.c:2676
        entry = <optimized out>
        new_dir_vpath = <optimized out>
        sel_entry = <optimized out>

#9  panel_execute_cmd
    (panel=panel@entry=0x2970f30, command=<optimized out>)
    at panel.c:3230
        res = 1

#10 panel_key
    (key=<optimized out>, panel=0x2970f30)
    at panel.c:3397
        i = <optimized out>

#11 panel_callback
    (w=0x2970f30, sender=<optimized out>, msg=<optimized out>,
    parm=<optimized out>, data=<optimized out>)
    at panel.c:3477
        panel = 0x2970f30
        bb = <optimized out>

#12 send_message
    (data=0x0, parm=8303, msg=MSG_KEY, sender=0x0, w=<optimized out>)
    at ../../lib/widget/widget-common.h:156
        No locals.

#13 dlg_key_event
    (d_key=8303, h=0x2966090)
    at dialog.c:515
        handled = MSG_NOT_HANDLED

#14 dlg_process_event
    (h=h@entry=0x2966090, key=8303, event=event@entry=0x7fff42fcc870)
    at dialog.c:1244
        No locals.

#15 frontend_run_dlg
    (h=0x2966090)
    at dialog.c:568
        d_key = <optimized out>
        event = {
        buttons = 240 '\360',
        modifiers = 34 '"',
        vc = 113,
        dx = 0,
        dy = 0,
        x = -1,
        y = 112,
        type = (unknown: 0),
        clicks = 7420504,
        margin = (unknown: 0),
        wdx = 14928,
        wdy = 113
        }

#16 run_dlg
    (h=0x2966090)
    at dialog.c:1275
        No locals.

#17 create_panels_and_run_mc
    at midnight.c:964
        No locals.

#18 do_nc
    at midnight.c:1775
        ret = <optimized out>
        midnight_colors = {10, 10, 10, 10, 10}

#19 main
    (argc=1, argv=0x7fff42fccaf8)
    at main.c:400
        error = 0x0
        config_migrated = 0
        config_migrate_msg = 0x0
        exit_code = 1
---

$ rpm -q mc glib slang
mc-4.8.7-3.fc18.x86_64
glib-1.2.10-37.fc18.x86_64
slang-2.2.4-5.fc18.x86_64

Comment 20 Jan Pokorný [poki] 2013-07-29 18:18:24 UTC
Starting to thing the problem is on the terminal side rather that in
mc and/or the libraries it depends on.  The reason is that it has just
happened to me with the same terminal setup in F18, but with the remote
(via SSH) mc in RHEL 6.

The backtrace of the "locked" mc in RHEL 6 (exact version below):

---

#0  __select_nocancel
    at ../sysdeps/unix/syscall-template.S:82
        No locals.

#1  feed_subshell
    (how=0, fail_on_error=<value optimized out>)
    at subshell.c:963
        read_set = {fds_bits = {80, 0 <repeats 15 times>}}
        maxfdp = <value optimized out>
        bytes = <value optimized out>
        wtime = {tv_sec = 10, tv_usec = 0}
        wptr = 0x0

#2  do_subshell_chdir
    (directory=<value optimized out>, do_update=<value optimized out>,
    reset_prompt=<value optimized out>)
    at subshell.c:827
        pcwd = <value optimized out>
        translate = <value optimized out>

#3  panel_callback
    (w=0x1a43830, msg=<value optimized out>, parm=<value optimized out>)
    at screen.c:2826
        panel = 0x1a43830
        bb = <value optimized out>

#4  send_message
    (h=0x1a34400)
    at ../src/dialog.h:235
        No locals.

#5  dlg_focus
    (h=0x1a34400)
    at dialog.c:404
        No locals.

#6  do_select_widget
    (h=0x1a34400, w=0x1a34750, dir=SELECT_NEXT)
    at dialog.c:502
        w0 = 0x1a4b700

#7  dlg_key_event
    (h=0x1a34400, key=<value optimized out>, event=<value optimized out>)
    at dialog.c:700
        handled = <value optimized out>

#8  dlg_process_event
    (h=0x1a34400, key=<value optimized out>, event=<value optimized out>)
    at dialog.c:823
        No locals.

#9  frontend_run_dlg
    (h=0x1a34400)
    at dialog.c:855
        d_key = <value optimized out>
        event = {buttons = 0 '\000', modifiers = 68 'D', vc = 419, dx
            = 0, dy = 0, x = -1, y = 16, type = 24, clicks = 27477504,
            margin = 0, wdx = 17, wdy = 0}

#10 run_dlg
    (h=0x1a34400)
    at dialog.c:870
        No locals.

#11 setup_panels_and_run_mc
    at main.c:1791
        No locals.

#12 do_nc
    at main.c:1889
        midnight_colors = {6, 6, 6, 6}

#13 main
    (argc=1, argv=0x7fff3233bcb8)
    at main.c:2216
        s = {st_dev = 0, st_ino = 219683099872, st_nlink =
            140734035639200, st_mode = 646514007, st_uid = 51, st_gid
            = 842251192, __pad0 = 32767, st_rdev = 4294967296,
        st_size = 0, st_blksize = 4215904, st_blocks = 191, st_atim =
            {tv_sec = 140734035639182, tv_nsec = 140734035639183},
            st_mtim = {tv_sec = 1, tv_nsec = 0},
        st_ctim = {tv_sec = 219689846760, tv_nsec = 0}, __unused =
            {4880960, 0, 4234131}}
        mc_dir = 0x1a1c220 "#c\225&3"
        error = 0x0
        isInitialized = 27378208

---

RHEL 6.4 quest (via SSH from Fedora 18):

$ rpm -q mc glibc slang
> mc-4.7.0.2-3.el6.x86_64
> glibc-2.12-1.107.el6.x86_64
> slang-2.2.1-1.el6.x86_64

Fedora 18 guest (from which I SSH'd to RHEL 6.4 VM):

$ rpm -q guake vte glibc glib pango bash --queryformat="%{NVR}\n" | uniq
guake-0.4.4-9.fc18
vte-0.28.2-7.fc18
glibc-2.16-33.fc18
glib-1.2.10-37.fc18
pango-1.32.3-2.fc18
bash-4.2.45-1.fc18

Comment 21 Jan Pokorný [poki] 2013-07-29 18:19:07 UTC
(s/thing/think)

Comment 22 Jan Pokorný [poki] 2013-07-29 18:51:28 UTC
Created attachment 780081 [details]
Evidence that local-side terminal is working correctly

re [comment 20]:
> Starting to think the problem is on the terminal side rather that in
> mc and/or the libraries it depends on.

Counter-argument based on what I've just observed while experimenting
with the situation as per [comment 20]:


On remote (RHEL) side, I've attached debugger to the mc process
and used:

(gdb) call system("cat")
> Detaching after fork from child process 24280.

Then, in the original local terminal window, I've observed the screen
has scrolled a few lines;  when stroking letter keys (asd...), I got
the feedback in this terminal as expected (see the attached screenshot).

Then again on RHEL side, I've killed the cat process and the local
terminal window has stopped responding again.

Hence I believe the problem is closer (not necessarily directly in it)
to mc.

Comment 23 Jan Pokorný [poki] 2013-09-30 20:37:36 UTC
Another hit with F18, analogous to [comment], [comment 13]
and [comment 20]:

#0  __select_nocancel
    at ../sysdeps/unix/syscall-template.S:81
        No locals.

#1  feed_subshell
    (how=how@entry=0, fail_on_error=fail_on_error@entry=0)
    at subshell.c:503
        read_set = {
        fds_bits = {80, 0 <repeats 15 times>}
        }
        maxfdp = <optimized out>
        bytes = <optimized out>
        i = <optimized out>
        wtime = {
        tv_sec = 10,
        tv_usec = 0
        }
        wptr = 0x0

#2  do_subshell_chdir
    (vpath=<optimized out>, update_prompt=<optimized out>, reset_prompt=1)
    at subshell.c:1237
        pcwd = 0x1b9c100 "/home/jpokorny/mnt/gigolo/public_html/misc
            /greasemonkey-scripts"
        directory = 0x1b9c6a0 "@\357\272\001"

#3  panel_callback
    (w=0x1b76400, sender=<optimized out>, msg=<optimized out>,
    parm=<optimized out>, data=<optimized out>)
    at panel.c:3455
        panel = 0x1b76400
        bb = <optimized out>

#4  send_message
    (data=0x0, parm=0, msg=MSG_FOCUS, sender=0x0, w=0x1b76400)
    at ../../lib/widget/widget-common.h:156
        No locals.

#5  dlg_focus
    (h=h@entry=0x1b74210)
    at dialog.c:1010
        current = 0x1b76400

#6  do_select_widget
    (h=0x1b74210, w=0x1b6dc40 = {...}, dir=SELECT_NEXT)
    at dialog.c:227
        w0 = 0x1b6d000

#7  dlg_key_event
    (d_key=9, h=0x1b74210)
    at dialog.c:494
        handled = <optimized out>

#8  dlg_process_event
    (h=h@entry=0x1b74210, key=9, event=event@entry=0x7fffc0720890)
    at dialog.c:1244
        No locals.

#9  frontend_run_dlg
    (h=0x1b74210)
    at dialog.c:568
        d_key = <optimized out>
        event = {
        buttons = 0 '\000',
        modifiers = 34 '"',
        vc = 113,
        dx = 0,
        dy = 0,
        x = -1,
        y = 20,
        type = (GPM_UP | GPM_SINGLE),
        clicks = 7420504,
        margin = (unknown: 0),
        wdx = 14928,
        wdy = 113
        }

#10 run_dlg
    (h=0x1b74210)
    at dialog.c:1275
        No locals.

#11 create_panels_and_run_mc
    at midnight.c:964
        No locals.

#12 do_nc
    at midnight.c:1775
        ret = <optimized out>
        midnight_colors = {10, 10, 10, 10, 10}

#13 main
    (argc=1, argv=0x7fffc0720b18)
    at main.c:400
        error = 0x0
        config_migrated = 0
        config_migrate_msg = 0x0
        exit_code = 1


mc-4.8.7-3.fc18
glibc-2.16-33.fc18
slang-2.2.4-5.fc18

guake-0.4.4-9.fc18
vte-0.28.2-7.fc18
glibc-2.16-33.fc18
glib-1.2.10-37.fc18
pango-1.32.3-2.fc18
bash-4.2.45-1.fc18

Comment 24 Jan Pokorný [poki] 2013-10-03 14:23:05 UTC
Just unintentionally reproduced the same as in [comment 24].

Having the oppurtunity, I've returned -1 from the frame #0,
which led to overall crash with this output being printed
on top of original mc screen:

> select (FD_SETSIZE, &read_set...):
> Inappropriate ioctl for device (25)

(the code for which is few lines below the location of frame #1)

Next time, I'll do more thorough investigation, but it looks
something was wrong in select as such (due to errno being 25,
or perhaps effect of some earlier call that hasn't been handled
properly, or the other way around, result of tcsetattr call).

The other idea is that "fail_on_error" flag passed to feed_subshell
should perhaps rather be set to allow for 10 seconds "watchdog"
timeout (-> fail early?).

Comment 25 Jan Pokorný [poki] 2013-11-12 21:34:29 UTC
Observed again.

Currently it looks there is some interference with vim, because pstree
shows (single lefmost vertical line omitted):

> |-bash(29510)---mc(10812)---bash(10815)---vim(18034)-+-{vim}(18038)
> |                                                    `-{vim}(18039)

while

$  ps a | grep 8034 | grep -v grep
> 18034 pts/33   Sl+    0:18 vim <FILE> cd <PATH>

where

<FILE> might be a file I was editing recently (and for some reason
       the "vim <FILE>" was kept at the beginning of actually used
       command line

and

<PATH> might be path I was located in in the current panel, where
       I was returning from plain command-line (C-O)

But this line of "mc fired cd command through actually used command
line before cleaning it properly first, causing all kinds of strange
interference mc vs this unexpectedly executed command line remnant
(e.g., closing descriptors only for plain 'cd' might not be worth it)"
is just my hypothesis of the moment.


For the record:


- in the feed_subshell (frame 1 as per above), the only fds being
  polled are:

(gdb) p mc_global.tty.subshell_pty
$10 = 4
(gdb) p subshell_pipe[READ]
$11 = 6

$ ls -al /proc/10812/fd/6
lr-x------. 1 jpokorny jpokorny 64 Nov 12 22:29 /proc/10812/fd/6 -> pipe:[20888871]
$ ls -al /proc/10812/fd/4
lrwx------. 1 jpokorny jpokorny 64 Nov 12 22:29 /proc/10812/fd/4 -> /dev/ptmx

Comment 26 Fedora End Of Life 2013-12-21 15:01:03 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 27 Fedora End Of Life 2014-02-05 22:45:17 UTC
Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 28 Jan Pokorný [poki] 2014-04-18 17:55:55 UTC
I've hit this in F20, too ... this time under tmux that might or might
not affect reproducibility.

Note that when compared to backtraces in [comment 0], [comment 13],
[comment 20], and [comment 23], a "s|run_dlg|dlg_run|g" renaming
occurred + there is now one extra frame:

> #3  subshell_chdir

calling

> #2  do_subshell_chdir


In full:

#0  __select_nocancel
    at ../sysdeps/unix/syscall-template.S:81
        No locals.

#1  feed_subshell
    (how=how@entry=0, fail_on_error=fail_on_error@entry=0)
    at subshell.c:506
        maxfdp = <optimized out>
        read_set = {
        fds_bits = {80, 0 <repeats 15 times>}
        }
        bytes = <optimized out>
        i = <optimized out>
        wtime = {
        tv_sec = 10,
        tv_usec = 0
        }
        wptr = 0x0

#2  do_subshell_chdir
    (vpath=vpath@entry=0x12a7c40, update_prompt=update_prompt@entry=0)
    at subshell.c:1205
        pcwd = 0x12b63d0 "/home/jpokorny/wrkspc"

#3  subshell_chdir
    (vpath=0x12a7c40)
    at panel.c:3023
        vpath = 0x12a7c40

#4  panel_callback
    (w=0x1248530, sender=<optimized out>, msg=<optimized out>,
    parm=<optimized out>, data=<optimized out>)
    at panel.c:3436
        panel = 0x1248530
        bb = <optimized out>

#5  send_message
    (data=0x0, parm=0, msg=MSG_FOCUS, sender=0x0, w=0x1248530)
    at ../../lib/widget/widget-common.h:162
        No locals.

#6  dlg_focus
    (h=h@entry=0x12388b0)
    at dialog.c:1000
        current = 0x1248530

#7  do_select_widget
    (h=0x12388b0, w=0x1233ec0 = {...}, dir=SELECT_NEXT)
    at dialog.c:227
        w0 = 0x12411c0

#8  dlg_key_event
    (d_key=9, h=0x12388b0)
    at dialog.c:493
        handled = <optimized out>

#9  dlg_process_event
    (h=h@entry=0x12388b0, key=9, event=event@entry=0x7fff1965d5a0)
    at dialog.c:1225
        No locals.

#10 frontend_dlg_run
    (h=0x12388b0)
    at dialog.c:569
        d_key = <optimized out>
        event = {
        buttons = 9 '\t',
        modifiers = 0 '\000',
        vc = 0,
        dx = 0,
        dy = 0,
        x = -1,
        y = 65,
        type = (unknown: 0),
        clicks = 19121664,
        margin = (unknown: 0),
        wdx = -25690,
        wdy = 76
        }

#11 dlg_run
    (h=0x12388b0)
    at dialog.c:1256
        No locals.

#12 create_panels_and_run_mc
    at midnight.c:959
        No locals.

#13 do_nc
    at midnight.c:1774
        ret = <optimized out>
        midnight_colors = {10, 10, 10, 10, 10}

#14 main
    (argc=1, argv=0x7fff1965d848)
    at main.c:400
        error = 0x0
        config_migrated = 0
        config_migrate_msg = 0x0
        exit_code = 1


Packages:
$ rpm -q mc slang guake vte glibc glib pango bash tmux \
  --queryformat="%{NVR}\n" | uniq
> mc-4.8.11-1.fc20
> slang-2.2.4-11.fc20
> guake-0.4.4-11.fc20
> vte-0.28.2-10.fc20
> glibc-2.18-12.fc20
> glib-1.2.10-40.fc20
> pango-1.36.1-3.fc20
> bash-4.2.46-4.fc20
> tmux-1.8-3.fc20


Process structure:

tmux original session:
systemd(1)───tmux(4049)───bash(10590)───mc(5010)───bash(5012)

tmux attached session
systemd(1)───python(1424)───bash(3673)───tmux(31774)
                ^
                `- guake

Comment 29 Jan Pokorný [poki] 2014-06-09 20:35:59 UTC
Just realized it could be due to accidentally issuing terminal control
codes, notably C-s.  Will try to unfreeze with a known key combination
next time I get to observe this.

Comment 30 Jan Pokorný [poki] 2014-08-13 21:16:23 UTC
I am confused, occurred to me again, but pressing C-q (or C-Q for that
matter) won't rescue mc from being so inert.

Dunno, might be some kind of race condition in which stdin file descriptor
is accidentally dropped and closed?  This reflects my comparison
OK vs. blocked:

OK:
$ strace -fp 13050
> Process 13050 attached
> select(7, [0 4 6], NULL, NULL, NULL^CProcess 13050 detached
> <detached ...>

blocked:
$ strace -fp 14205 
> Process 14205 attached
> select(7, [4 6], NULL, NULL, NULL^CProcess 14205 detached
> <detached ...>


(i.e., when this issue occurs, zero FD is missing in the select call,
as illustrated also with [comment 13] and [comment 15]).

Comment 31 Jan Pokorný [poki] 2015-02-12 14:37:30 UTC
Happened to me again with Fedora 21.  Now I am fairly certain that no
terminal stop/continue control codes were involved (cf. [comment 29]).
Just hit enter meant to enter the selected directory, there were likely
no remnants at the command-line part, at least nothing displayed there
after the hang.  I don't think the enter was consumed in a way to trigger
the expected action.

$ rpm -q mc slang guake vte glibc glib pango bash \
>   --queryformat="%{NVR}\n" | uniq
> mc-4.8.12-3.fc21
> slang-2.2.4-13.fc21
> guake-0.5.2-1.fc21
> vte-0.28.2-14.fc21
> glibc-2.20-7.fc21
> glib-1.2.10-43.fc21
> pango-1.36.8-1.fc21
> bash-4.3.33-1.fc21

$ pstree -sp $(pidof mc)
> systemd(1)───python2(3294)───bash(1146)───su(12616)───bash(12633)...
> ...───mc(18763)───bash(18765)───vim(1123)

$ gdb mc $(pidof mc)
[...]
(gdb) t a a bt f
> #0  __select_nocancel
>     at ../sysdeps/unix/syscall-template.S:81
>         No locals.
> 
> #1  feed_subshell
>     (how=how@entry=0, fail_on_error=fail_on_error@entry=0)
>     at subshell.c:493
>         maxfdp = <optimized out>
>         read_set = {fds_bits = {80, 0 <repeats 15 times>}}
>         bytes = <optimized out>
>         i = <optimized out>
>         wtime = {tv_sec = 10, tv_usec = 0}
>         wptr = 0x0
> 
> #2  do_subshell_chdir
>     (vpath=vpath@entry=0x13a0670, update_prompt=update_prompt@entry=0)
>     at subshell.c:1193
>         pcwd = 0x1390040 "/home/mock/clufter"
> 
> #3  subshell_chdir
>     (vpath=0x13a0670)
>     at panel.c:3021
>         vpath = 0x13a0670
> 
> #4  _do_panel_cd
>     (panel=0x13acb00, new_dir_vpath=<optimized out>, cd_type=<optimized
>     out>)
>     at panel.c:3061
>         olddir_vpath = 0x13a0610
>         new_dir_vpath = <optimized out>
>         cd_type = <optimized out>
>         panel = 0x13acb00
> 
> #5  do_panel_cd
>     (panel=0x13acb00, new_dir_vpath=<optimized out>, cd_type=<optimized
>     out>)
>     at panel.c:4413
>         r = <optimized out>
> 
> #6  do_cd
>     (new_dir_vpath=<optimized out>, exact=cd_exact)
>     at panel.c:4812
>         res = <optimized out>
>         _new_dir_vpath = 0x13a94e0
> 
> #7  do_enter_on_file_entry_t
>     (fe=<optimized out>)
>     at panel.c:2569
>         fname_vpath = 0x13a94e0
>         full_name_vpath = <optimized out>
>         ok = <optimized out>
> 
> #8  do_enter
>     (panel=0x13acb00, panel=0x13acb00)
>     at panel.c:2632
>         No locals.
> 
> #9  panel_execute_cmd
>     (panel=panel@entry=0x13acb00, command=1)
>     at panel.c:3221
>         No locals.
> 
> #10 panel_key
>     (key=<optimized out>, panel=0x13acb00)
>     at panel.c:3376
>         i = <optimized out>
> 
> #11 panel_callback
>     (w=0x13acb00, sender=<optimized out>, msg=<optimized out>,
>     parm=<optimized out>, data=<optimized out>)
>     at panel.c:3456
>         panel = 0x13acb00
>         bb = <optimized out>
> 
> #12 send_message
>     (data=0x0, parm=10, msg=MSG_KEY, sender=0x0, w=<optimized out>)
>     at ../../lib/widget/widget-common.h:167
>         ret = MSG_NOT_HANDLED
> 
> #13 dlg_key_event
>     (d_key=10, h=0x13a9ef0)
>     at dialog.c:514
>         handled = <optimized out>
> 
> #14 dlg_process_event
>     (h=0x13a9ef0, key=10, event=<optimized out>)
>     at dialog.c:1235
>         No locals.
> 
> #15 frontend_dlg_run
>     (h=0x13a9ef0)
>     at dialog.c:569
>         d_key = <optimized out>
>         event = {buttons = 0 '\000', modifiers = 0 '\000', vc = 0, dx
>             = 0, dy = 0, x = -1, y = 16, type = (GPM_UP | GPM_SINGLE),
>             clicks = 20621312, margin = (unknown: 0),
>         wdx = 13856, wdy = 113}
> 
> #16 dlg_run
>     (h=0x13a9ef0)
>     at dialog.c:1266
>         No locals.
> 
> #17 create_panels_and_run_mc
>     at midnight.c:960
>         No locals.
> 
> #18 do_nc
>     at midnight.c:1772
>         ret = <optimized out>
> 
> #19 main
>     (argc=1, argv=0x7fff0829eb58)
>     at main.c:420
>         error = 0x0
>         config_migrated = 0
>         config_migrate_msg = 0x913d28 "__libc_start_main"
>         exit_code = 1

$ strace -fp $(pidof mc)
> Process 18763 attached
> select(7, [4 6], NULL, NULL, NULL

Comment 32 Jan Pokorný [poki] 2015-02-12 14:42:54 UTC
re [comment 31]:

Actually this time, it may have been just an interference with vim task
in the background (PID 1123).  After I killed that process, I can see
following at the command line (in the terminal previously displaying MC
screen):

> [mock@juicyfruit ~]$ vim /home/mock/clufter/review.txt cd "`printf "%b" '\0057home\0057mock\0057clufter'`"
> 
> bash: im: command not found

And was able to switch back to that very MC instance by ^O.

Comment 33 Fedora End Of Life 2015-11-04 13:19:25 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 34 Fedora End Of Life 2015-12-02 02:37:15 UTC
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 35 Jan Pokorný [poki] 2016-03-01 15:09:59 UTC
Just happened to me with Fedora 22.

$ rpm -q mc slang guake vte glibc glib pango bash \
  --queryformat="%{NVR}\n" | uniq
> mc-4.8.13-1.fc22
> slang-2.3.0-2.fc22
> guake-0.8.3-1.fc22
> vte-0.28.2-14.fc22
> glibc-2.21-11.fc22
> glib-1.2.10-44.fc22
> pango-1.36.8-6.fc22
> bash-4.3.42-3.fc22

Comment 36 Jan Pokorný [poki] 2016-05-19 15:15:29 UTC
Haven't looked at the details, but have to wonder if this could be
somehow related:

https://bugzilla.gnome.org/show_bug.cgi?id=731137#c7

Comment 37 Fedora End Of Life 2016-07-19 10:05:23 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.