This is an archive of the discontinued LLVM Phabricator instance.

Cherry-pick gtest fix for asan tests.
ClosedPublic

Authored by eugenis on Nov 15 2019, 11:31 AM.

Details

Summary

https://github.com/google/googletest/commit/681454dae48f109abf68c424c9d2e6db9a092238

Clone+exec death test allocates a single page of stack to run chdir + exec on.
This is not enough when gtest is built with ASan and run on particular
hardware.

With ASan on x86_64, ExecDeathTestChildMain has frame size of 1728 bytes.

Call to chdir() in ExecDeathTestChildMain ends up in
_dl_runtime_resolve_xsavec, which attempts to save register state on the stack;
according to cpuid(0xd) XSAVE register save area size is 2568 on my machine.

This results in something like this in all death tests:

Result: died but not with expected error.
...
[  DEATH   ] AddressSanitizer:DEADLYSIGNAL
[  DEATH   ] =================================================================
[  DEATH   ] ==178637==ERROR: AddressSanitizer: stack-overflow on address ...

PiperOrigin-RevId: 278709790

Diff Detail

Event Timeline

eugenis created this revision.Nov 15 2019, 11:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2019, 11:31 AM
pcc accepted this revision.Nov 20 2019, 2:07 PM

LGTM

This revision is now accepted and ready to land.Nov 20 2019, 2:07 PM
This revision was automatically updated to reflect the committed changes.