PSA: 9.2.1 AArch64 miscompilation

The slew of new changes in GHC 9.2.1, including all the work the lead to the lead to subword type info in Cmm to support the C Calling Convention on aarch64-darwin (Sidenote: you should use CApiFFI, and never CFFI if you use varargs, …), and subsequently led to subword primops, sadly also led to a set of low level miscompilations on the aarch64 backend.

This was tragically not caught by GHCs test-suite; a gaping coverage failure of GHC’s test suite. @bgamari has started building a quickcheck based tool Ben Gamari / test-primops · GitLab to test these subword primops properly. GHC 9.2.2 should contain the following merge request, which should hopefully rectify all now known bugs. Draft: Various codegen fixes (!6934) · Merge requests · Glasgow Haskell Compiler / GHC · GitLab

11 Likes

tl;dr Do not use GHC 9.2.1 on aarch64 (including Mac M1). A wide range of operations (e. g., anything dealing with Unicode) silently return incorrect results.

6 Likes

Cheers thanks for the transparency Moritz. Things happen. Looking forward to the fix :+1:

4 Likes