Bug 70827 - programs with lots of shared libraries report "mmap failed" for some of them when reading symbols
Summary: programs with lots of shared libraries report "mmap failed" for some of them ...
Status: RESOLVED FIXED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 2.1 CVS
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Jeremy Fitzhardinge
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-19 10:26 UTC by Tom Hughes
Modified: 2025-04-03 14:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Patch to make VG_(munmap) work properly (597 bytes, patch)
2003-12-19 11:26 UTC, Tom Hughes
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Hughes 2003-12-19 10:26:51 UTC
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.
Comment 1 Tom Hughes 2003-12-19 11:26:36 UTC
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)...
Comment 2 Jeremy Fitzhardinge 2003-12-19 23:23:24 UTC
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)?
Comment 3 Tom Hughes 2003-12-20 12:52:19 UTC
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

Comment 4 Jeremy Fitzhardinge 2003-12-20 19:20:03 UTC
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

Comment 5 Jeremy Fitzhardinge 2003-12-20 21:23:36 UTC
*** Bug has been marked as fixed ***.
Comment 6 john more 2025-04-03 14:41:52 UTC
https://booksarefun.com/educators