[lug] Linux protected memory question

Daniel Webb webb at danielwebb.us
Thu Dec 5 14:02:49 MST 2002


I'm writing a debug and assertions library for C, and the question has
come up:

Is memory malloc'ed by a shared library in the same protected memory area
(is this called a segment?) as the calling program?  In other words, if my
shared library gets some malloc'ed memory, can the program that links with
my library change that malloc'ed memory without detection, or will it
guarantee a segmentation fault?

Also, what techniques do people here use for assertions and debug
messages.  I found the GNU Nana package, which inserts hooks for gdb.  My
library is a little different, than nana though.  I'll release it here
first to get some feedback, if anyone here still programs in C.






More information about the LUG mailing list