diff options
author | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-06-05 05:28:17 +0000 |
---|---|---|
committer | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2009-06-05 05:28:17 +0000 |
commit | f31cce91afd36ed9dd38606707a6867c9a3aa1cc (patch) | |
tree | 6e99a5a46ac92ab6c8fff3cb1e999a22a03a0f58 /coregrind | |
parent | 4e8808b021205659734885e2ca2665e225109b83 (diff) | |
download | valgrind-f31cce91afd36ed9dd38606707a6867c9a3aa1cc.tar.gz |
Increase a hard limit that was reached in the wild.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10250 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'coregrind')
-rw-r--r-- | coregrind/m_aspacemgr/aspacemgr-linux.c | 5 | ||||
-rw-r--r-- | coregrind/m_syswrap/syswrap-darwin.c | 11 |
2 files changed, 11 insertions, 5 deletions
diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 0af3bb5f2..c9bf5b365 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -3374,6 +3374,8 @@ static void add_mapping_callback(Addr addr, SizeT len, UInt prot, else if (nsegments[i].kind == SkFree || nsegments[i].kind == SkResvn) { /* Add mapping for SkResvn regions */ ChangedSeg* cs = &css_local[css_used_local]; + // If this assert fails, the css_size arg passed to + // VG_(get_changed_segments) needs to be increased. aspacem_assert(css_used_local < css_size_local); cs->is_added = True; cs->start = addr; @@ -3433,8 +3435,9 @@ static void remove_mapping_callback(Addr addr, SizeT len) if (nsegments[i].kind != SkFree && nsegments[i].kind != SkResvn) { // V has a mapping, kernel doesn't ChangedSeg* cs = &css_local[css_used_local]; + // If this assert fails, the css_size arg passed to + // VG_(get_changed_segments) needs to be increased. aspacem_assert(css_used_local < css_size_local); - cs->is_added = True; cs->is_added = False; cs->start = nsegments[i].start; cs->end = nsegments[i].end; diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 20d665f0f..d9278e555 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -592,10 +592,13 @@ void VG_(show_open_ports)(void) static void sync_mappings(const HChar *when, const HChar *where, Int num) { - // I haven't seen more than 1 segment be added or removed in a single calls - // to sync_mappings(). So 20 seems generous. The upper bound is the - // number of segments currently in use. --njn - #define CSS_SIZE 20 + // Usually the number of segments added/removed in a single calls is very + // small e.g. 1. But the limit was 20 at one point, and that wasn't enough + // for at least one invocation of Firefox. If we need to go much bigger, + // should probably make VG_(get_changed_segments) fail if the size isn't + // big enough, and repeatedly redo it with progressively bigger dynamically + // allocated buffers until it succeeds. + #define CSS_SIZE 100 ChangedSeg css[CSS_SIZE]; Int css_used; Int i; |