Thread: [Fremantle Maemo5+Harmattan Maemo6] Midnight Commander
View Single Post
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#66
Originally Posted by ginggs View Post
Opinion seems to be divided. If this is the case, then I don't understand why the problem does not occur when mc is built with slang.

Edit: I don't think the problem is busybox as I am using bash. I was only able to reproduce the problem on the N900 with subshell (Ctrl-O) enabled, which required changing my default shell. See steps to reproduce in comment #57.


From the upstream ticket, the problem is reported in Gentoo as well.
Remember to build mc with ncurses and run mc as root (sudo mc).
To make it more clear:

1. MC has a bug which causes an infinite loop when it is compiled using ncurses (as opposed to slang) *and* the tty is gone. Workaround is to use slang because it doesn't expose this bug.

2. No interactive program should be kept running without any means of doing I/O. This is a bug in whatever program is MC's parent or grand-parent because it's not properly sending the SIGHUP signal when closing.

With bash/dash this depends on the "huponexit" shell variable (shopt). I just tested on my wheezy VPS (dash) and huponexit is off.

With busybox I'm not sure, because stock is different than enhanced busybox, plus you can set this option ("trap SIGHUP ...") in /etc/profile and such. All I know is that with other versions of mc (presumably compiled with ncurses) I didn't have the problem.

In any case, the proper solution for mc (and any other program) is not -- ever -- to go into an infinite loop, unless by design.
 

The Following 2 Users Say Thank You to reinob For This Useful Post: