Skip to content

[Sanitizer] Use %device_rundir/ to fix test #142274

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
May 31, 2025
Merged

Conversation

ellishg
Copy link
Contributor

@ellishg ellishg commented May 31, 2025

I attempted to fix this test in #142235 but we a new error.

https://lab.llvm.org/buildbot/#/builders/186/builds/9524/steps/26/logs/stdio

ERROR: Can't create directory: /var

The path we want is actually at /data/local/tmp/Output/var/....

I found %device_rundir/ evaluates to this prefix on android, and nothing otherwise.

config.substitutions.append(("%device_rundir/", "/data/local/tmp/Output/"))

@llvmbot
Copy link
Member

llvmbot commented May 31, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Ellis Hoag (ellishg)

Changes

I attempted to fix this test in #142235 but we a new error.

https://lab.llvm.org/buildbot/#/builders/186/builds/9524/steps/26/logs/stdio
> ERROR: Can't create directory: /var

The path we want is actually at /data/local/tmp/Output/var/....

I found %device_rundir/ evaluates to this prefix on android, and nothing otherwise.

config.substitutions.append(("%device_rundir/", "/data/local/tmp/Output/"))


Full diff: https://github.com/llvm/llvm-project/pull/142274.diff

1 Files Affected:

  • (modified) compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp (+1-1)
diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp
index 8abd476708b4c..cebe19afb1bd8 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/sanitizer_set_report_path_test.cpp
@@ -1,6 +1,6 @@
 // Test __sanitizer_set_report_path and __sanitizer_get_report_path:
 // RUN: %clangxx -O2 %s -o %t
-// RUN: %env HOME=%t.homedir TMPDIR=%t.tmpdir %run %t 2>&1 | FileCheck %s
+// RUN: %env HOME=%device_rundir/%t.homedir TMPDIR=%device_rundir/%t.tmpdir %run %t 2>&1 | FileCheck %s
 
 #include <sanitizer/common_interface_defs.h>
 #include <stdio.h>

@ellishg ellishg merged commit 79da1c4 into llvm:main May 31, 2025
12 of 13 checks passed
@ellishg ellishg deleted the fix-san-test-2 branch May 31, 2025 14:33
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