Page MenuHomeSolus

GHCi randomly SIGABRT/SIGSEV (Cannot allocate memory)
Open, NormalPublic

Description

I haven't found a way to reliably reproduce this. Sometimes you get this immediately after you invoke ghci, sometimes you get this after feeding ghci a few statements. Usually, try invoking and Ctrl+D exiting ghci several times, and you'll get a error like below:

gavinzhao@solus ~> /usr/bin/ghci
GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
ghc: mmap 131072 bytes at (nil): Cannot allocate memory
ghc: Try specifying an address with +RTS -xm<addr> -RTS
ghc: internal error: m32_allocator_init: Failed to map
    (GHC version 8.6.5 for x86_64_unknown_linux)
    Please report this as a GHC bug:  http://www.haskell.org/ghc/reportabug
fish: Job 1, '/usr/bin/ghci' terminated by signal SIGABRT (Abort)

I tried the official binaries provided by ghcup, and I get a similar error, so I think it's not on our fault:

gavinzhao@solus ~> ghci
GHCi, version 9.2.7: https://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/gavinzhao/.ghci
ghc: mmap 4096 bytes at (nil): Cannot allocate memory
ghc: Try specifying an address with +RTS -xm<addr> -RTS
fish: Job 1, 'ghci' terminated by signal SIGSEGV (Address boundary error)

cc @liontiger23. Maybe we need this patch stemming from this issue? What confuses me is that I never recall this appearing until recently, but if it is indeed the same problem outlined in the patch I should've encountered this multiple times in the past few months.

Backported patches worth considering when updating to 8.10, which includes this patch.

Event Timeline

GZGavinZhao renamed this task from GHCi randomly SIGABRT/SIGSEV to GHCi randomly SIGABRT/SIGSEV (Cannot allocate memory).May 23 2023, 1:15 AM
GZGavinZhao created this task.

Might need to build libffi with --disable-exec-static-tramp but i'm not sure if this is the same issue

ermo triaged this task as Normal priority.Jun 17 2023, 12:35 PM