develooper Front page | perl.perl5.porters | Postings from September 2005

[BUG 5.8.7] Another major bug in PerlIO layer

Thread Next
From:
Ilya Zakharevich
Date:
September 25, 2005 03:16
Subject:
[BUG 5.8.7] Another major bug in PerlIO layer
Message ID:
20050924054027.GA2214@math.berkeley.edu
Let me repeat it yet again: it should be easier to rewrite PerlIO
stuff from scratch than try to fix bugs in it.

Example (on unix):

 unix2dos .tcshrc | perl -we 'binmode STDIN, ":crlf" or die; print while read STDIN, $_, 32000'

Example: on DOSISH

 cat config.sys | perl -we "print while read STDIN, $_, 32000"

You thing something as simple as this should work?  No, it only prints
the first line (on DOS), and a few random lines after this too (on Unix).

I tried to debug it, but, as usual, got lost after the first two
dozens of calls it makes to convert ONE "\r\n" pair to "\n".  How
knows how many calls it would make to finish this conversion.

As you could guess, *all* of these two dozen calls are frivolous;
since it is not clear what is the purpose of these calls, it is not
clear which place in this chain of should be patched to work around
this nonsense.

(Yes, it makes a seek() in the process of conversion "\r\n" to "\n".
This is why the call works - accidentally - with plain files.)

Frustrated,
Ilya

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