darcs

Issue 68 wish: don't report "resource vanished" when stdout pipe is broken.

Title wish: don't report "resource vanished" when stdout pipe is broken.
Priority wishlist Status given-up
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, jch, kapheine, kowey, markstos, mornfall, thorkilnaur, tommy
Assigned To
Topics

Created on 2005-12-21.05:38:02 by kapheine1, last changed 2017-07-30.23:36:39 by gh.

Messages
msg250 (view) Author: kapheine Date: 2005-12-21.05:38:01
Newer versions of darcs-devel give "darcs failed:   resource vanished"
when piping the output of changes. If I run "darcs changes" I do not
get the message.  If I run "darcs changes | less" (or more) and then
hit "q" to quit it will display the error before going back to the
prompt.

It does not happen with 1.0.5.  I tried going back a ways (about 80
patches) on darcs-devel and the problem still showed up, so it doesn't
seem to be from any very recent patches.

I wouldn't be surprised if this is a "broken pipe" error or something
similar, but I'm not sure how to go about checking this.
msg251 (view) Author: droundy Date: 2005-12-21.14:42:36
On Wed, Dec 21, 2005 at 05:38:02AM +0000, Zachary P. Landau wrote:
> I wouldn't be surprised if this is a "broken pipe" error or something
> similar, but I'm not sure how to go about checking this.

It almost certainly is this.  We catch the SIGPIPE exception, but then if
we try to write to stdout again, we get hosed.  I'm not sure of the best
solution here.  We could figure out who's writing after the SIGPIPE, or
perhaps we could just close stderr, which would keep the messages from
being seen.

Confirmed that this shows up in darcs-unstable (plus a few of my patches,
actually), but not in darcs-stable.

You can also reproduce with `darcs changes | head`

I think maybe an strace would help here...
-- 
David Roundy
http://www.darcs.net
msg371 (view) Author: jch Date: 2006-01-13.22:20:49
Here's the relevant line from the strace output:

  write(1, "fix bug in doesDirectoryReallyEx"..., 8191) = -1 EPIPE (Broken pipe)

The error message is definitely puzzling, but I'm too lazy to check the Ghc
library sources.
msg372 (view) Author: jch Date: 2006-01-13.22:42:12
I believe the only issue is the error message.  Reporting EPIPE as an error
is standard practice.
msg373 (view) Author: kapheine Date: 2006-01-13.23:53:19
> I believe the only issue is the error message.  Reporting EPIPE as an error
> is standard practice.

Agreed.  But the error message comes from GHC it seems  Is it too
hackish to, when catching  error messages, convert "resource vanished"
into "Broken Pipe" or what have you?  Resource vanished and broken
pipe do describe the same thing, but everyone is used to "Broken Pipe"
and many are probably thrown off by resource vanished, like I was.
msg375 (view) Author: droundy Date: 2006-01-14.13:51:14
On Fri, Jan 13, 2006 at 10:42:13PM +0000, Juliusz Chroboczek wrote:
> I believe the only issue is the error message.  Reporting EPIPE as an error
> is standard practice.

I disagree.  I'd prefer not to report EPIPE with an error message.  I don't
like geting error messages when using pipes for things like

darcs changes | head

In SignalHandler we don't report SIGPIPE signals precisely for this
reason.  I guess something must have changed so now we get both an EPIPE
and a SIGPIPE.  I'd prefer not to report either.
-- 
David Roundy
http://www.darcs.net
msg2569 (view) Author: markstos Date: 2008-01-19.02:24:37
I can't reproduce this with 1.0.9 or 2.0.0pre2, and there has been no further
activity on this bug since 2006, so I'm considering it resolved. 

Please re-open if you find otherwise.
msg2572 (view) Author: kowey Date: 2008-01-19.02:30:18
I still get this on MacOS X with darcs > 2.0.0pre2.  Doing darcs changes | less
and hitting q (on the darcs darcs repository) gives me a "resource vanished" error.
msg2598 (view) Author: markstos Date: 2008-01-19.15:43:24
kowey, thanks for the follow-up. Let's narrow the environments where it happens
and doesn't happen then. 

For me, with Ubuntu Gutsy, using Bash 3.2.25 and 'less' 406, it doesn't happen.
 With what version of shell and pager did you experience it?
msg3084 (view) Author: kowey Date: 2008-02-03.17:09:49
On Sat, Jan 19, 2008 at 15:43:25 -0000, Mark Stosberg wrote:
> For me, with Ubuntu Gutsy, using Bash 3.2.25 and 'less' 406, it doesn't happen.
>  With what version of shell and pager did you experience it?

