FS#54823 - [ghc] Haskell programs display warning "unable to decommit memory: Invalid argument"

Attached to Project: Community Packages
Opened by Baptiste (zorun) - Saturday, 15 July 2017, 12:19 GMT
Last edited by Felix Yan (felixonmars) - Sunday, 16 July 2017, 09:22 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
I installed hledger (which depends on ghc), and it turns out that several haskell programs display a warning when they run. For instance during post-install hooks:

(1/3) Rebuilding Haskell doc index...
haddock: unable to decommit memory: Invalid argument haddock: unable to decommit memory: Invalid argument
...
(2/3) Registering Haskell modules...
ghc-pkg: unable to decommit memory: Invalid argument
...

Or when running hledger:

hledger: unable to decommit memory: Invalid argument

Apart from this message, the programs seem to work fine.

Version: ghc 8.0.2-2
This task depends upon

Closed by  Felix Yan (felixonmars)
Sunday, 16 July 2017, 09:22 GMT
Reason for closing:  Fixed
Additional comments about closing:  8.0.2-3
Comment by Felix Yan (felixonmars) - Saturday, 15 July 2017, 14:08 GMT
I cannot reproduce it here. Do you have a custom glibc or something else in the dependency tree of ghc?
Comment by Baptiste (zorun) - Saturday, 15 July 2017, 14:38 GMT
Good point, I'm not using the default kernel, I run 4.4.70 (from htps://aur.archlinux.org/packages/linux-mptcp/)

After looking around a bit, kernel support for this "memory decommit" functionality changed in Linux 4.5. So, ghc gets confused when it is built with kernel >= 4.5 but runs with kernel < 4.5.

The issue has been fixed upstream [https://git.haskell.org/ghc.git/commitdiff/6576bf83cdf4eac05eb88a24aa934a736c91e3da] but only in the upcoming 8.3 branch.

Feel free to close this bug report, since I use an unsupported kernel. I will get the fix when upgrading to a newer kernel or ghc 8.3 is released, whichever comes first :)

Relevant references:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=847677
https://ghc.haskell.org/trac/ghc/ticket/12495
https://ghc.haskell.org/trac/ghc/ticket/12865
https://github.com/simonmichael/hledger/issues/541
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860829
Comment by Felix Yan (felixonmars) - Saturday, 15 July 2017, 16:26 GMT
8.3 is a development branch and I assume it will be released as 8.4.x, which is quite a long time away.

I have backported the patch, please try ghc 8.0.2-3.
Comment by Baptiste (zorun) - Sunday, 16 July 2017, 09:15 GMT
Thanks, it fixes the issue!

Loading...