IO problems

Iavor Diatchki diatchki at cse.ogi.edu
Fri Oct 10 14:36:20 EDT 2003


hello,
while looking at the program henk posted a few days ago, i run into a 
rather weird bug in hugs, where it seems to be mixing IO handles.
the problem seems to happen with versions of hugs as early as Nov 2002.
it occurs on linux (Mandrake 9.1 and Redhat 9.0).
this is how one can reproduce the problem:
1. place the three attahced files in a directory
2. runhugs ReadALot.hs
hugs is supposed to read files names from a file (dir.dat) and then read 
each of these files. at some point it gets confused between the contents 
of "dir.dat" and the file it just read.

another way to get the problem is like this:
1. hugs ReadALot.hs
2. Main> main

the same thing happens.  however if "main" is evaluated again, the 
problem does not seem to occur.

yet another variation on the probelm occurs, if one of the lines in 
"dir.dat" is deleted (at the moment it has 41 line, but try it with 40).
then "strace" reveals that hugs seems to be trying to read from stdin.

bye
iavor




-- 
==================================================
| Iavor S. Diatchki, Ph.D. student               |
| Department of Computer Science and Engineering |
| School of OGI at OHSU                          |
| http://www.cse.ogi.edu/~diatchki               |
==================================================
-------------- next part --------------
main = print . map length =<< mapM readFile . lines =<< readFile "dir.dat"


-------------- next part --------------
bad
-------------- next part --------------
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test
test


More information about the Hugs-Bugs mailing list