New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault building mono on Linux Kernel 6.2.14 #21651
Comments
|
I ran into the same issue, see the meta-mono issue and the Fedora issue The crash problems started with 6.2.13, and it's also present with 6.3.1 from https://koji.fedoraproject.org/koji/buildinfo?buildID=2196477 |
|
We're also getting segfaults on recent kernels (at least 6.1.26 and 6.3.0 are affected). But only when running mono on certain executables: NixOS/nixpkgs#229476 There's a kernel regression where mmap(2) with flag MAP_32BIT is broken (returns ENOMEM even if enough virtual memory space in the first 4GB is available) (ref) If it is the same issue, try applying the following patch and see if it helps: Patch |
The patch was published at mono/mono#21651 (comment) It had to be slightly adapted to be applicable. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
It was indeed the same problem. Building mono-native succeeds on Fedora 38 with kernel 6.3.1 |
The patch was published at mono/mono#21651 (comment) It had to be slightly adapted to be applicable. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
* Add a patch to disable using MAP_32BIT to mmap() The patch was published at mono/mono#21651 (comment) It had to be slightly adapted to be applicable. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * Use oe_runmake for Mono 6.xx This allows parallel builds. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --------- Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
|
Took me a while to parse the Linux kernel mailing list referenced in @raphaelr's patch, so I figured I'd link it here: The regression has been acknowledged upstream and a fix has been merged in the There's no indication on when this will make it to mainline kernel and whether the fix will be backported to the affected 6.1, 6.2, and 6.3 branches. If/when it is, then I assume the workaround to disable mmap support in Mono would no longer be necessary. |
|
Should be fixed in 6.1.30 and 6.3.4, (see) |
|
I can confirm Kernel 6.3.4 fixed it for me, so I'm going to close this. Thanks to everyone that contributed here :) |
* Mickledore support (#164) * conf/layer.conf: Add mickledore to LAYERSERIES_COMPAT Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * mono: Fix early parsing errors for mono 4.x and 5.x versions Apparently, PV is unset when mono_workspace_version() is first used. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --------- Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * msbuild: Depend on curl-native and ca-certificates-native (#165) * Msbuild replace libhostfxr with dotnet with fixes (#166) * CI_github: Update CI to Node 16 to remove warnings Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> * CI_github: Update master build branch to langdale Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> * Fix python3-pythonnet recipe build for langdale (#169) * Fix python3-pythonnet recipe build for langdale * Try to fix compiling task of python3-pythonnet * Refactoring pythonnet and clr_loader recipe * dotnet: add dotnet v7.0.202 (#167) Signed-off-by: Ben Fekih, Hichem <hichem.benfekih@ifm.com> * remove dotnet v3.1.11 and update dotnet 6 to 6.0.15 (#171) * CI_github: Add dotnet v7 to CI build matrix Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> * Add summary for python3-pythonnet and python3-clr-loader recipes (#175) * Fix python3-pythonnet recipe build for langdale * Try to fix compiling task of python3-pythonnet * Refactoring pythonnet and clr_loader recipe * Add summary for python3-pythonnet and python3-clr-loader recipe * Fix mmap segfault on recent kernels (#183) * Add a patch to disable using MAP_32BIT to mmap() The patch was published at mono/mono#21651 (comment) It had to be slightly adapted to be applicable. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * Use oe_runmake for Mono 6.xx This allows parallel builds. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --------- Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * 6.12.0.182 (#181) * mono: Add recipe for version 6.12.0.182 This is a recent stable release. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * Prefer version 6.12.0.182 Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --------- Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * Add msbuild 16.10.1 recipe (#184) * msbuild: Add recipe for version 16.10.1 Mono 6.12.0.182 needs the new msbuild version. Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * conf/layer.conf: Prefer the newest msbuild version Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * Bump CI to use Mono 6.12.0.182 Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> --------- Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> * libgdiplus: Use git:// SRC_URI (#186) * Update python3-pythonnet and python3-clr-loader (#187) * Update python3-pythonnet and python3-clr-loader * Fix sha256sum of python3-clr-loader and python3-pythonnet * Switch to using mickledore for master build (#188) Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> * Prepare master to merge mickledore (#189) --------- Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com> Signed-off-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> Signed-off-by: Ben Fekih, Hichem <hichem.benfekih@ifm.com> Co-authored-by: Zoltán Böszörményi <zboszor@gmail.com> Co-authored-by: Alex J Lennon <ajlennon@dynamicdevices.co.uk> Co-authored-by: Hichem <hichem.benfekih@ifm.com>
On Kernel 6.2.14 (tested on F38) I cannot build mono. I noticed this initially because where I work we have a pre-built Mono from an older kernel version, and this also segfaults on 6.2.14. I was building locally to diagnose the issue, but mono compilation does AOT compilation of framework assemblies, and so the just built mono also segfaults.
I rolled my F38 back to 6.2.9 and everything works fine, including the pre-built Mono we use. To make sure this wasn't a Fedora distro kernel bug, I manually built 6.2.14 and reproduced the same problem.
Steps to Reproduce
Every time it is the same location for the segfault (detailed in stacktrace below)
In this case it's amd specific code, so it is possible this is only reproducible on amd CPUs. I have not tried on an intel machine, unfortunately.
Current Behavior
It segfaults when building.
Expected Behavior
Not segfaulting when building, the same behaviour when using kernel 6.2.9.
On which platforms did you notice this
[ ] macOS
[*] Linux
[ ] Windows
Version Used:
mono/mono commit 3005442 (main as of this post)
Stacktrace
The text was updated successfully, but these errors were encountered: