Re: [GHC] #1004: ghci-6.6 crash on PPC

2006-11-14 Thread GHC
#1004: ghci-6.6 crash on PPC
-+--
 Reporter:  [EMAIL PROTECTED]  |  Owner:  
 Type:  bug  | Status:  new 
 Priority:  normal   |  Milestone:  
Component:  GHCi |Version:  6.6 
 Severity:  normal   | Resolution:  
 Keywords:   | Difficulty:  Unknown 
 Testcase:   |   Architecture:  Multiple
   Os:  MacOS X  |  
-+--
Changes (by wolfgang):

  * architecture:  powerpc => Multiple

Comment:

 Also happens on Mac OS X/Intel.

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler___
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs


Re: [GHC] #1004: ghci-6.6 crash on PPC

2006-11-14 Thread Gregory Wright


Hi Thorkil,

A corrected version not referencing the Utils module is attached to  
ticket 1004 now.

Thanks for pointing that out.

Greg

On Nov 14, 2006, at 4:57 PM, Thorkil Naur wrote:


Hello,

I tried to reproduce this. Here is the result:

Thorkil-Naurs-Computer:~/tn/tmp/GHC/trac/#1004: ghci-6.6 crash on
PPC/ghc-6.4.1
thorkilnaur$ /Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6/ghc/ 
compiler/stage2/ghc-inplace

--interactive Checksum.hs
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for  
Haskell 98.

/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.

Checksum.hs:12:8:
Could not find module `Utils':
  Use -v to see a list of the files searched for.
Failed, modules loaded: none.
Prelude> :q
Leaving GHCi.

After editing Checksum.hs to remove import Utils:

Thorkil-Naurs-Computer:~/tn/tmp/GHC/trac/#1004: ghci-6.6 crash on
PPC/ghc-6.4.1
thorkilnaur$ /Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6/ghc/ 
compiler/stage2/ghc-inplace

--interactive Checksum.hs
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for  
Haskell 98.

/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.
[1 of 1] Compiling Main ( Checksum.hs, interpreted )

Checksum.hs:82:36: Not in scope: `splitWord'
Failed, modules loaded: none.
Prelude>


Could something be missing from your report?

Best regards
Thorkil

On Tuesday 14 November 2006 15:23, GHC wrote:

#1004: ghci-6.6 crash on PPC
 
+---

Reporter:  [EMAIL PROTECTED]  |   Owner:
Type:  bug  |  Status:  new
Priority:  normal   |   Milestone:
   Component:  GHCi | Version:  6.6
Severity:  normal   |Keywords:
  Difficulty:  Unknown  |Testcase:
Architecture:  powerpc  |  Os:  MacOS X
 
+---
During a long (10 to 15 minute) run of a communication system  
simulation,

 I noticed had occasional crashes of ghci with the output

 {{{
 : internal error: interpretBCO: unknown or  
unimplemented

 opcode 1028
 (GHC version 6.6 for powerpc_apple_darwin)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Abort trap
 gregory-wrights-powerbook-g4-17>
 }}}

 or
 {{{
 : internal error: interpretBCO: unknown or  
unimplemented

 opcode 1033
 (GHC version 6.6 for powerpc_apple_darwin)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Abort trap
 a83-245-238-133>
 }}}

 or
 {{{
 : internal error: interpretBCO: unknown or  
unimplemented

 opcode 1040
 (GHC version 6.6 for powerpc_apple_darwin)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Abort trap
 a83-245-238-133>
 }}}

 The same code when compiled would run to completion.

 I could not post the original code because it contained proprietary
 customer information. However, I have been able to isolate a much  
smaller

 case which also fails.

 The module below, which computes a 16 bit checksum function,  
fails when

 run under
 ghci with

 {{{
 [9,120,46,192,248,87,242,122,183,2,96,217,164,46]
 85:
 [203,223,98,240,74,91,106]
 86:
 [78,239,201,3,74,238,146,170,71]
 87:
 [46,128,19,27,218,48,10,148test aborted: <>
 *Main>
 }}}

 The same code runs to completion when compiled:

 {{{

[15,76,203,225,63,86,10,21,39,140,91,244,38,101,10,197,212,24,242,50,1 
05,139,139,210,108,79,185,171,127,232,57,37,77,234,164,47,175,91,78,19 
8,237,253,153,83,159,7,11,30,138,150,19,68,10,234,46,101,39,146,46,164 
, 
52,54,109,163,46,174,22,46,61,43,234,125,148,182,188,19,4,48,84,227,57 
, 
156,152,55,235,211,204,10,104,170,40,209,174,238,200,16,82,204,203,133 
, 
196,42,146,8,66,171,67,142,208,67,67,37,237,48,249,99,212,152,79,52,13 
6,104,187,218,6,73,174,244,146,118,202,141,26,79,34,91,10,167,41,244,1 
51,47,28,35,181,199,244,233,221,118,64,53,59,245,245,166,255,86,124,37 
, 
192,175,203,184,52,155,141,66,247,227,51,40,154,150,9,121,215,237,21,2 
3,60,83,31,27,23,128,18,83,17,119,136,73,46,60,242,79,190,189,56,154,2 
29,47,92,242,81,157,251,51,27,4,93,213,103,176,144,43,12,187,5,85,109, 
42,194,214,30,110,129,129,197,97,239,210,133,201,180,207,123,120,62,10 
6,47,30,1,207,30,213,219,210,158,67,101,164,149,85,6,138,52,55,64,160, 
85,119,132,247,226,255,29,3,122,235,217,228,83,197,157,41,208,138,23,1 
52,48,93,53,223,40,168,17,129,29,48,250,31,136,4,213,136,178,70,10,207 
,43,48,69,157,71,31,119,137,137]

 997:
 [48,92,91,80,79,62,248,169,156,171,156,102,154,114]
 998:

[15,114,1,127,222,71,195,235,182,211,65,168,67,179,4,19,254,43,233,199 
, 
198,183,24,14,172,222,226,46,159,82,3,193,193,217,220,

Re: [GHC] #1004: ghci-6.6 crash on PPC

2006-11-14 Thread GHC
#1004: ghci-6.6 crash on PPC
-+--
 Reporter:  [EMAIL PROTECTED]  |  Owner: 
 Type:  bug  | Status:  new
 Priority:  normal   |  Milestone: 
Component:  GHCi |Version:  6.6
 Severity:  normal   | Resolution: 
 Keywords:   | Difficulty:  Unknown
 Testcase:   |   Architecture:  powerpc
   Os:  MacOS X  |  
-+--
Comment (by [EMAIL PROTECTED]):

 The original example I enclosed contained a reference to another module.
 That is corrected below:

 {{{
 {-# OPTIONS_GHC -fglasgow-exts #-}
 --
 -- Checksum.hs, support for checksumming data.
 --


 --module Checksum (
 --checksum
 --) where
 module Main where

 --import Utils

 import Control.Exception
 import Data.Array
 import Data.Bits
 import Data.List
 import Data.Word
 import Test.QuickCheck
 import Test.QuickCheck.Batch


 crcTable :: Array Word8 Word16
 crcTable = listArray (0, 255)
 [ 0x, 0x5935, 0xB26A, 0xEB5F, 0x3DE1, 0x64D4, 0x8F8B, 0xD6BE,
   0x7BC2, 0x22F7, 0xC9A8, 0x909D, 0x4623, 0x1F16, 0xF449, 0xAD7C,
   0xF784, 0xAEB1, 0x45EE, 0x1CDB, 0xCA65, 0x9350, 0x780F, 0x213A,
   0x8C46, 0xD573, 0x3E2C, 0x6719, 0xB1A7, 0xE892, 0x03CD, 0x5AF8,
   0xB63D, 0xEF08, 0x0457, 0x5D62, 0x8BDC, 0xD2E9, 0x39B6, 0x6083,
   0xCDFF, 0x94CA, 0x7F95, 0x26A0, 0xF01E, 0xA92B, 0x4274, 0x1B41,
   0x41B9, 0x188C, 0xF3D3, 0xAAE6, 0x7C58, 0x256D, 0xCE32, 0x9707,
   0x3A7B, 0x634E, 0x8811, 0xD124, 0x079A, 0x5EAF, 0xB5F0, 0xECC5,
   0x354F, 0x6C7A, 0x8725, 0xDE10, 0x08AE, 0x519B, 0xBAC4, 0xE3F1,
   0x4E8D, 0x17B8, 0xFCE7, 0xA5D2, 0x736C, 0x2A59, 0xC106, 0x9833,
   0xC2CB, 0x9BFE, 0x70A1, 0x2994, 0xFF2A, 0xA61F, 0x4D40, 0x1475,
   0xB909, 0xE03C, 0x0B63, 0x5256, 0x84E8, 0x, 0x3682, 0x6FB7,
   0x8372, 0xDA47, 0x3118, 0x682D, 0xBE93, 0xE7A6, 0x0CF9, 0x55CC,
   0xF8B0, 0xA185, 0x4ADA, 0x13EF, 0xC551, 0x9C64, 0x773B, 0x2E0E,
   0x74F6, 0x2DC3, 0xC69C, 0x9FA9, 0x4917, 0x1022, 0xFB7D, 0xA248,
   0x0F34, 0x5601, 0xBD5E, 0xE46B, 0x32D5, 0x6BE0, 0x80BF, 0xD98A,
   0x6A9E, 0x33AB, 0xD8F4, 0x81C1, 0x577F, 0x0E4A, 0xE515, 0xBC20,
   0x115C, 0x4869, 0xA336, 0xFA03, 0x2CBD, 0x7588, 0x9ED7, 0xC7E2,
   0x9D1A, 0xC42F, 0x2F70, 0x7645, 0xA0FB, 0xF9CE, 0x1291, 0x4BA4,
   0xE6D8, 0xBFED, 0x54B2, 0x0D87, 0xDB39, 0x820C, 0x6953, 0x3066,
   0xDCA3, 0x8596, 0x6EC9, 0x37FC, 0xE142, 0xB877, 0x5328, 0x0A1D,
   0xA761, 0xFE54, 0x150B, 0x4C3E, 0x9A80, 0xC3B5, 0x28EA, 0x71DF,
   0x2B27, 0x7212, 0x994D, 0xC078, 0x16C6, 0x4FF3, 0xA4AC, 0xFD99,
   0x50E5, 0x09D0, 0xE28F, 0xBBBA, 0x6D04, 0x3431, 0xDF6E, 0x865B,
   0x5FD1, 0x06E4, 0xEDBB, 0xB48E, 0x6230, 0x3B05, 0xD05A, 0x896F,
   0x2413, 0x7D26, 0x9679, 0xCF4C, 0x19F2, 0x40C7, 0xAB98, 0xF2AD,
   0xA855, 0xF160, 0x1A3F, 0x430A, 0x95B4, 0xCC81, 0x27DE, 0x7EEB,
   0xD397, 0x8AA2, 0x61FD, 0x38C8, 0xEE76, 0xB743, 0x5C1C, 0x0529,
   0xE9EC, 0xB0D9, 0x5B86, 0x02B3, 0xD40D, 0x8D38, 0x6667, 0x3F52,
   0x922E, 0xCB1B, 0x2044, 0x7971, 0xAFCF, 0xF6FA, 0x1DA5, 0x4490,
   0x1E68, 0x475D, 0xAC02, 0xF537, 0x2389, 0x7ABC, 0x91E3, 0xC8D6,
   0x65AA, 0x3C9F, 0xD7C0, 0x8EF5, 0x584B, 0x017E, 0xEA21, 0xB314 ]


 -- | Compute our standard checksum
 --
 checksum :: [Word8] -> Word16
 checksum msg =
 let
 update :: Word16 -> Word8 -> Word16
 update reg byte = (reg `shiftL` 8) `xor`
   crcTable ! ((fromIntegral (reg `shiftR`
 8)) `xor` byte)
 in
 foldl' update 0 msg



 -- | Tests
 --
 instance Arbitrary Word8 where
arbitrary =
   do n <- choose ((fromIntegral (minBound :: Word8)) :: Int,
   (fromIntegral (maxBound :: Word8)) :: Int)
  return (fromIntegral n)
coarbitrary v = variant 0 . coarbitrary v


 -- | Split a 16 bit word into a list of two bytes. The head of the
 resulting
 --   list is the most significant byte.
 --
 splitWord :: Word16
   -> [Word8]
 splitWord w =
 let
 hi = w `shiftR` 8
 lo = w .&. 0x00ff
 in
 [(fromIntegral hi :: Word8), (fromIntegral lo :: Word8)]



 prop_checksum xs = checksum (xs ++ splitWord (checksum xs)) == 0
where types = xs :: [Word8]

 testOpts = TestOptions {no_of_tests = 1000,
 length_of_tests = 3600,
 debug_tests = True}

 batch = do
   result <- run prop_checksum testOpts
   case result of
 TestOk   _i _ -> putStrLn ("test ok: " ++ show i)
 TestExausted _i _ -> putStrLn ("test exhausted: " ++ show i)
 TestFailed   strs i   -> putStrLn ("test failed: " ++ concat strs)
 TestAborted  ex 

Re: [GHC] #1004: ghci-6.6 crash on PPC

2006-11-14 Thread Thorkil Naur
Hello,

I tried to reproduce this. Here is the result:

Thorkil-Naurs-Computer:~/tn/tmp/GHC/trac/#1004: ghci-6.6 crash on 
PPC/ghc-6.4.1 
thorkilnaur$ 
/Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6/ghc/compiler/stage2/ghc-inplace
 
--interactive Checksum.hs
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.

Checksum.hs:12:8:
Could not find module `Utils':
  Use -v to see a list of the files searched for.
Failed, modules loaded: none.
Prelude> :q
Leaving GHCi.

After editing Checksum.hs to remove import Utils:

Thorkil-Naurs-Computer:~/tn/tmp/GHC/trac/#1004: ghci-6.6 crash on 
PPC/ghc-6.4.1 
thorkilnaur$ 
/Users/thorkilnaur/tn/GHCDarcsRepository/ghc-6.6/ghc/compiler/stage2/ghc-inplace
 
--interactive Checksum.hs
   ___ ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |  GHC Interactive, version 6.6, for Haskell 98.
/ /_\\/ __  / /___| |  http://www.haskell.org/ghc/
\/\/ /_/\/|_|  Type :? for help.

Loading package base ... linking ... done.
[1 of 1] Compiling Main ( Checksum.hs, interpreted )

Checksum.hs:82:36: Not in scope: `splitWord'
Failed, modules loaded: none.
Prelude>


Could something be missing from your report?

Best regards
Thorkil

On Tuesday 14 November 2006 15:23, GHC wrote:
> #1004: ghci-6.6 crash on PPC
> +---
> Reporter:  [EMAIL PROTECTED]  |   Owner: 
> Type:  bug  |  Status:  new
> Priority:  normal   |   Milestone: 
>Component:  GHCi | Version:  6.6
> Severity:  normal   |Keywords: 
>   Difficulty:  Unknown  |Testcase: 
> Architecture:  powerpc  |  Os:  MacOS X
> +---
> During a long (10 to 15 minute) run of a communication system simulation,
>  I noticed had occasional crashes of ghci with the output
> 
>  {{{
>  : internal error: interpretBCO: unknown or unimplemented
>  opcode 1028
>  (GHC version 6.6 for powerpc_apple_darwin)
>  Please report this as a GHC bug:
>  http://www.haskell.org/ghc/reportabug
>  Abort trap
>  gregory-wrights-powerbook-g4-17>
>  }}}
> 
>  or
>  {{{
>  : internal error: interpretBCO: unknown or unimplemented
>  opcode 1033
>  (GHC version 6.6 for powerpc_apple_darwin)
>  Please report this as a GHC bug:
>  http://www.haskell.org/ghc/reportabug
>  Abort trap
>  a83-245-238-133>
>  }}}
> 
>  or
>  {{{
>  : internal error: interpretBCO: unknown or unimplemented
>  opcode 1040
>  (GHC version 6.6 for powerpc_apple_darwin)
>  Please report this as a GHC bug:
>  http://www.haskell.org/ghc/reportabug
>  Abort trap
>  a83-245-238-133>
>  }}}
> 
>  The same code when compiled would run to completion.
> 
>  I could not post the original code because it contained proprietary
>  customer information. However, I have been able to isolate a much smaller
>  case which also fails.
> 
>  The module below, which computes a 16 bit checksum function, fails when
>  run under
>  ghci with
> 
>  {{{
>  [9,120,46,192,248,87,242,122,183,2,96,217,164,46]
>  85:
>  [203,223,98,240,74,91,106]
>  86:
>  [78,239,201,3,74,238,146,170,71]
>  87:
>  [46,128,19,27,218,48,10,148test aborted: <>
>  *Main>
>  }}}
> 
>  The same code runs to completion when compiled:
> 
>  {{{
>  
[15,76,203,225,63,86,10,21,39,140,91,244,38,101,10,197,212,24,242,50,105,139,139,210,108,79,185,171,127,232,57,37,77,234,164,47,175,91,78,198,237,253,153,83,159,7,11,30,138,150,19,68,10,234,46,101,39,146,46,164,52,54,109,163,46,174,22,46,61,43,234,125,148,182,188,19,4,48,84,227,57,156,152,55,235,211,204,10,104,170,40,209,174,238,200,16,82,204,203,133,196,42,146,8,66,171,67,142,208,67,67,37,237,48,249,99,212,152,79,52,136,104,187,218,6,73,174,244,146,118,202,141,26,79,34,91,10,167,41,244,151,47,28,35,181,199,244,233,221,118,64,53,59,245,245,166,255,86,124,37,192,175,203,184,52,155,141,66,247,227,51,40,154,150,9,121,215,237,21,23,60,83,31,27,23,128,18,83,17,119,136,73,46,60,242,79,190,189,56,154,229,47,92,242,81,157,251,51,27,4,93,213,103,176,144,43,12,187,5,85,109,42,194,214,30,110,129,129,197,97,239,210,133,201,180,207,123,120,62,106,47,30,1,207,30,213,219,210,158,67,101,164,149,85,6,138,52,55,64,160,85,119,132,247,226,255,29,3,122,235,217,228,83,197,157,41,208,138,23,152,48,93,53,223,40,168,17,129,29,48,250,31,136,4,213,136,178,70,10,207,43,48,69,157,71,31,119,137,137]
>  997:
>  [48,92,91,80,79,62,248,169,156,171,156,102,154,114]
>  998:
>  
[15,114,1,127,222,71,195,235,182,211,65,168,67,179,4,19,254,43,233,199,198,183,24,14,172,222,226,46,159,82,3,193,193,217,220,132,152,241,159,127,177,210,117,82,209,63,204,101,150,202,45,180,4

[GHC] #1004: ghci-6.6 crash on PPC

2006-11-14 Thread GHC
#1004: ghci-6.6 crash on PPC
+---
Reporter:  [EMAIL PROTECTED]  |   Owner: 
Type:  bug  |  Status:  new
Priority:  normal   |   Milestone: 
   Component:  GHCi | Version:  6.6
Severity:  normal   |Keywords: 
  Difficulty:  Unknown  |Testcase: 
Architecture:  powerpc  |  Os:  MacOS X
+---
During a long (10 to 15 minute) run of a communication system simulation,
 I noticed had occasional crashes of ghci with the output

 {{{
 : internal error: interpretBCO: unknown or unimplemented
 opcode 1028
 (GHC version 6.6 for powerpc_apple_darwin)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Abort trap
 gregory-wrights-powerbook-g4-17>
 }}}

 or
 {{{
 : internal error: interpretBCO: unknown or unimplemented
 opcode 1033
 (GHC version 6.6 for powerpc_apple_darwin)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Abort trap
 a83-245-238-133>
 }}}

 or
 {{{
 : internal error: interpretBCO: unknown or unimplemented
 opcode 1040
 (GHC version 6.6 for powerpc_apple_darwin)
 Please report this as a GHC bug:
 http://www.haskell.org/ghc/reportabug
 Abort trap
 a83-245-238-133>
 }}}

 The same code when compiled would run to completion.

 I could not post the original code because it contained proprietary
 customer information. However, I have been able to isolate a much smaller
 case which also fails.

 The module below, which computes a 16 bit checksum function, fails when
 run under
 ghci with

 {{{
 [9,120,46,192,248,87,242,122,183,2,96,217,164,46]
 85:
 [203,223,98,240,74,91,106]
 86:
 [78,239,201,3,74,238,146,170,71]
 87:
 [46,128,19,27,218,48,10,148test aborted: <>
 *Main>
 }}}

 The same code runs to completion when compiled:

 {{{
 
[15,76,203,225,63,86,10,21,39,140,91,244,38,101,10,197,212,24,242,50,105,139,139,210,108,79,185,171,127,232,57,37,77,234,164,47,175,91,78,198,237,253,153,83,159,7,11,30,138,150,19,68,10,234,46,101,39,146,46,164,52,54,109,163,46,174,22,46,61,43,234,125,148,182,188,19,4,48,84,227,57,156,152,55,235,211,204,10,104,170,40,209,174,238,200,16,82,204,203,133,196,42,146,8,66,171,67,142,208,67,67,37,237,48,249,99,212,152,79,52,136,104,187,218,6,73,174,244,146,118,202,141,26,79,34,91,10,167,41,244,151,47,28,35,181,199,244,233,221,118,64,53,59,245,245,166,255,86,124,37,192,175,203,184,52,155,141,66,247,227,51,40,154,150,9,121,215,237,21,23,60,83,31,27,23,128,18,83,17,119,136,73,46,60,242,79,190,189,56,154,229,47,92,242,81,157,251,51,27,4,93,213,103,176,144,43,12,187,5,85,109,42,194,214,30,110,129,129,197,97,239,210,133,201,180,207,123,120,62,106,47,30,1,207,30,213,219,210,158,67,101,164,149,85,6,138,52,55,64,160,85,119,132,247,226,255,29,3,122,235,217,228,83,197,157,41,208,138,23,152,48,93,53,223,40,168,17,129,29,48,250,31,136,4,213,136,178,70,10,207,43,48,69,157,71,31,119,137,137]
 997:
 [48,92,91,80,79,62,248,169,156,171,156,102,154,114]
 998:
 
[15,114,1,127,222,71,195,235,182,211,65,168,67,179,4,19,254,43,233,199,198,183,24,14,172,222,226,46,159,82,3,193,193,217,220,132,152,241,159,127,177,210,117,82,209,63,204,101,150,202,45,180,42,156,185,8,110,231,86,232,25,112,80,170,185,19,251,161,111,129,248,165,179,223,161,147,71,248,192,21,223,148,130,11,241,98,20,49,23,3,29,29,253,173,66,3,145,39,80,94,51,30,221,168,120,184,34,26,11,156,197,135,223,150,105,131,44,83,240,223,100,135,234,90,9,126,151,231,251,155,206,248,82,106,246,57,69,79,126,33,48,238,30,3,126,98,83,187,176]
 999:
 
[75,152,189,37,228,208,62,124,131,3,10,115,211,204,85,147,90,85,99,165,239,44,78,114,117,68,255,230,78,248,36,211,116,120,69,30,126,96,46,95,207,157,63,232,198,5,197]
 test ok: 1000
 ~/src/haskell/simulator $
 }}}

 The module is

 {{{
 {-# OPTIONS_GHC -fglasgow-exts #-}
 --
 -- Checksum.hs, support for checksumming data.
 --


 --module Checksum (
 --checksum
 --) where
 module Main where

 import Utils

 import Control.Exception
 import Data.Array
 import Data.Bits
 import Data.List
 import Data.Word
 import Test.QuickCheck
 import Test.QuickCheck.Batch


 crcTable :: Array Word8 Word16
 crcTable = listArray (0, 255)
 [ 0x, 0x5935, 0xB26A, 0xEB5F, 0x3DE1, 0x64D4, 0x8F8B, 0xD6BE,
   0x7BC2, 0x22F7, 0xC9A8, 0x909D, 0x4623, 0x1F16, 0xF449, 0xAD7C,
   0xF784, 0xAEB1, 0x45EE, 0x1CDB, 0xCA65, 0x9350, 0x780F, 0x213A,
   0x8C46, 0xD573, 0x3E2C, 0x6719, 0xB1A7, 0xE892, 0x03CD, 0x5AF8,
   0xB63D, 0xEF08, 0x0457, 0x5D62, 0x8BDC, 0xD2E9, 0x39B6, 0x6083,
   0xCDFF, 0x94CA, 0x7F95, 0x26A0, 0xF01E, 0xA92B, 0x4274, 0x1B41,
   0x41B9, 0x188C, 0xF3D3, 0xAAE6, 0x7C58, 0x256D, 0xCE32, 0x9707,
   0x3A7B, 0x634E, 0x8811, 0xD124, 0x079A, 0x5EAF, 0xB5F0, 0xECC5,
   0x354F, 0x6C7A, 0x8725, 0xDE10, 0x08AE, 0x519B, 0xBAC4,