Skip to content

[safestack] Various 32-bit Linux fixes #99455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

rorth
Copy link
Collaborator

@rorth rorth commented Jul 18, 2024

When enabling 32-bit testing on Linux/i386 and Linux/sparc, many tests FAIL:

  • All Linux/i386 tests FAIL with safestack CHECK failed: /vol/llvm/src/llvm-project/local/compiler-rt/lib/safestack/safestack.cpp:95 MAP_FAILED != addr because the safestack mmap implementation doesn't work there. This patch adjusts it to match the sanitizer_linux.cpp.c one.
  • On 32-bit Linux/sparc, the pthread*.c tests FAIL because a tid_t (uint64_t) tid arg was passed to syscall(SYS_tgkill) while tid is actually a pid_t (int). Fixed by adding a cast.

Tested on x86_64-pc-linux-gnu (32 and 64-bit) and sparc64-unknown-linux-gnu (32 and 64-bit).

When enabling 32-bit testing on Linux/i386 and Linux/sparc, many tests
`FAIL`:

- All Linux/i386 tests `FAIL` with
  ```
  safestack CHECK failed: /vol/llvm/src/llvm-project/local/compiler-rt/lib/safestack/safestack.cpp:95 MAP_FAILED != addr
  ```
  because the safestack `mmap` implementation doesn't work there.  This
  patch adjusts it to match the `sanitizer_linux.cpp.c` one.
- On 32-bit Linux/sparc, the `pthread*.c` tests `FAIL` because a `tid_t`
  (`uint64_t`) `tid` arg was passed to `syscall(SYS_tgkill)` while `tid` is
  actually a `pid_t` (`int`).  Fixed by adding a cast.

Tested on `x86_64-pc-linux-gnu` (32 and 64-bit) and
`sparc64-unknown-linux-gnu` (32 and 64-bit).
@rorth rorth merged commit 82af008 into llvm:main Jul 19, 2024
9 checks passed
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
Summary:
When enabling 32-bit testing on Linux/i386 and Linux/sparc, many tests
`FAIL`:

- All Linux/i386 tests `FAIL` with ``` safestack CHECK failed:
/vol/llvm/src/llvm-project/local/compiler-rt/lib/safestack/safestack.cpp:95
MAP_FAILED != addr ``` because the safestack `mmap` implementation
doesn't work there. This patch adjusts it to match the
`sanitizer_linux.cpp.c` one.
- On 32-bit Linux/sparc, the `pthread*.c` tests `FAIL` because a `tid_t`
(`uint64_t`) `tid` arg was passed to `syscall(SYS_tgkill)` while `tid`
is actually a `pid_t` (`int`). Fixed by adding a cast.

Tested on `x86_64-pc-linux-gnu` (32 and 64-bit) and
`sparc64-unknown-linux-gnu` (32 and 64-bit).

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60251393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants