From: Bernhard Walle <bernhard@bwalle.de>
To: Leo Prasath <leo.prasath@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Null pointer exception for local variables in stack with C++ kernel modules
Date: Tue, 04 Jan 2011 23:10:41 +0100 [thread overview]
Message-ID: <4D239AE1.10003@bwalle.de> (raw)
In-Reply-To: <AANLkTik_dFBq5=GDB3tmiN0N=hc1iaif0hv4URnm2f5b@mail.gmail.com>
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
prev parent reply other threads:[~2011-01-04 22:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTimH+xa3Na6Y+M=UNZSfjph5etyTtc=v2TMdqwHj@mail.gmail.com>
2011-01-04 19:46 ` Null pointer exception for local variables in stack with C++ kernel modules Leo Prasath
2011-01-04 22:10 ` Bernhard Walle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D239AE1.10003@bwalle.de \
--to=bernhard@bwalle.de \
--cc=leo.prasath@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox