[Bug 723] New: Busybox shell doesn't handle SIGHUP properly

bugzilla at busybox.net bugzilla at busybox.net
Tue Nov 17 21:52:48 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=723

           Summary: Busybox shell doesn't handle SIGHUP properly
           Product: Busybox
           Version: 1.12.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P5
         Component: Other
        AssignedTo: unassigned at busybox.net
        ReportedBy: a9016009 at gmx.de
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


Forwarding from https://bugs.maemo.org/show_bug.cgi?id=5317 .
Unsure whether bug 625 is related here.

Also see https://bugs.maemo.org/show_bug.cgi?id=5317 .


SOFTWARE VERSION:
1.2009.41-10

STEPS TO REPRODUCE THE PROBLEM:
1. Open XTerm
2. Type and execute several commands
3. Exit XTerm
4. Open XTerm
5. Press UP arrow button

EXPECTED OUTCOME:
You should see the command you last typed at step #2.

ACTUAL OUTCOME:
Command history is empty.

REPRODUCIBILITY:
always

OTHER COMMENTS:
This may be indirectly related to the patch that was applied in Maemo to fix
https://bugs.busybox.net/show_bug.cgi?id=185 (if ash didn't save history when
killed before that no one would notice) - still in NEW state here.


------- Comment #9 From Tamminen Eero (Nokia) 2009-11-10 17:30:34 -------

Ctrl-d saves command history, as expected.
Killing X-term wiht "X" button does not, as that's done by XTerm to Busybox 
when the window is closed, according to strace:
# strace -f -p 2117
Process 2117 attached - interrupt to quit
read(0, 0xbe83d1cf, 1)                  = ? ERESTARTSYS (To be restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
Process 2117 detached 

Seems like Busybox shell doesn't handle SIGHUP properly.  I.e. set some flag in
signal handler and in main loop exit gracefully (with history saving) when the
signal delivery interrupts its select() syscall.

(Other way to safely notify the main thread about the async signal delivery
would be using a pipe added to select(), but that's a bit of an overkill.)

WORKAROUND:
Setting trap handler in .profile


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list