[Haskell-cafe] A ghc-6.10.1 bug or a feature?

Juraj Hercek juhe_haskell at hck.sk
Wed Jan 28 10:56:36 EST 2009


Hello people,

I've recently tried this:

$ uname -smpr
Linux 2.6.28-ARCH x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz
$ ghci
GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Prelude> a <- readFile "/sys/devices/system/cpu/online"
Prelude> length a `seq` a
"^CInterrupted.
Prelude> writeFile "/tmp/test.txt" "12345\n"
Prelude> b <- readFile "/tmp/test.txt"
Prelude> length b `seq` b
"12345\n"
Prelude>

The main problem is the "C^Interrupted." above. The input doesn't get 
read out till the end of the file for some reason when dealing with 
files in /sys directory (tried also others: 
/sys/devices/plaform/coretemp.0/temp1_input or 
/sys/devices/system/cpu/cpu0/cpufreq/cpufreq_cur_freq). Sometimes, the 
string from file in /sys gets read (with a slow delay), but most of the 
times it didn't. Everything works fine for a file in /tmp. Cat-ing files 
from shell works perfectly in /sys and /tmp.

I tried also other machine:
% uname -smpr
Linux 2.6.28-ARCH i686 Intel(R) Pentium(R) 4 CPU 2.00GHz

with the same effect. I didn't have this problem with ghc-6.8.2.

Any idea?

-- Juraj


More information about the Haskell-Cafe mailing list