This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][ASAN] mark asan as supported for RISCV and enable tests
AbandonedPublic

Authored by EccoTheDolphin on Sep 12 2020, 7:02 AM.

Details

Reviewers
kcc
Summary

Port address sanitizer to RISCV architecture

This change allows using ASAN on RISCV architecture. The majority of existing
tests are passing. With few exceptions (see below). Tests we run on qemu and
on "HiFive Unleashed" board.

Tests run:

Asan-riscv64-inline-Test  - pass
Asan-riscv64-inline-Noinst-Test  - pass
Asan-riscv64-calls-Noinst-Test  - pass
Asan-riscv64-calls-Test  - pass

Lit tests:

RISCV64LinuxConfig (282 supported, few failures)
RISCV64LinuxDynamicConfig (289 supported, few failures)

Lit failures:

asan_and_llvm_coverage_test.cpp - missing libclang_rt.profile-riscv64.a
deep_stack_uaf.cpp - asan works, but backtrace misses some calls
malloc_context_size.cpp - asan works, but backtrace misses some calls
malloc_delete_mismatch.cpp - asan works, but backtrace misses some calls
plugin_wrong_frame_number_bug.cpp - asan works, but backtrace misses some calls
stack-trace-dlclose.cpp - asan works, but backtrace misses some calls
strndup_oob_test.cpp - asan works, but backtrace misses some calls
static_tls.cpp - "Can't guess glibc version" (under debugging)

These failures are under debugging currently and shall be addressed in a
subsequent commits

Diff Detail

Event Timeline

EccoTheDolphin created this revision.Sep 12 2020, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2020, 7:02 AM
Herald added subscribers: Restricted Project, evandro, luismarques and 13 others. · View Herald Transcript
EccoTheDolphin requested review of this revision.Sep 12 2020, 7:02 AM
EccoTheDolphin abandoned this revision.Sep 12 2020, 7:12 AM

uploaded the patch by mistake. Will try to re-upload in a proper way once I figure out how to use the arc tool properly.

Port addres sanititizers to RISCV architecture

This change allows using ASAN on RISCV architecture. The majoirity of existing
tests are passing. With few exceptions (see below). Tests we run on qemu and
on "HiFive Unleashed" board.

Tests run:

Asan-riscv64-inline-Test  - pass
Asan-riscv64-inline-Noinst-Test  - pass
Asan-riscv64-calls-Noinst-Test  - pass
Asan-riscv64-calls-Test  - pass

Lit tests:

RISCV64LinuxConfig (282 supported, few failures)
RISCV64LinuxDynamicConfig (289 supported, few failures)

Lit failures:

asan_and_llvm_coverage_test.cpp - missing libclang_rt.profile-riscv64.a
deep_stack_uaf.cpp - asan works, but backtrace misses some calls
malloc_context_size.cpp - asan works, but backtrace misses some calls
malloc_delete_mismatch.cpp - asan works, but backtrace misses some calls
plugin_wrong_frame_number_bug.cpp - asan works, but backtrace misses some calls
stack-trace-dlclose.cpp - asan works, but backtrace misses some calls
strndup_oob_test.cpp - asan works, but backtrace misses some calls
static_tls.cpp - "Can't guess glibc version" (under debugging)

These failures are under debuggng currently and shall be addressed in a
subsequent commits

Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2020, 7:36 AM

[RISCV][ASAN] implementation of internal syscalls wrappers for riscv

[1/11] of commits implementing asan port of RISCV

restore combined diff

restore combined diff

EccoTheDolphin edited the summary of this revision. (Show Details)Sep 12 2020, 8:46 AM
EccoTheDolphin edited the summary of this revision. (Show Details)

fixup some formatting issues

EccoTheDolphin abandoned this revision.Sep 12 2020, 7:17 PM

this huge change is abandoned in favor of a more digestible https://reviews.llvm.org/D87582