Skip to content
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

tools/llvm-exegesis/X86/latency tests fail with glibc 2.40 #100791

Closed
mgorny opened this issue Jul 26, 2024 · 4 comments · Fixed by #100804
Closed

tools/llvm-exegesis/X86/latency tests fail with glibc 2.40 #100791

mgorny opened this issue Jul 26, 2024 · 4 comments · Fixed by #100804

Comments

@mgorny
Copy link
Member

mgorny commented Jul 26, 2024

After upgrading the system to glibc 2.40, the following tests started failing:

Failed Tests (8):
  LLVM :: tools/llvm-exegesis/X86/latency/memory-annotations-livein.s
  LLVM :: tools/llvm-exegesis/X86/latency/memory-annotations.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-abnormal-exit-code.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-address-annotation.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-rsp.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-segfault.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess.s

FWICS, in all instances the failure has the same cause:

RUN: at line 3: /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=/var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s -execution-mode=subprocess | /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/FileCheck /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
+ /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/FileCheck /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
+ /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=/var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s -execution-mode=subprocess
llvm-exegesis error: Child benchmarking process exited with non-zero exit code: Disabling restartable sequences failed
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/FileCheck /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
@llvmbot
Copy link
Member

llvmbot commented Jul 26, 2024

@llvm/issue-subscribers-tools-llvm-exegesis

Author: Michał Górny (mgorny)

After upgrading the system to glibc 2.40, the following tests started failing:
Failed Tests (8):
  LLVM :: tools/llvm-exegesis/X86/latency/memory-annotations-livein.s
  LLVM :: tools/llvm-exegesis/X86/latency/memory-annotations.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-abnormal-exit-code.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-address-annotation.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-rsp.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess-segfault.s
  LLVM :: tools/llvm-exegesis/X86/latency/subprocess.s

FWICS, in all instances the failure has the same cause:

RUN: at line 3: /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=/var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s -execution-mode=subprocess | /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/FileCheck /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
+ /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/FileCheck /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s
+ /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=/var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s -execution-mode=subprocess
llvm-exegesis error: Child benchmarking process exited with non-zero exit code: Disabling restartable sequences failed
FileCheck error: '&lt;stdin&gt;' is empty.
FileCheck command line:  /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm_build-abi_x86_64.amd64/bin/FileCheck /var/tmp/portage/sys-devel/llvm-19.1.0_rc1/work/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-preserved-registers.s

@boomanaiden154
Copy link
Contributor

Do you know if this fails with glibc 2.39?

__rseq_size now denotes the size of the active rseq area (20 bytes initially), not the size of struct rseq (32 bytes initially).

This section from the glibc v2.40 release notes looks suspicous.

@mgorny
Copy link
Member Author

mgorny commented Jul 26, 2024

Do you know if this fails with glibc 2.39?

I'm reasonably convinced it doesn't. The previous version I've tested (prior to glibc upgrade) was 72d8c27, and it didn't have any issues. I can retest that commit later, if you wish, but I want to finish with rc1 first, as otherwise I'll probably lose ccache :-).

@boomanaiden154
Copy link
Contributor

It's definitely that 2.40 glibc change causing the breakage. The kernel checks that the size in the unregister call matches the size of the currently registered rseq struct https://github.com/torvalds/linux/blob/2f8c4f5062855a83c1f2dbc012c4fa274ce999d4/kernel/rseq.c#L376

The patch that adjusted this was https://patchwork.sourceware.org/project/glibc/patch/[email protected]/#177251.

Looks like I need to figure out if glibc still publicly exposes the actual size of the struct.

boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this issue Jul 26, 2024
Glibc v2.40 changes the definition of __rseq_size to the usable area of
the struct rather than the actual size of the struct to accommodate
users trying to figure out what features can be used. This change breaks
llvm-exegesis trying to disable rseq as the size registered in the
kernel is no longer equal to __rseq_size. This patch adds a check to see
if __rseq_size is less than 32 bytes and uses 32 as a value if it is
given alignment requirements.

Fixes llvm#100791.
boomanaiden154 added a commit to boomanaiden154/llvm-project that referenced this issue Jul 26, 2024
Glibc v2.40 changes the definition of __rseq_size to the usable area of
the struct rather than the actual size of the struct to accommodate
users trying to figure out what features can be used. This change breaks
llvm-exegesis trying to disable rseq as the size registered in the
kernel is no longer equal to __rseq_size. This patch adds a check to see
if __rseq_size is less than 32 bytes and uses 32 as a value if it is
given alignment requirements.

Fixes llvm#100791.
@github-project-automation github-project-automation bot moved this from Needs Triage to Done in LLVM Release Status Jul 27, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Jul 27, 2024
Glibc v2.40 changes the definition of __rseq_size to the usable area of
the struct rather than the actual size of the struct to accommodate
users trying to figure out what features can be used. This change breaks
llvm-exegesis trying to disable rseq as the size registered in the
kernel is no longer equal to __rseq_size. This patch adds a check to see
if __rseq_size is less than 32 bytes and uses 32 as a value if it is
given alignment requirements.

Fixes llvm#100791.

(cherry picked from commit 1e8df9e)
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Jul 27, 2024
Glibc v2.40 changes the definition of __rseq_size to the usable area of
the struct rather than the actual size of the struct to accommodate
users trying to figure out what features can be used. This change breaks
llvm-exegesis trying to disable rseq as the size registered in the
kernel is no longer equal to __rseq_size. This patch adds a check to see
if __rseq_size is less than 32 bytes and uses 32 as a value if it is
given alignment requirements.

Fixes llvm#100791.

(cherry picked from commit 1e8df9e)
tru pushed a commit to llvmbot/llvm-project that referenced this issue Jul 29, 2024
Glibc v2.40 changes the definition of __rseq_size to the usable area of
the struct rather than the actual size of the struct to accommodate
users trying to figure out what features can be used. This change breaks
llvm-exegesis trying to disable rseq as the size registered in the
kernel is no longer equal to __rseq_size. This patch adds a check to see
if __rseq_size is less than 32 bytes and uses 32 as a value if it is
given alignment requirements.

Fixes llvm#100791.

(cherry picked from commit 1e8df9e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants