Skip to content

Commit

Permalink
Make the tramp guard bigger to avoid a glibc bug.
Browse files Browse the repository at this point in the history
Having just one byte of TLS induces glibc bug 14898 with the definition
of FORCED_DYNAMIC_TLS_OFFSET.  Bumping to two bytes avoids this.

Fixes #101
  • Loading branch information
cuviper committed Jun 18, 2016
1 parent 73cd001 commit d1b4334
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dyninstAPI_RT/src/RTcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ int fakeTickCount;
#define TLS_VAR __thread __attribute__ ((tls_model("initial-exec")))
#endif

static TLS_VAR char DYNINST_tls_tramp_guard = 1;
// It's tempting to make this a char, but glibc < 2.17 hits a bug:
// https://sourceware.org/bugzilla/show_bug.cgi?id=14898
static TLS_VAR short DYNINST_tls_tramp_guard = 1;

DLLEXPORT int DYNINST_lock_tramp_guard()
{
Expand Down

0 comments on commit d1b4334

Please sign in to comment.