On Monday 15 October 2001 12:59, David Hamilton wrote:
> Hmmm!
> I've got a simple C++ program running under rtlinux. When I stop it
> with rmmod, my systems locks up. I've narrowed this down to a delete
> call in one of my destructors. Actually this is my only delete call
> executed in a thread

That's probably exactly why it locks up.


> (deletes called directly from cleanup_module work
> ok).
> There is nothing wrong with the code (it will fail even if the object
> destructors do nothing).
> Perhaps, I'm not linking correctly with the definitions of new and
> delete included in the rtl_cpp.h file!?
>
> Which brings me to a question. Why do the new and delete functions have
> to be declared at all? Aren't they part of the C++ programming
> language.

Yes, but they are still operators, which must be implemented. This is 
usually done in some standard library (normally using malloc() and 
free()), but 1) as you're building a module (a kind of shared library), 
you never link with a standard C++ library, and 2), even if you *did* 
link that library in, it wouldn't load into kernel space, as there are no 
malloc() or free() functions in there.


> Are the standard C++ versions unacceptable to RTLinux?
> Perhaps my code is linking to the normal C++ definitions of new and
> delete and that is why the system crashes.

No. The module would refuse to load due to unresolved symbols.


//David Olofson --- Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
|      Multimedia Application Integration Architecture      |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------------> http://www.linuxdj.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`-------------------------------------> http://olofson.net -'
-- [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/

Reply via email to