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

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

Thread Previous | Thread Next
Tom Christiansen
August 3, 2008 21:13
Re: RF help with a v5.10 Heisenbug, please?
Message ID:
In-Reply-To: Message from "Craig A. Berry" <> 
   of "Sun, 03 Aug 2008 19:04:48 CDT." 

> On Wed, Jul 30, 2008 at 3:29 PM, Tom Christiansen <> 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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About