Ticket #4198 (new defect)

Opened 4 months ago

Last modified 2 months ago

mc hangs on start randomly with zsh when subshell is not disabled

Reported by: cederom Owned by:
Priority: critical Milestone: Future Releases
Component: mc-core Version: master
Keywords: subshell hang Cc: joseph.2011@…, congest, z0rc3r@…
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description (last modified by zaytsev) (diff)

Hello world :-)

I noticed recently that mc 4.8.26 on FreeBSD 12.2-RELEASE hangs on start sometimes with zsh. No rule when it happens. I need to kill -9 that process. When -b (no subshell) is provided then mc starts with no problem.

I found that common problem over the internets and -b as temporary workaround. I did not find that issue repoted here so here it goes :-)

Best regards :-)
Tomek

Attachments

lldb-bt.txt (2.6 KB) - added by meowmc 2 months ago.

Change History

comment:1 Changed 4 months ago by andrew_b

  • Milestone 4.8.27 deleted

comment:2 Changed 4 months ago by andrew_b

What reply do you expect? You just ignored all written in NewTicket page. I'm not FreeBSD used therefore bugreport like "4.8.26 on FreeBSD 12.2-RELEASE hangs on start" is useless for me.

-b is "no color". "No subshell" is -u. What do you mean exactly?

comment:3 Changed 4 months ago by cederom

Take a look at:

https://duckduckgo.com/?t=ffsb&q=midnight+commander+hangs+on+start&atb=v258-4__&ia=web

Looks like a common problem.

My mistake, its -u, thanks :-)

comment:4 Changed 4 months ago by zaytsev

What's your shell? Does this happen on 4.8.25 or not?

We've had reports that persistent subshell buffer introduced in 4.8.26 somehow causes random hangs on zsh, but I think most FreeBSD people use tcsh and I think that our persistent subshell buffer implementation simply doesn't work on tcsh...

I wonder what should now happen on tcsh with the new patch, old behaviour or no subshell?

comment:5 Changed 4 months ago by cederom

Thanks for you reply zaytsev :-)

Unfortunately I am using ZSH (version 5.8).

I found previous version mc 4.8.24 in my packages cache I will use that one for a while and let you know just to confirm.. that hanging on start showed up recently I am not sure when exactly :-)

What I can see is only a single blue background character in the top right corner of the terminal when the mc hangs. If you can hint me how can I search/debug further please let me know so I can provide more information :-)

comment:6 Changed 4 months ago by zaytsev

  • Description modified (diff)
  • Summary changed from mc hangs on start randomly when subshell is not disabled to mc hangs on start randomly with zsh when subshell is not disabled

comment:7 Changed 4 months ago by zaytsev

  • Cc joseph.2011@… added

Alright, so this should be the same problem as reported by Joseph Reagle on macOS :-/

It would be great if you could find a reproducer and even better check the code that has changed here: #4114 and see what could be the problem and suggest a fix - we don't use ZSH and with bash all seems to work fine.

Maybe it's a bad interaction with some plugin or prompt settings that you are using?

comment:8 Changed 4 months ago by cederom

So far did not happen with 4.8.24. Will observe more. I am constantly working on ZSH so small probability of configuration problem if 4.8.24 works fine..?

Just to make sure that is ZSH problem when I get back to 4.8.26 I will use CSH and see what happens.

Last edited 4 months ago by cederom (previous) (diff)

comment:9 Changed 4 months ago by zaytsev

  • Cc congest added

Again: we introduced a new feature in 4.8.26 - see #4114 - apparently it now causes sporadic hangs on ZSH. It would be great it ZSH users could debug and fix it.

comment:10 Changed 4 months ago by congest

If you could just find a way to reliably reproduce it, I could fix it.

If you can't reliably reproduce the bug, the only think I can think of is to make sure mc is compiled with debugging symbols, and then wait for it to hang, and when it does, use gdb to attach to the process and figure out where it stopped.

comment:11 Changed 3 months ago by zaytsev

Ticket #4214 has been marked as a duplicate of this ticket.

Changed 2 months ago by meowmc

comment:12 Changed 2 months ago by meowmc

Steps to reproduce:

  1. brew install starship
  2. open mc
  3. ctrl-o
  4. eval "$(starship init zsh)"
  5. ctrl-o
  6. go inside and out of a directory until it hangs on line src/subshell/common.c:781:
      if (select (maxfdp + 1, &read_set, NULL, NULL, wptr) == -1)
    
    See lldb-bt.txt.

GNU Midnight Commander 4.8.26-107-g8519c7e5b
starship 0.51.0
zsh 5.7.1 (x86_64-apple-darwin19.0)

mc 4.8.25 is okay.

comment:13 Changed 2 months ago by andrew_b

  • Milestone set to Future Releases

comment:14 Changed 2 months ago by z0rc

  • Cc z0rc3r@… added
Note: See TracTickets for help on using tickets.