Skip to content

Commit 0e96eeb

Browse files
authored
[msan] Reland: Increase k num stack origin descrs (limited to non-PowerPC) (#93117)
The original pull request (#92838) was reverted due to a PowerPC buildbot breakage (df626dd). This reland limits the scope of the change to non-PowerPC platforms. I am unaware of any PowerPC use cases that would benefit from a larger kNumStackOriginDescrs constant. Original CL description: This increases the constant size of kNumStackOriginDescrs to 4M (64GB of BSS across two arrays), which ought to be enough for anybody. This is the easier alternative suggested by eugenis@ in #92826.
1 parent 1c3a3f0 commit 0e96eeb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

compiler-rt/lib/msan/msan.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,17 @@ int msan_report_count = 0;
100100

101101
// Array of stack origins.
102102
// FIXME: make it resizable.
103-
static const uptr kNumStackOriginDescrs = 1024 * 1024;
103+
// Although BSS memory doesn't cost anything until used, it is limited to 2GB
104+
// in some configurations (e.g., "relocation R_X86_64_PC32 out of range:
105+
// ... is not in [-2147483648, 2147483647]; references section '.bss'").
106+
// We use kNumStackOriginDescrs * (sizeof(char*) + sizeof(uptr)) == 64MB.
107+
#ifdef SANITIZER_PPC
108+
// soft_rss_limit test (release_origin.c) fails on PPC if kNumStackOriginDescrs
109+
// is too high
110+
static const uptr kNumStackOriginDescrs = 1 * 1024 * 1024;
111+
#else
112+
static const uptr kNumStackOriginDescrs = 4 * 1024 * 1024;
113+
#endif // SANITIZER_PPC
104114
static const char *StackOriginDescr[kNumStackOriginDescrs];
105115
static uptr StackOriginPC[kNumStackOriginDescrs];
106116
static atomic_uint32_t NumStackOriginDescrs;

0 commit comments

Comments
 (0)