Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 703010

Summary: dev-haskell/http-4000.3.14 setup build failed with 'evacuate: strange closure type 0'
Product: Gentoo Linux Reporter: Harley Wiltzer <harleyw>
Component: Current packagesAssignee: Gentoo's Haskell Language team <haskell>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jstein
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Output of emerge --info "=dev-haskell/http-4000.3.14"
Build log

Description Harley Wiltzer 2019-12-15 16:12:11 UTC
Created attachment 599658 [details]
Output of emerge --info "=dev-haskell/http-4000.3.14"

Encountered the following error when trying to merge dev-haskell/http-4000.3.14:

Network/Stream.hs:52:24: warning: [-Wdeprecations]
    In the use of ‘strMsg’
    (imported from Control.Monad.Error, but defined in transformers-0.5.2.0:Control.Monad.Trans.Error):
    Deprecated: "Use Control.Monad.Trans.Except instead"
[ 3 of 18] Compiling Network.HTTP.Utils ( Network/HTTP/Utils.hs, dist/build/Network/HTTP/Utils.o )
[ 4 of 18] Compiling Network.HTTP.MD5Aux ( Network/HTTP/MD5Aux.hs, dist/build/Network/HTTP/MD5Aux.o )
ghc: internal error: evacuate: strange closure type 0
    (GHC version 8.0.2 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
/var/tmp/portage/dev-haskell/http-4000.3.14/temp/environment: line 429:    40 Aborted                 ./setup "$@"
 * ERROR: dev-haskell/http-4000.3.14::gentoo failed (compile phase):
 *   setup build failed
 * 
 * Call stack:
 *     ebuild.sh, line  125:  Called src_compile
 *   environment, line 1845:  Called haskell-cabal_src_compile
 *   environment, line 1502:  Called cabal_src_compile
 *   environment, line  674:  Called cabal-build
 *   environment, line  432:  Called die
 * The specific snippet of code:
 *       ./setup "$@" || die "setup build failed"

I've found older bug reports online with similar errors in the Haskell bug tracker and this Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=373947 . It seems this arises due to memory corruption in GHC as I understand it.
Comment 1 Harley Wiltzer 2019-12-15 16:12:47 UTC
Created attachment 599660 [details]
Build log
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-15 20:12:00 UTC
Yes, it's usually a low-level memory corruption on haskell heap. Might be a GHC bug, external C library bug or hardware memory corruption.

If you try to build dev-haskell/http a few times does it fail in a similar way? Do you observe similar error on other haskell packages?
Comment 3 Harley Wiltzer 2019-12-15 23:15:48 UTC
(In reply to Sergei Trofimovich from comment #2)
> Yes, it's usually a low-level memory corruption on haskell heap. Might be a
> GHC bug, external C library bug or hardware memory corruption.
> 
> If you try to build dev-haskell/http a few times does it fail in a similar
> way? Do you observe similar error on other haskell packages?

Hmm, I hadn't thought of just trying to build it a few times, but turns out that worked :) 
Successfully built dev-haskell/http-4000.3.14, followed by dev-haskell/cabal-install, app-text/pandoc, and dev-haskell/pandoc-citeproc, all without issues.

Thanks for the help!
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2019-12-16 08:18:17 UTC
I tried to build http in a loop for a a few hundred times and got no failures. Closing as WORKSFORME.

I suggest to check you RAM with sys-apps/memtest86+ (or something similar) to rule out simple bit flip hardware corruption. Those are very nasty.