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

[llvm-lit][compiler-rt] Test using 'export' failing to execute with lit internal shell due to too many arguments #106142

Closed
connieyzhu opened this issue Aug 26, 2024 · 0 comments · Fixed by #106143

Comments

@connieyzhu
Copy link
Contributor

The following RUN line in compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c fails when run with lit's internal shell because export is given two arguments instead of only one.
RUN: export %env_asan_opts=print_scariness=1

%env_asan_opts expands to env ASAN_OPTIONS, which is why the test is failing to execute.

This is the error message given when running compiler-rt tests with LIT_USE_INTERNAL_SHELL=1.

FAIL: AddressSanitizer-x86_64-linux-dynamic :: TestCases/Posix/high-address-dereference.c (1 of 2)
******************** TEST 'AddressSanitizer-x86_64-linux-dynamic :: TestCases/Posix/high-address-dereference.c' FAILED ********************
Exit Code: 127

Command Output (stdout):
--
# RUN: at line 7
/usr/local/google/home/connieyzhu/llvm-fork/build/./bin/clang  -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only   -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta   -shared-libasan /usr/local/google/home/connieyzhu/llvm-fork/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c -o /usr/local/google/home/connieyzhu/llvm-fork/build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Posix/Output/high-address-dereference.c.tmp
# executed command: /usr/local/google/home/connieyzhu/llvm-fork/build/./bin/clang -fsanitize=address -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -fno-optimize-sibling-calls -gline-tables-only -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -shared-libasan /usr/local/google/home/connieyzhu/llvm-fork/compiler-rt/test/asan/TestCases/Posix/high-address-dereference.c -o /usr/local/google/home/connieyzhu/llvm-fork/build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/test/asan/X86_64LinuxDynamicConfig/TestCases/Posix/Output/high-address-dereference.c.tmp
# RUN: at line 8
export env ASAN_OPTIONS=print_scariness=1
# executed command: export env ASAN_OPTIONS=print_scariness=1
# .---command stderr------------
# | 'export' supports only one argument
# `-----------------------------
# error: command failed with exit status: 127
@connieyzhu connieyzhu changed the title [compiler-rt] Test using 'export' failing to execute with lit internal shell due to too many arguments [llvm-lit][compiler-rt] Test using 'export' failing to execute with lit internal shell due to too many arguments Aug 27, 2024
5c4lar pushed a commit to 5c4lar/llvm-project that referenced this issue Aug 29, 2024
…nts (llvm#106143)

This patch fixes the incorrect usage of lit's built-in export command in
this compiler-rt test. The export command only allows for one argument,
but %env_asan_opts expands to "env ASAN_OPTIONS", which gives export two
arguments instead of only one. Instead of using export, which propogates
the environment variable value to all subsequent commands, the
environment variable is manually set before all RUN lines following the
original export line.

This patch depends on llvm#105961.

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

Successfully merging a pull request may close this issue.

6 participants
@EugeneZelenko @connieyzhu and others