This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizer][RISCV] Fix internal_clone
ClosedPublic

Authored by luismarques on Feb 18 2021, 5:49 AM.

Details

Summary

A RISC-V implementation of internal_clone was introduced in D87573, as part of the RISC-V ASan patch set by @EccoTheDolphin. That function was never used/tested until I ported LSan for RISC-V, as part of D92403. That port revealed problems in the original implementation, so I provided a fix in D92403. Unfortunately, my choice of replacing the assembly with regular C++ code wasn't correct. The clone syscall arguments specify a separate stack, so non-inlined calls, spills, etc. aren't going to work. This wasn't a problem in practice for optimized builds of Compiler-RT, but it breaks for debug builds. This patch fixes the original problem while keeping the assembly.

Diff Detail

Event Timeline

luismarques created this revision.Feb 18 2021, 5:49 AM
luismarques requested review of this revision.Feb 18 2021, 5:49 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2021, 5:49 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
luismarques retitled this revision from [Sanitizer][RISCV] to [Sanitizer][RISCV] Fix internal_clone.Feb 18 2021, 5:49 AM
vitalybuka accepted this revision.Feb 26 2021, 4:18 PM
This revision is now accepted and ready to land.Feb 26 2021, 4:18 PM
EccoTheDolphin accepted this revision.Mar 1 2021, 3:01 AM
This revision was automatically updated to reflect the committed changes.