Bug 2209162 - ghci-9.2.6 segfaults with "mmap 4096 bytes at (nil): Cannot allocate memory"
Summary: ghci-9.2.6 segfaults with "mmap 4096 bytes at (nil): Cannot allocate memory"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 38
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-05-22 23:06 UTC by alex
Modified: 2023-06-11 01:58 UTC (History)
18 users (show)

Fixed In Version: kernel-6.3.4-200.fc38 kernel-6.3.4-101.fc37 kernel-6.3.4-201.fc38
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-31 01:44:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
ABRT info including coredump (3.34 MB, application/x-xz)
2023-05-22 23:07 UTC, alex
no flags Details

Description alex 2023-05-22 23:06:14 UTC
When I run GHCi, it sometimes segfaults immediately.

Reproducible: Sometimes

Steps to Reproduce:
1. Run GHCi.
Actual Results:  
$ ghci
GHCi, version 9.2.6: https://www.haskell.org/ghc/  :? for help
ghc-9.2.6: mmap 4096 bytes at (nil): Cannot allocate memory
ghc-9.2.6: Try specifying an address with +RTS -xm<addr> -RTS
Segmentation fault (core dumped)

Expected Results:  
GHCi does not segfault.

Comment 1 alex 2023-05-22 23:07:15 UTC
Created attachment 1966312 [details]
ABRT info including coredump

Comment 2 Jens Petersen 2023-05-23 10:09:36 UTC
Thanks for the report - I have noticed the abrt backtraces :-(

This is actually due to mmap related changes in the Linux kernel...
As a workaround you can try using ghc9.4 instead for the time being.

For more details see
https://discourse.haskell.org/t/facing-mmap-4096-bytes-at-nil-cannot-allocate-memory-youre-not-alone/6259/12
where I also posted a comment, including a workaround (ghc scratch build) for F38.

Comment 3 Jens Petersen 2023-05-23 10:11:11 UTC
Also a partial temporary workaround is to revert from kernel-6.3 to 6.2 which seems less affected.
Or 6.2.9 which doesn't have the problem.

Comment 4 Jens Petersen 2023-05-23 10:30:11 UTC
I may start by first committing the proposed upstream backport to the ghc9.2 package first.

Comment 5 Jens Petersen 2023-05-24 13:27:15 UTC
Moving this at least temporarily to kernel for awareness.

Comment 6 Fedora Update System 2023-05-25 13:32:27 UTC
FEDORA-2023-5c8c091faf has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-5c8c091faf

Comment 7 Jens Petersen 2023-05-25 13:41:34 UTC
I have pushed fixed for the current Fedora ghc package (and will for Fedora ghc9.2 as well)
but the problem is that any upstream ghc builds before 9.2.8 (yet to be released) or ghc 9.4
as well as any Haskell executables made with them as liable to exhibit this crash with
kernel > 6.2.9.  It would be great to known if the upstream is going to do anything about this.
I heard there was some mm patchset perhaps, but curious if anything else is affected
and if something will be done in the kernel?

I will likely have to rebuild most of the executable haskell packages in Fedora too for this.
For F37 we don't even have a backport. :-(

Comment 8 Jens Petersen 2023-05-26 00:54:29 UTC
From others I believe this regression is related to the "Maple Tree" changes (I am not a kernel person).

There is discussion here:

https://lore.kernel.org/linux-mm/20230302184341.bju3vjqhkfm4giqm@revolver/
https://lore.kernel.org/linux-mm/190c5b1b-df67-eb54-1559-706ed4e5719a@hercules-ci.com/
https://lore.kernel.org/linux-mm/20230505145829.74574-1-zhangpeng.00@bytedance.com/

Comment 9 Fedora Update System 2023-05-26 02:22:52 UTC
FEDORA-2023-5c8c091faf has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-5c8c091faf`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-5c8c091faf

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2023-05-26 04:41:14 UTC
FEDORA-2023-2f144e888a has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2f144e888a

Comment 11 Jens Petersen 2023-05-26 04:44:52 UTC
(In reply to Jens Petersen from comment #8)
> https://lore.kernel.org/linux-mm/20230505145829.74574-1-zhangpeng.
> 00/

Okay I learned that this already got into kernel-6.3.4 :-)
So that is quite a relief, thanks

Comment 12 Jens Petersen 2023-05-26 05:30:14 UTC
Also fixed apparently with kernel-6.4.0-0.rc3.20230523gitae8373a5add4.29.fc39

Comment 13 Fedora Update System 2023-05-26 11:03:05 UTC
FEDORA-2023-997fc4d8a6 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-997fc4d8a6

Comment 14 Fedora Update System 2023-05-27 01:32:05 UTC
FEDORA-2023-2f144e888a has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-2f144e888a`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-2f144e888a

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2023-05-27 02:16:20 UTC
FEDORA-2023-997fc4d8a6 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-997fc4d8a6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-997fc4d8a6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2023-05-29 05:56:44 UTC
FEDORA-2023-514965dd8a has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-514965dd8a

Comment 17 Fedora Update System 2023-05-29 05:58:06 UTC
FEDORA-2023-2f35633034 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-2f35633034

Comment 18 Fedora Update System 2023-05-31 01:44:58 UTC
FEDORA-2023-2f35633034 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 19 Fedora Update System 2023-05-31 02:50:04 UTC
FEDORA-2023-416474be55 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-416474be55`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-416474be55

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 20 Fedora Update System 2023-05-31 17:30:00 UTC
FEDORA-2023-514965dd8a has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 21 Fedora Update System 2023-06-03 02:44:12 UTC
FEDORA-2023-5c8c091faf has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 22 Fedora Update System 2023-06-03 03:18:40 UTC
FEDORA-2023-928c7761f6 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-928c7761f6`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-928c7761f6

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 23 Fedora Update System 2023-06-08 02:02:27 UTC
FEDORA-2023-416474be55 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 24 Fedora Update System 2023-06-11 01:58:14 UTC
FEDORA-2023-928c7761f6 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.