Subject: pine not quitting on HUP

From: Margarita Suarez <[email-masked]>
Date: Mon, 21 Mar 94 0:24:24 EST

joe brennan ([email-masked]) recently reported to you that we were
seeing pine processes that hadn't heared HUP signals.

we were able to fix most instances of this hanging by not setting signal
handlers to SIG_IGN but instead calling sigblock().  then instead of
setting the signal handler back, you just call sigsetmask().  i'm not
sure how portable the sigblock system call is but our situation improved
90% with this fix installed.  it couldn't hurt to patch pine to use
sigblock/sigsetmask on systems that have it.

the fix was pretty straightforward, but let me know if you need diffs.

the only place i wasn't able to easily fix was in pico's SIGHUP handler,
do_hup_signal() in os_unix.c.  it looks like a user is composing a
message and sitting in pico when the HUP is delivered.  it's a little
confusing because of the longjmp.  attached is the stack from a process
that didn't hear a HUP, and started looping.  i think gdb got a little
confused when we longjmp'ed out of do_hup_signal.  not sure where the
QUIT is coming from...

marg

(gdb) where
#0  0xef793c40 in select ()
#1  0x51934 in read_with_timeout (time_out=600) at ttyin.c:342
#2  0x51e18 in read_char (time_out=600) at ttyin.c:454
#3  0x4dc78 in radio_buttons (
    prompt=0x139f48 "\aPine emergency exit. REALLY ABORT PINE RIGHT NOW? (y/n/^C
) [n]: ", line=-3, column=0, buttons=0x106ea4 "yn", labels=0xefffe664,
    deefault=110, on_ctrl_C=110, help_text=0xd4058, help_on=0) at status.c:583
#4  0x4da88 in want_to (
    question=0x1069e8 "\aPine emergency exit. REALLY ABORT PINE RIGHT NOW",
    dflt=110, on_ctrl_C=110, help=0xd4058, display_help=0) at status.c:512
#5  0x4c1b0 in quit_signal () at signals.c:203
~#6  0xef76ec54 in _sigtramp ()
#7  0x75f20 in do_hup_signal () at osdep.c:771
#8  0x462dc in pine_send (outgoing=0x136070, body=0xeffff678,
    editor_title=0x105d7b "COMPOSE MESSAGE", fcc=0x0, are_replying=0, att=0x0)
    at send.c:996
#9  0x4534c in compose_mail (given_to=0x0) at send.c:366
#10 0x44c50 in compose_screen (pine_state=0x126160) at send.c:178
#11 0x3a0fc in main (argc=1, argv=0xeffffbcc) at pine.c:611

---

From: David L Miller <[email-masked]>
Date: Mon, 21 Mar 1994 13:34:50 -0800 (PST)

Marg,

Most of the hanging problems have been fixed in the current Pine 3.89
release.  There are still a couple unresolved reports, but the occurances
seem to be pretty uncommon.  You are correct that there are portability
problems with alot of the signal handling routines. 

Thanks for the suggestions!

--DLM

|\ |  |\/|  David L. Miller    [email-masked]  (206) 685-6240
|/ |_ |  |  Software Engineer, Pine Development Team   (206) 685-4045 (FAX)
University of Washington, Networks & Distributed Computing, JE-20
4545 15th Ave NE, Seattle WA 98105, USA