Skip to content

Commit

Permalink
Reduce the MSAN TlS requirements to workaround glibc limitation
Browse files Browse the repository at this point in the history
Workaround issue where older glibc cannot allocate large TLS blocks
after the program has started running ("cannot allocate memory in
static TLS block").

ref:
microsoft/LightGBM#6509
https://bugzilla.redhat.com/show_bug.cgi?id=1722181
  • Loading branch information
ccotter committed Aug 1, 2024
1 parent a5b7dfd commit 86229cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/lib/msan/msan.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ addr_is_type(uptr addr, int mapping_types) {
#define MEM_IS_ORIGIN(mem) addr_is_type((uptr)(mem), MappingDesc::ORIGIN)

// These constants must be kept in sync with the ones in MemorySanitizer.cpp.
const int kMsanParamTlsSize = 800;
const int kMsanRetvalTlsSize = 800;
const int kMsanParamTlsSize = 200;
const int kMsanRetvalTlsSize = 200;

namespace __msan {
extern int msan_inited;
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ static const Align kMinOriginAlignment = Align(4);
static const Align kShadowTLSAlignment = Align(8);

// These constants must be kept in sync with the ones in msan.h.
static const unsigned kParamTLSSize = 800;
static const unsigned kRetvalTLSSize = 800;
static const unsigned kParamTLSSize = 200;
static const unsigned kRetvalTLSSize = 200;

// Accesses sizes are powers of two: 1, 2, 4, 8.
static const size_t kNumberOfAccessSizes = 4;
Expand Down

0 comments on commit 86229cc

Please sign in to comment.