darcs

Issue 715 darcs trackdown doesn't handle SIGINT properly

Title darcs trackdown doesn't handle SIGINT properly
Priority not-our-bug Status given-up
Milestone Resolved in
Superseder Nosy List SamB, darcs-devel, dmitry.kurochkin, kowey, simonmar, thorkilnaur, tommy
Assigned To simonmar
Topics

Created on 2008-03-01.19:17:30 by SamB, last changed 2017-07-30.23:31:19 by gh.

Messages
msg3703 (view) Author: SamB Date: 2008-03-01.19:17:29
When I type ^C during a darcs trackdown operation, instead of aborting the
operation, it just kills the test program. This is not nice.
http://www.cons.org/cracauer/sigint.html seems to explain what should be done
instead.
msg3733 (view) Author: droundy Date: 2008-03-03.17:18:54
I've read http://www.cons.org/cracauer/sigint.html, and it does look like we
should behave better.  I can't help but wonder, however, if this code ought to
be part of System.Process?  Simon? Basically, the idea is that when we call an
external command we should:

"Look at WIFSIGNALED(status) and WTERMSIG(status) to tell whether the child says
'I exited on SIGINT: in my opinion the user wants the shellscript to be
discontinued'"

As far as I can see, whenever System.Process gets a positive result to the above
tests (which isn't too clear to me), it ought to raise a sigINT in the current
program.  This would allow programs to not need to add special logic when
calling external programs, just because they want to respond to ctrl-C if it's
hit while the process is running.

Anyhow, I thought I'd run this by you (Simon), to see if you have thoughts on
the question.  The above web page is definitely an interesting read.

David
msg4546 (view) Author: simonmar Date: 2008-05-07.10:55:32
> I've read http://www.cons.org/cracauer/sigint.html, and it does look like
> we
> should behave better.  I can't help but wonder, however, if this code
> ought to
> be part of System.Process?  Simon? Basically, the idea is that when we
> call an
> external command we should:
>
> "Look at WIFSIGNALED(status) and WTERMSIG(status) to tell whether the
> child says
> 'I exited on SIGINT: in my opinion the user wants the shellscript to be
> discontinued'"
>
> As far as I can see, whenever System.Process gets a positive result to the
> above
> tests (which isn't too clear to me), it ought to raise a sigINT in the
> current
> program.  This would allow programs to not need to add special logic when
> calling external programs, just because they want to respond to ctrl-C if
> it's
> hit while the process is running.
>
> Anyhow, I thought I'd run this by you (Simon), to see if you have thoughts
> on
> the question.  The above web page is definitely an interesting read.

That seems right, yes.  The other side of the coin is that the GHC runtime should finish with kill(getpid(),SIGINT) if it caught SIGINT itself and cleaned up.

I'll look into this in the context of the System.Process improvements I'm working on.

Cheers,
        Simon
msg8647 (view) Author: kowey Date: 2009-09-02.19:20:36
Hi Simon,  Any chance we could get a status update on the System.Process
improvements you were planning?  Perhaps a link to the GHC tracker ticket?
Thanks!

(See http://bugs.darcs.net/msg3733 for details)
msg8657 (view) Author: simonmar Date: 2009-09-02.21:43:29
http://hackage.haskell.org/trac/ghc/ticket/2301

GHC does now do killpid(getpid(), SIGINT) after cleaning up, if it catches a
SIGINT itself.  However, the proposed changes to System.Process aren't done yet.
History
Date User Action Args
2008-03-01 19:17:30SamBcreate
2008-03-03 17:18:56droundysetstatus: unread -> unknown
nosy: + simonmar
messages: + msg3733
2008-05-07 10:55:35simonmarsetnosy: + dagit
messages: + msg4546
2008-05-07 12:17:28koweysetpriority: bug -> not-our-bug
status: unknown -> has-patch
assignedto: simonmar
nosy: droundy, tommy, beschmi, kowey, dagit, SamB, simonmar
2009-08-06 17:55:14adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, zooko, mornfall, simon, thorkilnaur, - droundy, SamB, simonmar
2009-08-06 20:59:13adminsetnosy: - beschmi
2009-08-10 22:16:32adminsetnosy: + SamB, simonmar, - markstos, darcs-devel, zooko, jast, Serware, mornfall
2009-08-11 00:07:58adminsetnosy: - dagit
2009-08-25 18:06:29adminsetnosy: + darcs-devel, - simon
2009-08-27 13:58:21adminsetnosy: tommy, kowey, darcs-devel, SamB, simonmar, thorkilnaur, dmitry.kurochkin
2009-09-02 19:20:39koweysetnosy: tommy, kowey, darcs-devel, SamB, simonmar, thorkilnaur, dmitry.kurochkin
messages: + msg8647
2009-09-02 21:43:32simonmarsetnosy: tommy, kowey, darcs-devel, SamB, simonmar, thorkilnaur, dmitry.kurochkin
messages: + msg8657
2009-10-23 22:36:34adminsetassignedto: simonmar -> marlowsd
nosy: + marlowsd
2009-10-23 22:38:14adminsetnosy: - simonmar
2009-10-23 23:34:44adminsetassignedto: marlowsd -> simonmar
nosy: + simonmar
2009-10-23 23:35:07adminsetnosy: - marlowsd
2017-07-30 23:31:19ghsetstatus: has-patch -> given-up