hat-trail: attempt to read beyond end of file

Hi there, I just started to use HAT. After Installation, which was hell ^^, I tried Tutorial Part 1. After compiling $ hmake -hat Insort the output is
hat-trans Insort.hs Creating directories Hat Wrote Hat/Insort.hs ghc -c -package hat -o Hat/Insort.o Hat/Insort.hs
Hat/Insort.hs:16:0: Warning: Pattern match(es) are overlapped In the definition of `hsort': hsort _ p = ...
Hat/Insort.hs:30:0: Warning: Pattern match(es) are overlapped In the definition of `hinsert': hinsert _ _ p = ... ghc -package hat -o Insort Hat/Insort.o
After that I run: $ ./Insort
agmoprr
Thats nice, I think. But when I start hat-trail $ hat-trail Insort the output is:
hat-trail: attempt to read beyond end of file hat-trail: offset = 0x9012cc02, filesize = 0x2008 hat-trail: errno = 0 (Success)
I don't think that this is nice, is it? Has anybody some hints for me? Thanks in advance -- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.

Could you run 'hat-check Insort', to check that a correct hat file has been generated? Thanks Tom Davie On 13 Oct 2006, at 14:02, Barzille wrote:
Hi there, I just started to use HAT. After Installation, which was hell ^^, I tried Tutorial Part 1. After compiling
$ hmake -hat Insort
the output is
hat-trans Insort.hs Creating directories Hat Wrote Hat/Insort.hs ghc -c -package hat -o Hat/Insort.o Hat/Insort.hs
Hat/Insort.hs:16:0: Warning: Pattern match(es) are overlapped In the definition of `hsort': hsort _ p = ...
Hat/Insort.hs:30:0: Warning: Pattern match(es) are overlapped In the definition of `hinsert': hinsert _ _ p = ... ghc -package hat -o Insort Hat/Insort.o
After that I run:
$ ./Insort
agmoprr
Thats nice, I think. But when I start hat-trail
$ hat-trail Insort
the output is:
hat-trail: attempt to read beyond end of file hat-trail: offset = 0x9012cc02, filesize = 0x2008 hat-trail: errno = 0 (Success)
I don't think that this is nice, is it? Has anybody some hints for me?
Thanks in advance
-- View this message in context: http://www.nabble.com/hat-trail%3A- attempt-to-read-beyond-end-of-file-tf2436896.html#a6795165 Sent from the Haskell - Hat mailing list archive at Nabble.com.
_______________________________________________ Hat mailing list Hat@haskell.org http://www.haskell.org/mailman/listinfo/hat

Thomas Davie
Could you run 'hat-check Insort', to check that a correct hat file has been generated?
Furthermore, if hat-check reports an error in the Insort.hat file, please send the file, so we can examine it.
$ hat-trail Insort
the output is:
hat-trail: attempt to read beyond end of file hat-trail: offset = 0x9012cc02, filesize = 0x2008 hat-trail: errno = 0 (Success)
Regards, Malcolm

I added my Insort.hs. I hope that's the file you're thinking of... hat-check returns this message:
strange tag 24 at byte offset 0x42e
http://www.nabble.com/file/3631/Insort.hs Insort.hs -- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.

Ok, here it is: http://www.nabble.com/file/3632/Insort.hat Insort.hat -- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.

Barzille
http://www.nabble.com/file/3632/Insort.hat Insort.hat
Ah, yes I can reproduce the errors you saw. As best I can tell, the generated .hat file has machine words stored in the wrong byte-order. This means all the internal file pointers are wrong. They are supposed to be stored in network (big-endian) order, but your .hat file has them stored in little-endian order. The likeliest cause is that your platform does not implement the C-level htonl() and ntohl() macros/functions correctly. Can you tell us what machine architecture and operating system you are using? You mentioned that installation was difficult. What did you need to do that was unusual? Regards, Malcolm

Can you tell us what machine architecture and operating system you are using?
You mentioned that installation was difficult. What did you need to do
I am using 64 Bit sy

Barzille
I am using 64 Bit sy
I'm guessing that the 64-bit nature of your machine might be the problem. There might be assumptions about the size of a machine word hidden somewhere deep inside some part of the library. We have never specifically tested on 64-bit machines, although Hat does certainly work on my 64-bit PowerPC under MacOS X. But the PowerPC is a big-endian architecture, whereas your machine may well be little-endian, e.g. if it is from AMD or Intel. At some point soon, I hope to get time to test out Hat on an Athlon-64 we have in the Dept. More news when I have it. Regards, Malcolm

Ok, thanks for your help. I hope to hear from you soon... Maik -- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.

I am using 64 Bit sy
Hat does certainly work on my 64-bit PowerPC under MacOS X ... I hope to get time to test out Hat on an Athlon-64
OK, so Hat seems to work fine on our Linux 64-bit machine as well. However, it does look like our Linux distribution of the gcc C-compiler and libraries is building in 32-bit mode, so this is not a fair test. It seems likely that your SuSe distribution has 64-bit mode turned on by default. So, one thing you could try is to switch back to 32-bit mode on your C compiler, and see if Hat then works for you. Here is how: * Add the flag "-m32" to the symbol OPT defined in Makefile.inc * Add the flag "-m32" to every symbol CFLAGS defined in src/hattools/Makefile * make clean * make * etc Let us know how you get on. Regards, Malcolm

Malcolm, did you find out out anything new? Maik -- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.

I guess the source of the problem is the 64bit system. Last time I looked at the Hat code a couple of months ago I noticed that for storing node references it sometimes uses C ints, sometimes an explicit 4 byte type. It assumes these are equivalent... It should systematically use a 4 byte type. I was too lazy to systematically clean all source code. Ciao, Olaf

Ok, thanks for your answer Olaf and greetings from University of Kiel (and Bernd Brassel) -- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.

Hi, hat-check Insort returns the following message:
strange tag 24 at byte offset 0x42e
-- View this message in context: http://www.nabble.com/hat-trail%3A-attempt-to-read-beyond-end-of-file-tf2436... Sent from the Haskell - Hat mailing list archive at Nabble.com.
participants (4)
-
Barzille
-
Malcolm Wallace
-
Olaf Chitil
-
Thomas Davie