[sanitizer_common] Fix GetArgsAndEnv on Linux/sparc64 #109109
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When ASan testing is enabled on SPARC as per PR #107405, the
test
FAIL
s. EitherASAN_OPTIONS=print_cmdline=true
yielded binary garbage in theCommand:
output or just an empty string.It turns out one needs to apply an offset to
__libc_stack_end
to get at the actualargc
/argv
, as described inglibc
'ssysdeps/sparc/sparc{32,64}/dl-machine.h
(DL_STACK_END
).This patch does this, fixing the test.
Tested on
sparc64-unknown-linux-gnu
.