Weak pointers can cause segfault
The attached program segfaults. It appears to be nondeterministic, but on my machine, it occurs at least 95% of the time. Some small changes, such as removing the bang pattern, cause the segfault to become much less likely.
weakPointerSegfault: internal error: ASSERTION FAILED: file rts/sm/GCAux.c, line 44 (GHC version 18.104.22.16860411 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug Aborted (core dumped)