Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Feb 1998 19:50:11 -0600
From:      "James Van Artsdalen" <jrv@raid.us.dell.com>
To:        <freebsd-questions@FreeBSD.ORG>, "Robert Beer" <r-beer@onu.edu>
Subject:   sh bug (was Re: emacs & less bug)
Message-ID:  <000601bd3cd8$b7126340$9ba9a68f@pest.us.dell.com>

next in thread | raw e-mail | index | archive | help
No, it's not SIGSTOP in my case.  It's a bug in /bin/sh.
/bin/sh is not catching SIGINT.  This is almost certainly another
manifestation
of bug bin/1206, first reported in May/96.  The vcs log for jobs.c for
/bin/sh
shows that there was a recent attempt to fix this but that the change was
backed out for some reason, so the bug still exists.

This bug affects any program that catches SIGINT if that program is run
from a shell script or vi a "sh -c foo".  It wouldn't appear to be the same
as your bug.
---
Here's a ktrace on FreeBSD 2.2.5.  Note that when the signal was posted to
sh, sh had not caught the signal, so sh was terminated.  less returned from
waiting on sh and had no way to realize sh exited before sh's children
(emacs).

  5056 emacs-19.34 887846242.427284 CALL
select(0x100,0x136214,0,0,0xefbfd8d4)
  5056 emacs-19.34 887846243.205481 PSIG  SIGINT caught handler=0x3565c
mask=0x0
 code=0x0
  5056 emacs-19.34 887846243.205524 RET   select -1 errno 4 Interrupted
system c
all
  5056 emacs-19.34 887846243.205546 CALL  sigprocmask(0x3,0)
  5056 emacs-19.34 887846243.205560 RET   sigprocmask 2
  5056 emacs-19.34 887846243.205718 CALL  ioctl(0,TIOCGETA,0xefbfdb7c)
  5056 emacs-19.34 887846243.205750 RET   ioctl 0
  5056 emacs-19.34 887846243.205767 CALL  ioctl(0,TIOCSETAW,0xefbfdb7c)
  5056 emacs-19.34 887846243.205793 RET   ioctl 0
  5056 emacs-19.34 887846243.205810 CALL  ioctl(0,TIOCGETA,0xefbfdb30)
  5056 emacs-19.34 887846243.205826 RET   ioctl 0
  5056 emacs-19.34 887846243.205943 CALL  write(0x1,0x1377f4,0x1)
  5056 emacs-19.34 887846243.205975 GIO   fd 1 wrote 1 byte
       "\a"
  5056 emacs-19.34 887846243.205990 RET   write 1
  5055 sh       887846243.206141 PSIG  SIGINT SIG_DFL
  5054 less     887846243.206408 RET   wait4 5055/0x13bf

ktrace shows that less does a fork/exec to run sh, which does fork/exec
to run bash in my case, which exec's emacs.  sh never issued any sort of
sig* call at all.

-----Original Message-----
From: Robert Beer <r-beer@onu.edu>
To: James Van Artsdalen <jrv@raid.us.dell.com>;
freebsd-questions@FreeBSD.ORG <freebsd-questions@FreeBSD.ORG>
Date: Wednesday, February 18, 1998 10:32 AM
Subject: Re: emacs & less bug


>At 2:50 AM -0500 2/18/98, James Van Artsdalen wrote:
>>     If I run       $ EDITOR=emacs less  foo.c   and type "v" in less,
>>less invokes  emacs to edit the file. If I then press ^G in emacs, both
>>less and emacs  see the SIGINT, not just emacs.   This works correctly for
>>me under BSDi 2.1 with less 290, emacs 19.29 and bash 1.14.5.  If I
>>compile these versions for FreeBSD  2.2.5-released they don't work.  The
>>versions of these programs shipping with FreeBSD  2.2.5-released don't
>>work  either.
>
>I have been (slowly) investigating something much like you describe with
>emacs in a telnet session.  I think you will find that emacs is receiving a
>SIGSTOP and not a SIGINT.
>
>This appears to be a bad telnet client and server interaction.  Does anyone
>have any further insight(s) into this problem?
>
>---
>Bob Beer <r-beer@onu.edu>
>Ohio Northern University, Academic Computer Services, Ada, OH  45810
>
>
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000601bd3cd8$b7126340$9ba9a68f>