develooper Front page | perl.perl5.porters | Postings from August 2008

Re: RF help with a v5.10 Heisenbug, please?

Thread Previous | Thread Next
From:
Tom Christiansen
Date:
August 3, 2008 21:13
Subject:
Re: RF help with a v5.10 Heisenbug, please?
Message ID:
14171.1217823190@chthon
In-Reply-To: Message from "Craig A. Berry" <craig.a.berry@gmail.com> 
   of "Sun, 03 Aug 2008 19:04:48 CDT." 
   <c9ab31fc0808031704m35b97ac9h45efc28956376385@mail.gmail.com> 

> On Wed, Jul 30, 2008 at 3:29 PM, Tom Christiansen <tchrist@perl.com> wrote:

>> Once I'd installed 5.10.0, the following start-up line in my .tcshrc
>> hangs forever with perl running unchecked until I kill it--but only
>> about one time in 30 or 100, or some high number I can't count.

>>   set path = `echo $path | tr ' ' '\12' | perl -nle 'print if -d and
>>      ($dev,$ino) = stat(_) and not $seen{$dev,$ino}++'`

>> Specifically, the perl line is

>>    perl -nle 'print if -d and ($dev,$ino) = stat(_) and not
>>      $seen{$dev,$ino}++'

>> The failure never, ever happened before 5.10, and now it happens
>> a few times a day (I shell out to {!}afmt paragraphs in vi.)

>> What may have changed in 5.10 to cause that line to execute
>> differently?

> One difference with 5.10 is that PerlIO uses Unix I/O as its lowest
> layer rather than stdio, so your print statement is probably doing a
> write() rather than an fwrite().  I have no idea whether that's
> related to your problem, but it is a difference.

Given that fwrite(3S) from the stdio library must ultimately call the
write(2) syscall if it's to emit any data from its buffers, isn't it
really just a difference as to which particular layer should be
interposed between Perl's print() and the final write(2) syscall: 
one being stdio, the other PerlIO?

I don't know whether stdio pipebuffers (it's in backquotes) differently
than PerlIO does.  But the process is *not* hung; it's working its tail
off, running up CPU time till I kill it.  On what, I dunno.  But only
now and then, not absolutely reproducibly upon demand.

I may run an overnight memory-checker.

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About