Skip to content

Test case 'rts/cloneMyStack' fails with optimizations using NCG

Summary

Test case testsuite/tests/rts/cloneMyStack.hs should return with no error when run and it does when compiled without optimizations, using NCG:

~/myghc/_build/stage1/bin/ghc cloneStackLib.c cloneMyStack.hs && ./cloneMyStack

(Exits normally)

However, when using optimizations, this fails:

~/myghc/_build/stage1/bin/ghc -O cloneStackLib.c cloneMyStack.hs && ./cloneMyStack

Prints:

loneMyStack: internal error: Wrong closure type on stack! Expected 30 but got 34 in position 1 (GHC version 9.5.20220804 for x86_64_unknown_linux) Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug Aborted (core dumped)

Similar Issues

I'm debugging an issue in my own branch, so I ran the test suite with --test-way=optasm and am seeing 19 unexpected failures.

This is the second issue I looked at more closely, manually compiling it and finding it present in main. So there might be more to come.

Environment

  • GHC version used: devel2 build from main (commit from 5. Aug. eff57f1b5dbd)

Optional:

  • Operating System: Ubuntu 20.04
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information