Skip to content

Conversation

@ndrewh
Copy link

@ndrewh ndrewh commented Nov 21, 2025

[sanitizer_common] posix_spawn test should forward DYLD_LIBRARY_PATH (llvm#168795)
[lit] Add LIT_CURRENT_TESTCASE environment variable when running tests (llvm#168762)
[compiler-rt] [libFuzzer] Fix merge-posix test (again) (llvm#168639)
[compiler-rt] [libFuzzer] Fix merge-posix.test file size test (llvm#168137)

…68137)

This test uses `ulimit -f 1` to test what libFuzzer does when trying to
create a file > **_1KB_**. However, the none of the input files used by
this test are actually >= 1KB, so there's no reason to expect this test
to pass.

This test appears to be passing on accident since the "control file"
happens to be > 1KB, but this is not always the case depending upon the
length of the path where the test is run from.

This modifies the test to ensure that one of the input file is actually
>1KB.

(cherry picked from commit c4be17a)
llvm#168762)

I'm not aware of any way for `%run` wrapper scripts like
`iosssim_run.py`
([ref](https://github.com/llvm/llvm-project/blob/d2c7c6064259320def7a74e111079725958697d4/compiler-rt/test/sanitizer_common/ios_commands/iossim_run.py#L4))
to know what testcase they are currently running. This can be useful if
these wrappers need to create a (potentially remote) temporary directory
for each test case.

This adds the `LIT_CURRENT_TESTCASE` environment variable to both the
internal shell and the external shell, containing the full name of the
current test being run.

(cherry picked from commit 3f6cbde)
…lvm#168795)

This test explicitly sets the environment for a spawned process. Without
DYLD_LIBRARY_PATH, the spawned process may use a ASAN runtime other than
the one that was used by the parent process That other runtime library
may not work at all, or may not be in the default search path. Either
case can cause the spawned process to die before it makes it to main,
thus failing the test. The compiler-rt lit config sets the library path
variable
[here](https://github.com/llvm/llvm-project/blob/main/compiler-rt/test/lit.common.cfg.py#L84)
(i.e. to ensure that just-built runtimes are used for tests, in the case
of a standalone compiler-rt build), and that is currently used by the
parent process but not the spawned ones.

My change only forwards the variable for Darwin (DYLD_LIBRARY_PATH), but
we **_ought_** to also forward the variable for other platforms.
However, it's not clear that there's any good way to plumb this into the
test, since some platforms actually have multiple library path variables
which would need to be forwarded (see: SunOS
[here](https://github.com/llvm/llvm-project/blob/main/compiler-rt/test/lit.common.cfg.py#L102)).
I considered adding a substitution variable for the library path
variable, but that doesn't really work if there's multiple such
variables.

(cherry picked from commit b5c0fcd)
@ndrewh ndrewh requested a review from DanBlackwell November 21, 2025 06:40
@ndrewh ndrewh requested a review from a team as a code owner November 21, 2025 06:40
@ndrewh
Copy link
Author

ndrewh commented Nov 21, 2025

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant