Re: Null pointer exception for local variables in stack with C++kernel modules

From: Bernhard Walle
Date: Tue Jan 04 2011 - 17:10:50 EST

Hello Leo,

Am 04.01.11 20:46, schrieb Leo Prasath:
> I have integrated a C++ codebase which uses minimalistic features of c
> and followed the guidelines in
> to integrate with an existing C linux kernel module.
> It all works fine except for occassional very very weird NULL pointer
> exceptions.

Wild guess: Stack overflow. In the kernel the stack is very limited
(depends on the configuration and IIRC on the archtecture, but 4K is the
minimum IIRC) and in C++ it's possible and common to put larger objects
on the stack.

However, C++ isn't supported by the kernel developers and you're on your
own. Rewrite the code to use plain C.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at