|
From: <sv...@va...> - 2009-06-05 05:28:22
|
Author: njn
Date: 2009-06-05 06:28:17 +0100 (Fri, 05 Jun 2009)
New Revision: 10250
Log:
Increase a hard limit that was reached in the wild.
Modified:
trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-06-05 01:33:16 UTC (rev 10249)
+++ trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-06-05 05:28:17 UTC (rev 10250)
@@ -3374,6 +3374,8 @@
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 @@
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;
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c 2009-06-05 01:33:16 UTC (rev 10249)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c 2009-06-05 05:28:17 UTC (rev 10250)
@@ -592,10 +592,13 @@
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;
|