less 328 (default on MacOS X Tiger)
zsh 4.2.3 (likewise)
msg3125 (view) Author: droundy Date: 2008-02-05.15:50:05
I'm pushing a test that I think ought to trigger this bug, in which I use head
instead of less to trigger the bug.  Except that it's not triggered for me...

Anyhow, let us know, Eric, if you can use this test to trigger the bug.  If not,
perhaps you can use it as a starting point for writing a test that *does* fail
on your system?
msg3171 (view) Author: markstos Date: 2008-02-07.04:14:44
This test passes for me with a current build from darcs-unstable as well:

 perl shell_harness broken-pipe.sh

An updated trigger-case from Eric would be ideal.
msg3223 (view) Author: markstos Date: 2008-02-08.01:57:39
The test still passes for me. I also tested with "zsh", which I believe OSX uses. 
The test still passed with zsh 4.3.4.
msg3232 (view) Author: kowey Date: 2008-02-08.07:09:01
On Fri, Feb 08, 2008 at 01:57:40 -0000, Mark Stosberg wrote:
> The test still passes for me. I also tested with "zsh", which I believe OSX uses. 

No, I had switched to zsh on a whim.
msg3909 (view) Author: droundy Date: 2008-03-18.14:11:54
It turns out that this bug is now reproducible on the buildbots.  It'd be nice
to get it fixed, just so we can move the test (bugs/broken-pipe.sh) back into
the test suite.  Alas, I've no more of an idea as to what triggers this bug.
msg8563 (view) Author: kowey Date: 2009-08-28.10:23:29
I can no longer reproduce this on the command line (in darcs darcs repository:
darcs changes | less; hit q).  

MacOS X Leopard, zsh, less 394 (last time, I was using Tiger).

We need somebody to check why David's repository marked this as passing.  Is it
just because he wasn't using buildbot any more?
History
Date User Action Args
2005-12-21 05:38:02kapheine1create
2005-12-21 14:42:37droundysetstatus: unread -> unknown
messages: + msg251
2006-01-13 22:20:49jchsetnosy: + jch
messages: + msg371
2006-01-13 22:42:13jchsetmessages: + msg372
title: darcs failed: resource vanished" when running 'changes' -> darcs failed: "resource vanished" instead of "broken pipe"
2006-01-13 23:53:20kapheine1setmessages: + msg373
2006-01-14 13:51:14droundysetmessages: + msg375
2008-01-19 02:24:38markstossetstatus: unknown -> resolved
nosy: + markstos, kowey, beschmi
messages: + msg2569
2008-01-19 02:30:19koweysetstatus: resolved -> unknown
nosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg2572
2008-01-19 15:43:25markstossetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg2598
2008-02-03 17:09:51koweysetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg3084
2008-02-05 15:50:06droundysetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg3125
2008-02-07 04:14:45markstossetstatus: unknown -> waiting-for
nosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg3171
2008-02-08 01:57:40markstossetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg3223
assignedto: kowey
2008-02-08 07:09:03koweysetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg3232
2008-02-08 09:06:09koweysetstatus: waiting-for -> unknown
nosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
2008-02-16 22:34:06markstossetpriority: bug -> wishlist
status: unknown -> deferred
nosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
title: darcs failed: "resource vanished" instead of "broken pipe" -> wish: report "broken pipe" instead of "resource vanished
2008-03-18 14:11:55droundysetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
messages: + msg3909
2008-03-18 14:12:20droundysetnosy: droundy, jch, tommy, beschmi, kowey, markstos, kapheine1
title: wish: report "broken pipe" instead of "resource vanished -> wish: don't report "resource vanished" when stdout pipe is broken.
2009-08-06 17:40:31adminsetnosy: + jast, Serware, dmitry.kurochkin, darcs-devel, zooko, dagit, mornfall, simon, thorkilnaur, - droundy, jch, kapheine1
2009-08-06 20:47:34adminsetnosy: - beschmi
2009-08-10 22:15:25adminsetnosy: + kapheine1, jch, - darcs-devel, zooko, jast, dagit, Serware, mornfall
2009-08-25 17:54:03adminsetnosy: + darcs-devel, - simon
2009-08-27 13:56:39adminsetnosy: jch, tommy, kowey, markstos, darcs-devel, kapheine1, thorkilnaur, dmitry.kurochkin
2009-08-28 10:23:32koweysetstatus: deferred -> needs-reproduction
nosy: + mornfall
messages: + msg8563
assignedto: kowey ->
2009-10-24 00:36:10adminsetnosy: + kapheine, - kapheine1
2017-07-30 23:36:39ghsetstatus: needs-reproduction -> given-up