Skip to content

Conversation

@vanyasem
Copy link

@vanyasem vanyasem commented Oct 19, 2024

GNU Make 4.4.1 on Arch Linux segfaults when encountering You're running a modern Linux Kernel (version $(KERNELRELEASE)).: segmentation fault (core dumped)

It's fixed by using a simple assignment := for KERNELRELEASE instead of a conditional assignment ?=

Behavior without the fix:
Stock

Behavior with the fix:
Changed assignment

Verifying segfault source by removing the reference to the variable:
Removed reference

@leninalive
Copy link

leninalive commented Oct 21, 2024

This will not work with DKMS for which this module is primarily designated.

Couldn't you run DKMS with your Arch Linux installation instead of proposing this patch?

@vanyasem
Copy link
Author

@leninalive

Couldn't you run DKMS with your Arch Linux installation instead of proposing this patch?

Without this patch, I cannot execute any make commands, including the one that makes the DKMS module in the first place - any invocation of make results in a segfault. I attached screenshots to better illustrate the problem.

Locally I just decided to get rid of the 41st line which prints the error message on missing kernel sources, which is the line that's causing the issue, as you can see on the third screenshot.

This issue will affect other distributions at some point, as sooner or later other distros will also update their packages to affected versions. Arch Linux can essentially be seen as a preview of problems to come due to its rolling release update model.

@leninalive
Copy link

leninalive commented Oct 21, 2024

No, you can by simply running sudo make -C src dkms-install KERNELRELEASE=$(uname -r).

I believe that it is something wrong with your own Arch installation and/or you should at least report this issue to Arch/Make contributors, not us (see the screenshot).

image

@krab4t
Copy link

krab4t commented Oct 23, 2024

https://savannah.gnu.org/bugs/index.php?65172 You need that patch.
Or shorter variable name MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR in src/Makefile.

@vanyasem vanyasem mentioned this pull request Oct 25, 2024
@vanyasem
Copy link
Author

https://savannah.gnu.org/bugs/index.php?65172 You need that patch. Or shorter variable name MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR in src/Makefile.

I can confirm that using a shorter variable name solves the issue:
sed -i 's/MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR/KERNEL_SRC_ABSENT_ERR/g' 'src/Makefile'

While the upstream bug has been fixed, it has not yet make it to a stable make release.

I have observed the issue on GNU Make 4.4.1 on a fresh Arch Linux installation

@vanyasem
Copy link
Author

The patch was incorporated into amneziawg-dkms AUR package

@vanyasem
Copy link
Author

The patch was incorporated into amneziawg-dkms-git AUR package

@vanyasem vanyasem changed the title Makefile: Use simple assignment for KERNELRELEASE Makefile: segmentation fault (core dumped) with GNU Make 4.4.1 Jan 16, 2025
@vanyasem
Copy link
Author

https://savannah.gnu.org/bugs/index.php?65172 You need that patch. Or shorter variable name MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR in src/Makefile.

As GNU Make 4.4.1 is still the latest stable version with no new stable release in sight for more than two years, I updated the PR to rename MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR to have a shorter name, while preserving its original meaning.

This exact patch has already been incorporated into Arch build pipeline, and has been proven to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants