Description of problem: whiptail consumes 100% CPU when it loses TTY. Version-Release number of selected component (if applicable): 0.53.14 How reproducible: Run a background whiptail within a sub-shell, then close the terminal. SIGHUP is not propagated (since its parent is now pid 1) and whiptail is not killed. The steps used to reproduce do not represent legitimate use of whiptail just a reconstruction of the above condition. Google seems to agree that this seems to be a common issue. Example: http://stackoverflow.com/questions/8784891/why-whiptail-is-consuming-100-of-my-cpu-on-fedora-on-ec2 Steps to Reproduce: 1. Open terminal 2. execute "( whiptail & ); exit" 3. check top Actual results: whiptail consumed 100% CPU and never quits Expected results: whiptail should quit or at least not consume 100% CPU. Additional info:
Created attachment 701192 [details] Handle newtGetKey() errors. After further investigation, I discovered that newtGetKey() is able to detect the loss of stdin and returns NEWT_KEY_ERROR when this happens. This is clearly commented in newt.c and should, in my opinion, be handled by whiptail.
Created attachment 701194 [details] Handle newtGetKey() errors.
A similar code to what you propose is couple lines later after the newtGetKey() call, I'm wondering why it doesn't catch this.
You are right. The code was fixed in b8b8a86f back in late 2010 but my compilation was linking with the system libnewt.so which is older than that. Sorry but I didn't realise the code was part of libnewt, not part of whiptail itself.
Ok, thanks for the response. I'm closing this bug.