|
From: Tom H. <to...@co...> - 2005-08-12 07:40:53
|
In message <200...@ge...>
Christian Parpart <tr...@ge...> wrote:
> Well, when it comes to an end, and all modules have safely to be unloaded I
> get *strange strange* results, that is, the order on how I do unload them
> *seems* important - or else the daemon raises SEGV when accessing some
> certain memory and V reports "Invalid read of size 8";
Sounds like a routine case of a bad memory access - valgrind tells you
your program is about to do something naughty then your program does
it and gets a segv.
> Unfortunately, this "Invalid read" doesn't help me, especially, when only a
> stupid dlclose() being commented out can fix this;
Why? Did valgrind not tell you where the invalid read was?
> maybe the daemon is still accessing memory that *was* part of the dlopen()ed
> module - can that be true?
That would certainly cause a problem if you were to do that.
> Is there a way to verify that?
Once again, it ought to be obvious from valgrind's error report but as
you haven't provided that it is hard to say for sure.
> And, is VG in general having an eye on misusage of dlopen/dlclose/related
> functions?
Well dlopen will mmap the bits of the library into memory and then
dlcose will munmap them again and valgrind will certainly notice that
mapping and unmapping of memory and act on it.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|