hat-trail: attempt to read beyond end of file

View: New views
15 Messages — Rating Filter:   Alert me  

hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: hat-trail: attempt to read beyond end of file

by Thomas Davie :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
> http://www.haskell.org/mailman/listinfo/hat

_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat

Re: hat-trail: attempt to read beyond end of file

by Malcolm Wallace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas Davie <tom.davie@...> wrote:

> 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
_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat

Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

hat-check Insort returns the following message:

> strange tag 24 at byte offset 0x42e



Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Insort.hs

Re: hat-trail: attempt to read beyond end of file

by Malcolm Wallace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Barzille <barzille@...> writes:

> > strange tag 24 at byte offset 0x42e
> I added my Insort.hs. I hope that's the file you're thinking of...

No, we need the binary file Insort.hat.

Regards,
    Malcolm
_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat

Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, here it is:

Insort.hat

Re: hat-trail: attempt to read beyond end of file

by Malcolm Wallace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Barzille <barzille@...> writes:

> 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
_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat

Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

>Can you tell us what machine architecture and operating system you are using?  

I am using 64 Bit sy<stem with Suse 10.1 OSS

>You mentioned that installation was difficult.  What did you need to do that was unusual?

I only had some problems with the correct installation paths of hmake and hat. And it did not work unless using the config patch for hat.

Regards,
    Malcolm
_______________________________________________
Hat mailing list
Hat@haskell.org
http://www.haskell.org/mailman/listinfo/hat



Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Malcolm, did you find out out anything new?

Maik

Re: hat-trail: attempt to read beyond end of file

by Olaf Chitil :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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

_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat

Re: hat-trail: attempt to read beyond end of file

by Malcolm Wallace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Barzille <barzille@...> wrote:

> I am using 64 Bit sy<stem with Suse 10.1 OSS

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
_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat

Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, thanks for your help. I hope to hear from you soon...

Maik

Re: hat-trail: attempt to read beyond end of file

by Barzille :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, thanks for your answer Olaf and greetings from University of Kiel (and Bernd Brassel)

Re: hat-trail: attempt to read beyond end of file

by Malcolm Wallace :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> > I am using 64 Bit sy<stem with Suse 10.1 OSS
>
> 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
_______________________________________________
Hat mailing list
Hat@...
http://www.haskell.org/mailman/listinfo/hat