Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,264
    • Issues 5,264
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 568
    • Merge requests 568
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11126
Closed
Open
Issue created Nov 23, 2015 by tuplanolla@trac-tuplanolla

Entered absent arg in a Repa program

Consider the following program.

module Main where

import Data.Array.Repa

data Stuff = !(Array U DIM1 Double) `With` !Double deriving Show

through :: Maybe Double -> Stuff -> Stuff
m `through` (a `With` _) =
  let b = a +^ (negate `smap` sumS (extend (Z :. All :. (1 :: Int)) a))
      c = maybe b (const (negate `smap` a)) m in
      computeUnboxedS c `With` sumAllS b

main :: IO ()
main = print $ Just 1 `through` (fromListUnboxed (Z :. 1) [1] `With` 1)

It should produce the following result once run.

AUnboxed (Z :. 1) (fromList [-1.0]) `With` 0.0

However, when built using repa-3.4.0.1 and compiled with the options -O3 -Wall -funfolding-keeness-factor1000 -funfolding-use-threshold1000, it crashes as follows.

Main: Oops!  Entered absent arg arr2 Array D DIM1 Double

Adding -fno-strictness to the compiler options or removing strictness annotations from the code makes the problem disappear, so this looks like a strictness analyzer problem.

The libraries used were

  • QuickCheck-2.8.1,
  • array-0.5.1.0,
  • base-4.8.1.0,
  • bytestring-0.10.6.0,
  • containers-0.5.6.2,
  • deepseq-1.4.1.1,
  • ghc-prim-0.4.0.0,
  • integer-gmp-1.0.0.0,
  • pretty-1.1.2.0,
  • primitive-0.6,
  • random-1.1,
  • repa-3.4.0.1,
  • template-haskell-2.10.0.0,
  • tf-random-0.5,
  • time-1.5.0.1,
  • transformers-0.4.2.0 and
  • vector-0.10.12.3.
Trac metadata
Trac field Value
Version 7.10.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking