Closure bug in code compiled with 9.0.2

I’m seeing this quite a bit in a project at work

heffalump: internal error: evacuate: strange closure type 28723585
(GHC version 9.0.2 for x86_64_unknown_linux)
Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

I did some searching but found discouragingly little information. Maybe someone here know more and can offer some insights?

1 Like

I would guess that reporting the bug is the best way to quickly get more information on the problem.

3 Likes

Indeed GHC people are very friendly and helpful in debugging.

I’m just afraid that I won’t be able to offer much information. My project isn’t big, only ~460 lines of Haskell, but it depends on some rather large packages (including an unreleased version of Amazonka).

The only information I’ve managed to find suggests that it’s likely related to some rather low-level stuff, which would rule out the code I’m writing myself.

In the end they have way more experience and might give you a helpful hint.

Yes, this kind of error is generally at the RTS/FFI level. The error message means that the GC has run into some heap corruption, but that’s a symptom rather than the actual cause. For example, some FFI code might be holding on to a reference into the Haskell heap after GHC thinks it is safe to free it.

Ideally, try to come up with a minimized reproducer that cuts down your code/dependencies as much as possible while still exhibiting the bug. But then reporting it on the GHC tracker is the way to go.

3 Likes

I would add that if you can upgrade to a newer ghc, you may find the bug has been fixed, and that would tend to be best course of action if at all possible.

1 Like

Due to dependencies not being updated for 9.2 yet I ended up downgrading the GHC version instead. That solved the issue for me.

1 Like

Downgrading to which GHC version? Just curious

It would indeed be appreciated if you can open a ticket. We would rather know about these issues than not and having a reproducer of any size can be very helpful.

2 Likes

I downgraded to 8.10.

1 Like