[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4D239AE1.10003@bwalle.de>
Date: Tue, 04 Jan 2011 23:10:41 +0100
From: Bernhard Walle <bernhard@...lle.de>
To: Leo Prasath <leo.prasath@...il.com>
CC: linux-kernel@...r.kernel.org
Subject: Re: Null pointer exception for local variables in stack with C++
kernel modules
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
> http://pograph.wordpress.com/2009/04/05/porting-cpp-code-to-linux-kernel/
> 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.
Regards,
Bernhard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists