Skip to content

Commit

Permalink
i#5955: Update expected rseq offset for glibc 2.35
Browse files Browse the repository at this point in the history
Glibc 2.35 made some changes to the __rseq_offset. We have logic that uses a
heuristic to search for the struct rseq offset. But we also assert on the
expected known rseq offset of glibc in the linux.rseq test; this is to
proactively detect glibc changes in rseq handling.

This fixes all rseq tests on glibc 2.35 except tool.drcacheoff.rseq which is
covered by #5734.

Fixes: #5955
  • Loading branch information
abhinav92003 committed Apr 4, 2023
1 parent 0a5938b commit 91a75de
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions suite/tests/linux/rseq.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,27 @@ register_rseq()
* fallback that does a wider search, it would be good to keep the
* expected offset in sync with glibc changes.
*/
# ifdef X86
# ifdef X64
assert(__rseq_offset == 2464);
# if __GLIBC__ == 2 && __GLIBC_MINOR__ >= 36
# ifdef X86
# ifdef X64
assert(__rseq_offset == 2336);
# else
assert(__rseq_offset == 1184);
# endif
# else
assert(__rseq_offset == 1312);
/* Did not change on glibc 2.36. */
assert(__rseq_offset == -32);
# endif
# else
# ifdef X86
# ifdef X64
assert(__rseq_offset == 2464);
# else
assert(__rseq_offset == 1312);
# endif
# else
assert(__rseq_offset == -32);
# endif
# endif
/* Already registered by glibc. Verify that it's there. */
struct rseq *reg_rseq = __builtin_thread_pointer() + __rseq_offset;
Expand Down

0 comments on commit 91a75de

Please sign in to comment.