Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Runtime error with llvm-ptx backend: double free or corruption (!prev) #532

Open
mcwitt opened this issue May 30, 2023 · 0 comments
Open

Comments

@mcwitt
Copy link

mcwitt commented May 30, 2023

Description

I'm seeing the following runtime error in a minimal example intended to generate a 2D array, when run with the accelerate-llvm-ptx backend. The error is

double free or corruption (!prev)

and coincides by the process dying with SIGABRT.

The behavior seems to be dependent on the size of the generated array. On my machine, there is no error for sizes smaller than 363; for 363 and larger I get the runtime error.

Steps to reproduce

  1. Use the following Main.hs

    module Main where
    
    import Data.Array.Accelerate as A
    import qualified Data.Array.Accelerate.LLVM.PTX as GPU
    
    indices :: Exp Int -> Acc (Array DIM2 (Int, Int))
    indices n = generate (I2 n n) unindex2
    
    run :: Int -> IO ()
    run =
      writeFile "out"
        . show
        . GPU.run
        . indices
        . constant
    
    main :: IO ()
    main = run 363 -- <= 362 succeeds
  2. Compile with ghc Main.hs -threaded

  3. Run with ./Main

(The complete code along with cabal file and Nix files is in this gist.)

Expected behaviour
The sample code should not fail with double free or corruption (!prev), regardless of the size of the generated array (at least for reasonable sizes).

Your environment

@mcwitt mcwitt changed the title [BUG] Runtime error: double free or corruption (!prev) with llvm-ptx backend [BUG] Runtime error with llvm-ptx backend: double free or corruption (!prev) May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant