Bug 221113
Summary: | readline function in perl does not correctly set $! | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Wojciech Pilorz <wpilorz> | ||||||||
Component: | perl | Assignee: | Stepan Kasal <kasal> | ||||||||
Status: | CLOSED RAWHIDE | QA Contact: | David Lawrence <dkl> | ||||||||
Severity: | medium | Docs Contact: | |||||||||
Priority: | medium | ||||||||||
Version: | rawhide | CC: | kasal, perl-devel | ||||||||
Target Milestone: | --- | Keywords: | FutureFeature | ||||||||
Target Release: | --- | ||||||||||
Hardware: | i386 | ||||||||||
OS: | Linux | ||||||||||
Whiteboard: | |||||||||||
Fixed In Version: | Doc Type: | Enhancement | |||||||||
Doc Text: | Story Points: | --- | |||||||||
Clone Of: | Environment: | ||||||||||
Last Closed: | 2009-06-03 18:50:49 UTC | Type: | --- | ||||||||
Regression: | --- | Mount Type: | --- | ||||||||
Documentation: | --- | CRM: | |||||||||
Verified Versions: | Category: | --- | |||||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||||
Embargoed: | |||||||||||
Attachments: |
|
Description
Wojciech Pilorz
2007-01-01 23:46:05 UTC
Created attachment 144615 [details]
readline_test.pl test script
Created attachment 144616 [details]
readline_test.bash run readline_test.pl 16 times with different settings and data
Created attachment 144617 [details]
how to test I/O errors and readline behaviour
I am showing a transcript of another test;
Run this from directory where readline_test.pl is saved;
1. create a subdir and one test file with 400000 lines in that subdir; the file
size is about 6.76 MiB
2. create ISO9660 + rockridge image from that directory with mkisofs
3. create truncated image 5 MiB long
4. mount that truncated image through loop
5. run readline_test.pl for file in that mounted truncated image
tests show that with PERLIO=stdio correct error message is displayed, while
with PERLIO=perlio the error message is in most cases inappropriate.
The error message (from die $!) is correct (Input/output error) if $/ is set
to a reference to a number X such that the size of part of file ftest01 stored
in truncated image file is a whole multiple of X
I have tried with ActiveState Perl on Centos 4.4, version v5.8.8 build 819; it does not show the bugs with PERLIO=stdio Is there some hope for this bug to be corrected? Wojtek The testing with perl-5.10.0 also show reported problems. Similar bugs were reported on perl upstream bugzilla. The first problem is wrong error message 'Bad file descriptor': http://rt.perl.org/rt3/Public/Bug/Display.html?id=38285 They decided that isn't bug, but open the new one, which includes problem with wrong end of line: http://rt.perl.org/rt3/Public/Bug/Display.html?id=39060 The problem is possibly somewhere in perl::IO module. Changing version to '9' as part of upcoming Fedora 9 GA. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Running tests again on Fedora 10, perl-5.10.0-68.fc10.i386, gives the following: $ env LANG=C bash readline_test.bash __ running readline_test.pl for stdin=1234,CHUNKSIZE=-1,PERLIO=perlio... INFO: $/ will be set to undef Bad file descriptor at readline_test.pl line 30, <F> chunk 1. __ running readline_test.pl for stdin=1234,CHUNKSIZE=-1,PERLIO=stdio... INFO: $/ will be set to undef Bad file descriptor at readline_test.pl line 30, <F> chunk 1. __ running readline_test.pl for stdin=1234,CHUNKSIZE=0,PERLIO=perlio... INFO: $/ will not be set Bad file descriptor at readline_test.pl line 30, <F> line 1. __ running readline_test.pl for stdin=1234,CHUNKSIZE=0,PERLIO=stdio... INFO: $/ will not be set Bad file descriptor at readline_test.pl line 30, <F> line 1. __ running readline_test.pl for stdin=1234,CHUNKSIZE=2,PERLIO=perlio... INFO: $/ will be set to 2 INFO: File /dev/stdin has been read, nbytes = 4 __ running readline_test.pl for stdin=1234,CHUNKSIZE=2,PERLIO=stdio... INFO: $/ will be set to 2 INFO: File /dev/stdin has been read, nbytes = 4 __ running readline_test.pl for stdin=1234,CHUNKSIZE=1k,PERLIO=perlio... INFO: $/ will be set to 1024 Bad file descriptor at readline_test.pl line 30, <F> chunk 1. __ running readline_test.pl for stdin=1234,CHUNKSIZE=1k,PERLIO=stdio... INFO: $/ will be set to 1024 INFO: File /dev/stdin has been read, nbytes = 4 __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=-1,PERLIO=perlio... INFO: $/ will be set to undef Bad file descriptor at readline_test.pl line 30, <F> chunk 1. __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=-1,PERLIO=stdio... INFO: $/ will be set to undef Bad file descriptor at readline_test.pl line 30, <F> chunk 1. __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=0,PERLIO=perlio... INFO: $/ will not be set INFO: File /dev/stdin has been read, nbytes = 5 __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=0,PERLIO=stdio... INFO: $/ will not be set Bad file descriptor at readline_test.pl line 30, <F> line 1. __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=2,PERLIO=perlio... INFO: $/ will be set to 2 Bad file descriptor at readline_test.pl line 30, <F> chunk 3. __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=2,PERLIO=stdio... INFO: $/ will be set to 2 INFO: File /dev/stdin has been read, nbytes = 5 __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=1k,PERLIO=perlio... INFO: $/ will be set to 1024 Bad file descriptor at readline_test.pl line 30, <F> chunk 1. __ running readline_test.pl for stdin=1234\n,CHUNKSIZE=1k,PERLIO=stdio... INFO: $/ will be set to 1024 INFO: File /dev/stdin has been read, nbytes = 5 and then testing broken data (truncated ISO filesystem): $env CHUNKSIZE=-1 PERLIO=perlio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will be set to undef Bad file descriptor at readline_test.pl line 30, <F> chunk 1. $env CHUNKSIZE=-1 PERLIO=stdio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will be set to undef Input/output error at readline_test.pl line 30, <F> chunk 1. $env CHUNKSIZE=0 PERLIO=perlio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will not be set Bad file descriptor at readline_test.pl line 30, <F> line 294486. $env CHUNKSIZE=0 PERLIO=stdio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will not be set Input/output error at readline_test.pl line 30, <F> line 294486. $env CHUNKSIZE=2k PERLIO=perlio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will be set to 2048 Input/output error at readline_test.pl line 30, <F> chunk 2534. $env CHUNKSIZE=4k PERLIO=perlio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will be set to 4096 Input/output error at readline_test.pl line 30, <F> chunk 1267. $env CHUNKSIZE=8k PERLIO=perlio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will be set to 8192 Bad file descriptor at readline_test.pl line 30, <F> chunk 634. $env CHUNKSIZE=32k PERLIO=perlio perl -w readline_test.pl /mnt/looptest/ftest01 INFO: $/ will be set to 32768 Bad file descriptor at readline_test.pl line 30, <F> chunk 159. Thank you very much, Wojciech, for your patience. I created a patch and submitted it upstream, see http://rt.perl.org/rt3/Public/Bug/Display.html?id=39060 The patch also adds a new test, inspired by your test script. Fixed in perl-5.10.0-69.fc12 |