-
Notifications
You must be signed in to change notification settings - Fork 578
Race condition in devel branch? #781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From upf@de.uu.netThe problem can be reproduced with a miniperl build with gcc version The problem cannot be reproduced on Linux. Any ideas? Uli my $pid = open(PIPE_TO_KID, "|-"); Perl Info
|
From [Unknown Contact. See original ticket]Created by upf@de.uu.netDid not receive that from the list ... This is a bug report for perl from upf@de.uu.net, The problem can be reproduced with a miniperl build with gcc version The problem cannot be reproduced on Linux. Any ideas? Uli my $pid = open(PIPE_TO_KID, "|-"); Perl Info
|
From [Unknown Contact. See original ticket]
U> Did not receive that from the list ... Two more data points: U> The problem can be reproduced with a miniperl build with gcc version U> The problem cannot be reproduced on Linux. U> Any ideas? U> Uli #!/users/opt/bin/perl -w Ulrich Pfeifer |
From [Unknown Contact. See original ticket]The appended skript prints #!perl print "1..2\n"; $n=1; |
From [Unknown Contact. See original ticket]Bug 19991025.003 is still there: Ulrich Pfeifer Characteristics of this binary (from libperl): |
From @gsarOn 03 Mar 2000 09:00:01 +0100, Ulrich Pfeifer wrote:
OK, I looked at this some, and it appears to be a bug in Solaris' stdio. Here's a shorter version of the test (on Solaris): % cat > pipetest So yes, if STDIN happens to be a pipe, you only get the first line (on The bug seems to be triggered by the fflush(NULL) that we now do for system(), Here's a reduction of the failure into a short C test case: #include <stdio.h> int And here is how it behaves on Solaris (note how it just prints one line % gcc -o ffnull ffnull.c int Again, this test program behaves correctly under Linux with glibc-2.x and If you're keen to avoid the bug on Solaris, you'd want to consider trading ./Configure -des -Accflags='-DPERL_FLUSHALL_FOR_CHILD=NOOP' (Note that that won't give you predictable flushing behavior on fork() Chalk up yet another reason to rewrite stdio for perl. Sarathy |
From [Unknown Contact. See original ticket]
Just FYI: BSD tests ok, too.
What ever happened to using sfio? I see notes in INSTALL about it. --tom |
From @gsarOn Sat, 04 Mar 2000 10:30:14 MST, Tom Christiansen wrote:
Good.
Yup, using sfio is still within the realm of possibilities. Barring I/O disciplines, for example. :-) Sarathy |
From [Unknown Contact. See original ticket]
It doesn't matter whether you flush or don't flush, stdio is just open(FH, ">mytmp") || die "mytmp: $!"; That of course works fine, producing Child 3258 next 9 bytes are: <0501 Now, consider what happens when you replace sys{read,seek} with the This is the same issue as you see here, where % perl -le 'for(1..10_000){printf "%04d\n", $_}' | sed 10q differs dramatically from: % perl -le 'for(1..10_000){printf "%04d\n", $_}' | (sed 5q;sed 5q) 3278 See what I mean? :-) 10q, --tom |
From [Unknown Contact. See original ticket]Setting $|=1 on a filehandle not open for writing doesn't currently --tom |
From [Unknown Contact. See original ticket]
Sarathy> The bug seems to be triggered by the fflush(NULL) that we Sarathy, thanks for hunting that one down. I am sorry that I bothered you with Does somebody know if there is a patch from SUN for this? Alan? Uli |
From @AlanBurlisonUlrich Pfeifer wrote:
Bugid 4118926 was raised against this in 1988, and the same behaviour is -- |
From [Unknown Contact. See original ticket]
Alan> Ulrich Pfeifer wrote: Alan> Bugid 4118926 was raised against this in 1988, and the same Thanks for looking this up Alan. Alan> Opinion varied as to if it was a bug, or just undefined What is fflush(NULL) useful for when eating data from input streams? The fflush manual states: ,----- SUN should add before the final full stop: "and performs some random Alan> I'll append Sarathay's mail to the bug report and see what My I humbly suggest, "fixing" that somehow on the Perl side? @ARGV = map { /\.gz$/ ? "gzip -cd $_|" : $_ } @ARGV; As in: Should we disable that on Solaris? Only if stdio is used? If flushing Ulrich Pfeifer |
From [Unknown Contact. See original ticket]
Ulrich> Should we disable that on Solaris? Probably Configure should set fflushNULL to 'undef' since it does not Ulrich Pfeifer |
From @AlanBurlisonUlrich Pfeifer wrote:
That's my suggestion. If perl will fall back to 'doing the right -- |
From @gsarOn Tue, 07 Mar 2000 12:49:45 GMT, Alan Burlison wrote:
Setting fflushNULL to undef won't suffice to get the fallback What's more, the fallback implementation won't cure the bug because One option is to disable flushing on fork/exec/system on Solaris, which If there's any way to tell on Solaris whether an fd is the read end Sarathy |
From [Unknown Contact. See original ticket]
I seem to recall fstat()ing pipes and finding them marked both ways. % true | perl -MStat::DumpFDs -e 'dump_dtable()' | cat fdno 1 is open and will be left open across execs. fdno 2 is open and will be left open across execs. --tom |
From @AlanBurlisonGurusamy Sarathy wrote:
Sorta. In 2.7 onwards he appropriate functions are __freading(FILE*) -- |
From [Unknown Contact. See original ticket]
Sarathy> One option is to disable flushing on fork/exec/system on Sorry, did not look closely enough. Setting fflushNULL correctly will have the same effect than defining Ulrich Pfeifer |
From @gsarOn 08 Mar 2000 00:08:11 +0100, Ulrich Pfeifer wrote:
Configure should run the simple test case I showed (after it runs the Can you write a patch for that? Sarathy |
From [Unknown Contact. See original ticket]
Sarathy> Configure should run the simple test case I showed (after Sarathy> Can you write a patch for that? Hope this is what you had in mind. It does the right thing on Linux ,-----
,----- and Solaris 2.6: ,-----
,----- I did not have the current metaconfig units. So the patch must be Uli diff -c 'perl-5.6.0-RC1/Configure' 'perl-5.6.0-RC1-fflush/Configure' |
From @jhiPatch applied, thanks. -- |
From @gsarOn 11 Mar 2000 18:47:25 +0100, Ulrich Pfeifer wrote:
Good thing we did this in Configure--I just found that HP-UX 11.00 suffers Sarathy |
From [Unknown Contact. See original ticket]Gurusamy Sarathy <gsar@ActiveState.com> wrote
What is Perl's backup strategy if this fails? Do no flushing? This quote from "perldoc -f fork" presumably needs appropriate weasel All files opened for output are flushed before Mike Guy |
From @doughera88On Sat, 11 Mar 2000, Gurusamy Sarathy wrote:
Beware, though, that the fall-back of explicitly flushing all the stdio Perhaps someone with a few minutes to poke around stdio flags might if (STDIO_STREAM_ARRAY[i]._file >= 0 && Poking around the sundry bits of _flag might be useful, if not -- |
From @gsarOn Sun, 12 Mar 2000 14:53:16 GMT, "M.J.T. Guy" wrote:
Yes. (At least until we get rid of stdio.)
Something to the effect of : "... if the platform's I/O implementation Sarathy |
From @gsarOn Sun, 12 Mar 2000 10:18:27 EST, Andy Dougherty wrote:
We now test for fflush(stdin) as a precondition for attempting to determine Sarathy |
From [Unknown Contact. See original ticket]Gurusamy Sarathy <gsar@ActiveState.com> wrote
How's this? The list of platforms in perlport needs checking. Does the problem Mike Guy Inline Patch--- ./pod/perlfunc.pod.orig Thu Mar 9 17:40:40 2000
+++ ./pod/perlfunc.pod Mon Mar 13 09:27:50 2000
@@ -1651,6 +1651,10 @@
dominant paradigm for multitasking over the last few decades.
All files opened for output are flushed before forking the child process.
+But be warned that this does not happen on some platforms. Nor did
+it happen in Perl versions prior to 5.6.0. So you may need to
+set C<$|> ($AUTOFLUSH in English) or call the C<autoflush()>
+method of C<IO::Handle> to avoid duplicate output.
If you C<fork> without ever waiting on your children, you will
accumulate zombies. On some systems, you can avoid this by setting
--- ./pod/perlport.pod.orig Fri Mar 3 18:55:45 2000
+++ ./pod/perlport.pod Mon Mar 13 09:30:38 2000
@@ -1301,6 +1301,8 @@
Not implemented. (S<Mac OS>, Win32, AmigaOS, S<RISC OS>, VOS, VM/ESA)
+Does not flush output filehandles on some platforms. (Solaris, HP-UX)
+
=item getlogin
Not implemented. (S<Mac OS>, S<RISC OS>)
End of patch |
Migrated from rt.perl.org#1708 (status was 'resolved')
Searchable as RT1708$
The text was updated successfully, but these errors were encountered: