Actually I am really curious now.. how does dynamic memory allocation in
C++ (the 'new' keyword) work if you want to use C++ in a kernel module??
-Calin
On Tue, 25 Sep 2001, Maik Hassel wrote:
> Hi!
>
> Please prevent me from getting crazy:
>
> I have (pretty large) a rt-module that accesses some cpp-class members. The
> class is "simple" in the sense that it uses no virtual members ansd so on,
> just ordinary data-types and some simple instanciated templates that are
> based on fixed length c-arrays.
>
> What drives me crazy is that after some simple extensions the system doesn't
> work any more! The whole machine just reboots. For example:
>
> ------- snip ----------
>
> int Parse(unsigned int fifo)
> {
> int msg, nReturn = OK, laenge, error, nBewegung_ok, nZustand;
> int nAchse, nAnzahl, nAusgang, nArt, nFall, nFunktion,
>
> Vektor<int, 6> nvInkremente;
> Vektor<double,3> Sollkraftrichtung;
>
>
> // Without this array it works, otherwise it crashes! The array is not used
> // elsewere"
> int testarray[1000000];
>
> if ((laenge = rtf_get(fifo, &msg, sizeof(msg))) == sizeof(msg))
> {
> error = FALSE;
> nReturn = OK;
> switch (msg)
> (...)
>
>
> ---- snap -----
>
> After three weeks I'm pretty shure that there is no null-pointer thing or
> something that could create a "seg fault".
> Sometimes (really spare), when I decrease the size of the array, the first
> machine gives me a page fault in a kernel oops and hangs a few minutes later!
> Without the array, everything works fine!!!
> The interesting this is: A Celeron based machine is much less sensitive to
> the crashes than a PIII! Sometimes, with the array shown above, a Celeron
> runs for 5 minutes bevor crashing, while the PIII reboots even right away!
>
> Is there anybody out there that has an idea about what could be the problem?
> Is there something like a maximum size of a module? Do C++ class-related
> problems occure above a certain module size? I'm helpless....
>
> Thanks for every help
> Maik
>
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
> echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
> --
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/
>
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/