<div dir="ltr">Hello GHC Devs,<div><br></div><div>It seems to me that GHC is rather broken on aarch64, at least since 8.2.1 (and at least on the machines I have access to). I first noticed this issue with Nixpkgs (<a href="https://github.com/NixOS/nixpkgs/issues/40301">https://github.com/NixOS/nixpkgs/issues/40301</a>), so to check that this isn't some Nixpkgs idiosyncrasy I went ahead and built my own GHC 8.4.3 for aarch64 (there's no binary release at <a href="https://www.haskell.org/ghc/download_ghc_8_4_3.html">https://www.haskell.org/ghc/download_ghc_8_4_3.html</a> to try, but perhaps I've missed something.</div><div><br></div><div>It seems the only Nix idiosyncrasy was passing "--ghc-option=-j${cores}" to "./Setup.hs configure". The issue is triggered by using '-jn' for any n greater than one when building any non-trivial package, but I've found hscolour1.24.4 reproduces it very reliably (perhaps because there are opportunities for parallelism early in its module dependency graph?). GHC very often (although not always) will fail with one of:<br></div><div><br></div><div>- Segmentation fault.</div><div>- Bus fault</div><div>-<font face="monospace, monospace"> <no location info>: error:</font></div><div><font face="monospace, monospace">    ghc: panic! (the 'impossible' happened)</font></div><div><font face="monospace, monospace">  (GHC version 8.4.3 for aarch64-unknown-linux):</font></div><div><font face="monospace, monospace">        Binary.UserData: no put_binding_name</font></div><div><font face="monospace, monospace"><br></font></div><div>- <font face="monospace, monospace">ghc: internal error: MUT_VAR_CLEAN object entered!</font></div><div><font face="monospace, monospace">    (GHC version 8.4.3 for aarch64_unknown_linux)</font></div><div><font face="monospace, monospace">    Please report this as a GHC bug:  <a href="http://www.haskell.org/ghc/reportabug">http://www.haskell.org/ghc/reportabug</a></font></div><div><font face="monospace, monospace">Aborted (core dumped)</font></div><div><br></div><div>The fix, excruciating as it may be on already slow arm machines, is to use '-j1'. This issue seems present on each GHC release since 8.2.1 (although I haven't tried HEAD yet). I haven't noticed any issues with any other concurrent Haskell programs on aarch64.</div><div><br></div><div>There are some umbrella bugs for aarch64 in Trac, so I wanted to ask here before filing a ticket. Has anyone else noticed this behavior on aarch64? What's more, are there any tips for using GDB to hunt down synchronization issues in GHC?</div><div><br></div><div>Thanks for all your hard work!</div><div><br></div><div>Travis</div></div>