Skip to content

Commit 57a5079

Browse files
authored
[msan] Increase kNumStackOriginDescrs constant (llvm#92838)
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 llvm#92826.
1 parent 337e633 commit 57a5079

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler-rt/lib/msan/msan.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ 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+
static const uptr kNumStackOriginDescrs = 4 * 1024 * 1024;
104108
static const char *StackOriginDescr[kNumStackOriginDescrs];
105109
static uptr StackOriginPC[kNumStackOriginDescrs];
106110
static atomic_uint32_t NumStackOriginDescrs;

0 commit comments

Comments
 (0)