haskell-hvr / cryptohash-sha1

Fast, pure and practical SHA1 implementation
https://hackage.haskell.org/package/cryptohash-sha1
Other
6 stars 9 forks source link

Crashes in `cabal repl` on Win 10 #8

Closed fendor closed 1 year ago

fendor commented 4 years ago

Repo with minimal reproduction: https://github.com/fendor/cryptohash-sha1-min-repr

Code:

import qualified Crypto.Hash.SHA1               as H

main :: IO ()
main = (H.updates H.init ["hello", "world", "efewfwefwefwef", "ewfwefwefwef"]) `seq` putStrLn "Loaded"

Success:

cabal run exes

But executing:

cabal repl
> main

Produces this error:


Access violation in generated code when reading 0xffffffffffffffff

 Attempting to reconstruct a stack trace...

   Frame        Code address
 * 0x777dd30    0xf7912e0 C:\Users\Privat\AppData\Roaming\cabal\store\ghc-8.6.5\cryptohash-sh_-0.11.10_-bea6299b379c28bda524952b226e6787957d6614\lib\libHScryptohash-sh_-0.11.10_-bea6299b379c28bda524952b226e6787957d6614.a(sha1.o)+0x11b0
                 (hs_cryptohash_sha1_init+0x0)
 * 0x777dd38    0xf780169 C:\Users\Privat\AppData\Roaming\cabal\store\ghc-8.6.5\cryptohash-sh_-0.11.10_-bea6299b379c28bda524952b226e6787957d6614\lib\libHScryptohash-sh_-0.11.10_-bea6299b379c28bda524952b226e6787957d6614.a(SHA1.o)+0x89
                 (cryptohashzmshzuzm0zi11zi10zuzmbea6299b379c28bda524952b226e6787957d6614_CryptoziHashziSHA1_init_info+0x67)
 * 0x777dd40    0x4dae610
 * 0x777dd48    0x7e244b8

cabal.exe: repl failed for exe:min-repr from min-repr-0.1.0.0. The build
process terminated with exit code 11

Didnt have time yet to test this behaviour with latest GHC.

EDIT: Can not be reproduced on linux (nixos).

jneira commented 4 years ago

I can reproduce simply cloning the example project and running cabal repl with ghc-8.6.5 but no for ghc-8.10.1 or ghc-8.8.3.

fendor commented 4 years ago

Can confirm for ghc-8.10.1.

andreasabel commented 1 year ago

Thanks, @fendor, for the nice MWE.

Can't reproduce this on Windows with cryptohash-sha1-0.11.101.0, neither with GHC 8.6.5 nor 9.6.1.