zsh-workers
 help / color / mirror / code / Atom feed
* Signal propagation problem with 3.1.4 on Digital UNIX
@ 1998-08-28 14:09 Paul Lew
  1998-08-28 16:36 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Lew @ 1998-08-28 14:09 UTC (permalink / raw)
  To: zsh-workers

When I run ode (an OSF source code control system), it starts zsh.
Under this zsh, if a line is partically composed and I press the
interrupt key (^c in my setup).  I got into following state:

(0)ezdzit lew ~>> ode workon kzasa
 Changing directory to: /usr/users/lew/work/sandbox/kzasa/src/
 Logging on kzasa with Project...

Enter password.  [] :  

Name:         Paul_Lew
Group:        -
E-mail:       lew@ezdzit.zko.dec.com    Phone: 4-5809
Expires in:   365 days

 Starting new shell: /bin/zsh

(0)ezdzit lew src>>> jadfal                               kzasa
 Interrupt signal 2
(0)ezdzit lew src>> 
(0)ezdzit lew src>>>                                      kzasa
(0)ezdzit lew src>> 
(0)ezdzit lew src>>>                                      kzasa
(0)ezdzit lew src>> 

The parent shell (zsh too) is trying to read command from stdin.  The
zsh exec'ed by ode is also trying to read command from stdin.  Has
anyone experience this before?  How easy to fix it?  Thanks in
advance...

A short explanation about the prompts above: I setup my zsh so the
prompt will show as many > as the SHLVL value.  Inside ode, the
RPROMPT is set to represent the project.

The stty output:
(0)ezdzit lew src>>> stty -a                              kzasa
#2 disc;speed 9600 baud; 48 rows; 80 columns
erase = ^?; werase = ^W; kill = ^U; intr = ^C; quit = ^\; susp = ^Z
dsusp = ^Y; eof = ^D; eol <undef>; eol2 <undef>; stop = ^S; start = ^Q
lnext = ^V; discard = ^O; reprint = ^R; status <undef>; time = 0
min = 1
-parenb -parodd cs8 -cstopb hupcl cread -clocal 
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc 
ixon -ixany -ixoff imaxbel 
isig icanon -xcase echo echoe -echok -echonl -noflsh -mdmbuf -nohang 
-tostop echoctl -echoprt echoke -altwerase iexten -nokerninfo 
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tabs -onoeot 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Signal propagation problem with 3.1.4 on Digital UNIX
  1998-08-28 14:09 Signal propagation problem with 3.1.4 on Digital UNIX Paul Lew
@ 1998-08-28 16:36 ` Bart Schaefer
  1998-08-28 18:45   ` Paul Lew
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1998-08-28 16:36 UTC (permalink / raw)
  To: Paul Lew, zsh-workers

On Aug 28, 10:09am, Paul Lew wrote:
} Subject: Signal propagation problem with 3.1.4 on Digital UNIX
}
} When I run ode (an OSF source code control system), it starts zsh.
} Under this zsh, if a line is partically composed and I press the
} interrupt key (^c in my setup).  I got into following state:
} 
} (0)ezdzit lew src>>> jadfal                               kzasa
}  Interrupt signal 2
} (0)ezdzit lew src>> 
} (0)ezdzit lew src>>>                                      kzasa
} 
} The parent shell (zsh too) is trying to read command from stdin.  The
} zsh exec'ed by ode is also trying to read command from stdin.  Has
} anyone experience this before?  How easy to fix it?  Thanks in
} advance...

I suspect this is a problem with ode rather than with zsh, but it's hard
to tell.

The first zsh believes that the process it started (originally ode) has
exited.  One question is, is the second zsh the same process (same PID)
as ode was, or is it a new process?

Here's what I *think* is happening (PIDs invented for the example):

	Process		PID	PPID	Action
	-------		---	----    ------
	zsh		10	n/a	fork+exec ode
	ode		11	10	fork+exec zsh
	zsh		12	11	fork+exec jadfal
	jadfal		13	12	n/a

(PID 13 is the "bad luck" process. :-)

You can verify this by running a "ps l" from the second zsh next time you
fire up ode; see if ode is still running, and trace the PID/PPID back to
your first zsh.

When you type ctrl-C, all four processes get the SIGINT.  Each of the zsh
catch it and don't exit, but both ode and jadfal are interrupted and exit.
zsh 10 has no way of knowing that it's child 11 has started zsh 12, so 10
goes back to reading commands.

The bug is that the SIGINT should -not- have caused ode to exit. Either
ode should have exec'd zsh without forking, so the second zsh inherits
PID 11, or it should be catching or ignoring tty-generated signals, or
it should have been taken out of the tty process group.

I'm a little confused as to why that last didn't happen automatically.
I would have thought that zsh 12 would force jadfal to be the tty group
leader, thus preventing the signals from reaching ode.  That certainly
seems to happen on my linux machine (using "perl -e 'system zsh'" in
place of ode, and "sleep 10" in place of jadfal).  So the bug may be
more insidious than one of interrupt handling in ode.

You didn't say what operating system you're using.  It's possible that
zsh is not doing tty pgrp management correctly.  Do you happen to have
the config.h file that was generated when zsh was built?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Signal propagation problem with 3.1.4 on Digital UNIX
  1998-08-28 16:36 ` Bart Schaefer
@ 1998-08-28 18:45   ` Paul Lew
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Lew @ 1998-08-28 18:45 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: Paul Lew, zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]

>>>>> "Bart" == Bart Schaefer <schaefer@brasslantern.com> writes:

    Bart> The bug is that the SIGINT should -not- have caused ode to
    Bart> exit. Either ode should have exec'd zsh without forking, so
    Bart> the second zsh inherits PID 11, or it should be catching or
    Bart> ignoring tty-generated signals, or it should have been taken
    Bart> out of the tty process group.

I tried setting SHELL to /bin/csh and run ode, then send INT to it.
It terminated with message 'signal 2'.  This can be avoided if zsh
reset itself as the process group leader.  Should this be the case?

    Bart> I'm a little confused as to why that last didn't happen
    Bart> automatically.  I would have thought that zsh 12 would force
    Bart> jadfal to be the tty group leader, thus preventing the
    Bart> signals from reaching ode.  That certainly seems to happen
    Bart> on my linux machine (using "perl -e 'system zsh'" in place
    Bart> of ode, and "sleep 10" in place of jadfal).  So the bug may
    Bart> be more insidious than one of interrupt handling in ode.

    Bart> You didn't say what operating system you're using.  It's
    Bart> possible that zsh is not doing tty pgrp management
    Bart> correctly.  Do you happen to have the config.h file that was
    Bart> generated when zsh was built?

I am using Digital UNIX 3.2c.  Attached is the config.h generated.


[-- Attachment #2: config.h --]
[-- Type: application/octet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9UXeEAxXCIA/SC
a3awi3arWJELGZKUOwFpAHcCEv5KcPC3H6XwUTG9oh/IUVEuFUeOlVcvpvVj2dXLaP1Y9IbU
xz4cehPqoxwj7Q9hQpnLYvg5db29F8I6YO7m9HJZP8oV3b/F4lWUvddFOqmzRWMsyWtqV0G0
8uNOtCOKOVZngOtPv1dw8DiRawcfn5lS5aBaEcnBoBgadxlYFC79IRs19GtVvk/BNHO5boJs
2nLlEvRofACcqSqGJoWrxtVyOJAq07qTwsVwuiGmm8Hp5KbLCxCipVw52wEpupYqV13sDIGz
9NlEDvecX6LP9ZZhFBbdJmxTkzubel7lWjd0527A/iFhoEEJephNgQmUsDv0OlDHUNYchjv0
9Al2oAfQdZiXedsBpwbQuWIp00EHByYpXqEZhgtCaS4sVR5O++8XDAFuXisYANu8mycHrV5Z
GAg5IDM1mPLkdDBSHwBKrxAMAi2LnAYJw2AXji1maTLg3YWRDNTRrCnNqoYAngisIzxdXtQq
uAG2rPDklizRrxaBHG+BjtUZyeGK7QDjiZv9IVBPQ1JHdYEvyxv+7gby9fvI73o3n2p3v077
95iE4qVvTrIAZS6dzO1jBdFJqFH7CvFo5JAfQOHHk1gzW4D9D3LnIt0BNwAA

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-08-28 18:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-08-28 14:09 Signal propagation problem with 3.1.4 on Digital UNIX Paul Lew
1998-08-28 16:36 ` Bart Schaefer
1998-08-28 18:45   ` Paul Lew

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).