Page MenuHomePhabricator

phase 01: add new command line flag to enable UAR in 3 modes (always, [runtime], never).
AbandonedPublic

Authored by kda on Mar 30 2021, 6:20 PM.

Details

Reviewers
vitalybuka
Group Reviewers
Restricted Project

Diff Detail

Unit TestsFailed

TimeTest
90 msx64 debian > LLVM.DebugInfo/Generic::block-asan.ll
Script: -- : 'RUN: at line 1'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt -S -asan -enable-new-pm=0 /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/Generic/block-asan.ll | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/DebugInfo/Generic/block-asan.ll
50 msx64 debian > LLVM.Instrumentation/AddressSanitizer::alloca-offset-lifetime.ll
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/alloca-offset-lifetime.ll --asan --asan-use-after-scope -S -enable-new-pm=0 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/alloca-offset-lifetime.ll
50 msx64 debian > LLVM.Instrumentation/AddressSanitizer::basic.ll
Script: -- : 'RUN: at line 3'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/basic.ll -asan -asan-module -S -enable-new-pm=0 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck --check-prefixes=CHECK,CHECK-S3 /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/basic.ll
60 msx64 debian > LLVM.Instrumentation/AddressSanitizer::debug-info-alloca.ll
Script: -- : 'RUN: at line 6'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/debug-info-alloca.ll -asan -asan-module -enable-new-pm=0 -S | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/debug-info-alloca.ll
70 msx64 debian > LLVM.Instrumentation/AddressSanitizer::debug_info_noninstrumented_alloca.ll
Script: -- : 'RUN: at line 5'; /mnt/disks/ssd0/agent/llvm-project/build/bin/opt < /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll -asan -asan-module -enable-new-pm=0 -S | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/llvm/test/Instrumentation/AddressSanitizer/debug_info_noninstrumented_alloca.ll
View Full Test Results (29 Failed)

Event Timeline

kda created this revision.Mar 30 2021, 6:20 PM
kda requested review of this revision.Mar 30 2021, 6:20 PM
Herald added projects: Restricted Project, Restricted Project, Restricted Project. · View Herald TranscriptMar 30 2021, 6:20 PM
Herald added subscribers: llvm-commits, Restricted Project, cfe-commits. · View Herald Transcript
kda updated this revision to Diff 335362.Apr 5 2021, 5:59 PM

I think this patch is near completion.
But the new code generated for the 'Always' case is definitely wrong.
I could use some coaching. I will eventually figure it out, but an interactive session would probably help me along.

kda added a reviewer: Restricted Project.Apr 5 2021, 6:01 PM
kda updated this revision to Diff 335558.Apr 6 2021, 9:44 AM

fixed tests for asan_interface.inc.

vitalybuka added a subscriber: vitalybuka.

Smaller incremental patches are highly encouraged. But I assume it's WIP.
In the first I'd recommend to try to land clang pieces and leave llvm and compiler-rt parts unchanged.

And I can with interactive session next week.

kda abandoned this revision.Apr 19 2021, 1:43 PM

will attempt in smaller pieces.

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
3304

I think this is where things start going wrong, but after a few hours looking, I'm not sure what the code should look like.
I know I don't want a branch, but I don't know how to just stick the call in to the stack allocator.
I think once that is right, then the pieces after it follow in a straightforwad manner.