0

I'm running Linux Mint with kernel version 3.8.0-29-generic. So I downloaded and extracted the Linux Kernel 3.8.9 source code and placed the folder in the main directory. Now using the command make menuconfig in the gnome-terminal I get the make error message:

DALEK linux-3.8.9 # make menuconfig
  HOSTCC  scripts/basic/fixdep
Segmentation fault
make[1]: *** [scripts/basic/fixdep] Error 139
make: *** [scripts_basic] Error 2

So I did a memory test before booting up and there are no memory errors. So what's the problem? FTR I am using a Toshiba satellite L500 with x86_64 architecture. It was suggested by someone else that the kernel source is not configured for this architecture....And if that's the case where might I find a Linux kernel that works for x86_64?

The reason I'm trying to do this is in preparation to build the kernel source in order to create a kernel module: Is that even necessary with the Kernel already installed???

2 Answers 2

0

No, the kernel source is architecture-independant. Although some not really supported ancient architectures (f.e. 32bit MIPS) could need local patches, x86_64 isn't one of them.

Try to increase verbosity to see, what this make does. Maybe the segfault happens not in the compiler, but in the just compiled fixdep binary.

In both cases, there is a major problem with your kernel source or with your system.

(You could yet give a try a complete new kernel source download/uncompress, if it broke somehow, then all will be ok)

2
  • A segmentation fault is a memory access violation. And this can happen when compiled userspace code is executed and attempts to read memory registers that are in the Kernel space. Inline assembly in userspace code can certainly do this as it allows you to directly read and manipulate cpu and memory registers.
    – Mr X
    Nov 27, 2013 at 7:06
  • Also, there are 2 versions of memcmp: One is implemented in the /lib/string.c source file and one is in the /arch/x86/boot.h header. The former only works in real address mode. So no wonder I got that segmentation fault!
    – Mr X
    Nov 27, 2013 at 7:18
0

So apparently I thought that the makefile script was using the headers in the /usr/src/linux-headers-3.8.0-29-generic/ folder but it also makes use of the GCC headers in /usr/lib/gcc/x86_64-linux-gnu/4.7.3/include/ folder. As it turns out, many others got the same error(segmentation fault: Error 139). And from the error messages is was the fixdep executable file which was a target of the makefile in the /scripts/basic/ folder whose source code is fixdep.c. One site said something about the "CONFIG_MODULE" listing and I noticed that uses the memcmp function. I had defined that function using some hackneyed inline assembly code I got from somewhere and placed in in the header. So I rewrote that using standard c code and that eliminated the segmentation error entirely!

I guess that inline assembly code may have been trying to access protected memory which can cause a segmentation error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .