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

[SPARC] Asan test failure in TestCases/alloca_vla_interact.cpp #110956

Open
koachan opened this issue Oct 3, 2024 · 1 comment
Open

[SPARC] Asan test failure in TestCases/alloca_vla_interact.cpp #110956

koachan opened this issue Oct 3, 2024 · 1 comment
Assignees
Labels

Comments

@koachan
Copy link
Contributor

koachan commented Oct 3, 2024

Consolidating all the relevant stuff from the discussion at PR #107223 for easier tracking.
After that PR is applied, there's one asan test that still fails:

AddressSanitizer-sparc-sunos :: TestCases/alloca_vla_interact.cpp
AddressSanitizer-sparc-sunos-dynamic :: TestCases/alloca_vla_interact.cpp

Assertion failed: q == top, file /vol/llvm/src/llvm-project/local/compiler-rt/test/asan/TestCases/alloca_vla_interact.cpp, line 45

Per @rorth, the test case fails on GCC too, on 32-bit SPARC.

This is what the test does, according to @chefmax7:

Hi, sorry for the late response, I took some time for me to restore my GH account...

I don't remember all the details, but from what I remember, when implementing VLA/alloca poisoning, LLVM showed different behavior for allocation slots management between VLAs/allocas into loop nest:

* for **VLA**, I saw its stack slot being reused between loop iterations (i.e. each VLA's alloca was preceded by `@llvm.stacksave.p0()` all and followed by corresponding `@llvm.stackrestore.p0(...)`.

* for **alloca** I saw LLVM allocating a new stack slot on each loop iteration (no reuse).

So the test case was indented to check that ASAN can handle poisoning/unpoisoning correctly in presence of both VLAs/allocas into same loop nest.

However, looking on freshly generated LLVM IR, it seems this difference is not the case anymore, maybe it was a bug in LLVM back then... That said, I think this test case doesn't have value anymore (and maybe it's even invalid now).

I'm sorry that I can't provide more technical details now, this patch is pretty old...

Personally I feel odd that the test fails on GCC too, but I wonder if there's something that can be done here...

@koachan koachan self-assigned this Oct 3, 2024
@koachan
Copy link
Contributor Author

koachan commented Oct 3, 2024

Forgot to add, but apparently it fails on i386 too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant