From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Thomas Rast <trast@student.ethz.ch>, git@vger.kernel.org
Subject: Re: t7006 sometimes hangs in cronjobs on OS X
Date: Sat, 12 Feb 2011 02:37:44 -0600 [thread overview]
Message-ID: <20110212083731.GB5182@elie> (raw)
In-Reply-To: <20110212051239.GA31606@sigill.intra.peff.net>
Jeff King wrote:
> 1. In your Copy.pm log above, it says read gives it 4 characters. But
> "hi\n" has only 3.
Yes, it's "hi\r\n".
> I would first try this patch:
[...]
> +++ b/t/test-terminal.perl
> @@ -15,6 +15,7 @@ sub start_child {
> open STDOUT, ">&", $out;
> open STDERR, ">&", $err;
> close $out;
> + close $err;
> exec(@$argv) or die "cannot exec '$argv->[0]': $!"
Good idea. No change, alas (and likewise with the change to close
the pty master in the child). It seems I have some reading to do.
Jonathan
> and then try this more drastic one:
[...]
> --- a/t/test-terminal.perl
> +++ b/t/test-terminal.perl
> @@ -12,9 +12,12 @@ sub start_child {
[...]
> @@ -69,7 +72,7 @@ if ($#ARGV < 1) {
> }
> my $master_out = new IO::Pty;
> my $master_err = new IO::Pty;
> -my $pid = start_child(\@ARGV, $master_out->slave, $master_err->slave);
> +my $pid = start_child(\@ARGV, $master_out, $master_err);
Runs through ~1000 iterations instead of 100 before hanging.
> Also, I don't know what kind of support you have for stuff like lsof,
> but in theory we should be able to get a hung process, find the open
> descriptor for the pty using lsof, match that descriptor with the other
> end of the pty, and then see which processes have that pty still open.
Trial 1
~~~~~~~
PID 49145 (which has successfully pumped stdout):
0 /dev/ttys001
1 write-only out.1707
2 write-only out.1707
3 /dev/ptmx @ offset 4
5 write-only debug.log
PID 49147 (which is stuck in sysread trying to read stderr):
0 /dev/ttys001
1 write-only out.1707
2 write-only out.1707
5 write-only debug.log
6 /dev/ptmx @ offset 0
Trial 2
~~~~~~~
PID 51091 (which is stuck in sysread trying to read stdout):
0 /dev/ttys001
1 write-only out.2017
2 write-only out.2017
3 /dev/ptmx @ offset 4
5 write-only debug.log
PID 591093 (which successfully pumped stderr) is a zombie
(echo was a zombie in both cases.)
>> Redirecting stderr by using 'xsendfile("elsewhere", $err);' avoids
>> trouble.
>
> That seems doubly weird, since you are changing the _output_, not the
> input. But the input is what is causing the hang.
False alarm --- after about 2500 iterations it hangs. Probably just
changed the timing.
>> Sometimes output includes some streams of null bytes, which makes me
>> suspect something awry in the kernel.
>
> Yuck.
Was my mistake --- apparently I was writing files with holes. Now I
send debug output to a separate file with O_APPEND and it hasn't
happened again.
next prev parent reply other threads:[~2011-02-12 8:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-09 14:38 t7006 sometimes hangs in cronjobs on OS X Thomas Rast
2011-02-09 18:30 ` Ben Walton
2011-02-09 19:09 ` Jeff King
2011-02-09 19:16 ` Thomas Rast
2011-02-09 20:22 ` Thomas Rast
2011-02-09 20:50 ` Jeff King
2011-02-12 2:03 ` Jonathan Nieder
2011-02-12 2:05 ` Jonathan Nieder
2011-02-12 5:12 ` Jeff King
2011-02-12 8:37 ` Jonathan Nieder [this message]
2011-02-13 5:31 ` Jonathan Nieder
2011-02-17 12:38 ` [PATCH] tests: skip terminal output tests " Jonathan Nieder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110212083731.GB5182@elie \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=trast@student.ethz.ch \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).