Since the full virtualistion changes went in one of our programs that is linked against about 150 shared objects has started reporting "mmap failed" for a number of them when trying to read the symbol table. Increasing VALGRIND_MAPSIZE stops this, but it seems that there is really a lack of space but rather valgrind is getting confused about how much space it has available and the call to VG_(find_map_space) at the start of VG_(mmap) starts returning NULL for mmap's from valgrind's address space.
Created attachment 3774 [details] Patch to make VG_(munmap) work properly It turns out that the problem is VG_(munmap) which was never actually updating valgrind's record of the mappings because it was testing VG_(is_kerror) rather than VG_(is_kerror)(res)...
Well, I tried to reproduce this by making a client program which repeatedly does lots of mmap/munmap calls. The theory being that if Valgrind's Segment list was getting corrupted, then this should trigger it. However, it seems to work fine, so something more subtle must be going on. Could you add some prints to see what's being passed to VG_(find_map_space)?
Subject: Re: programs with lots of shared libraries report "mmap failed" for some of them when reading symbols In message <20031219222325.6918.qmail@ktown.kde.org> you wrote: > Well, I tried to reproduce this by making a client program which repeatedly > does lots of mmap/munmap calls. The theory being that if Valgrind's > Segment list was getting corrupted, then this should trigger it. However, > it seems to work fine, so something more subtle must be going on. > > Could you add some prints to see what's being passed to VG_(find_map_space)? Did you you not see the patch I attached to this bug after I worked through it this morning and found the cause? Tom
Subject: Re: programs with lots of shared libraries report "mmap failed" for some of them when reading symbols On Sat, 2003-12-20 at 03:52, Tom Hughes wrote: > Did you you not see the patch I attached to this bug after I worked > through it this morning and found the cause? No, I hadn't noticed. Committed. I've made that typo before... J
*** Bug has been marked as fixed ***.
https://booksarefun.com/educators