Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2566)

Issue 6432065: ASan Initialization Order Checking - LLVM half

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 4 months ago by reidw
Modified:
12 years, 3 months ago
Reviewers:
kcc1, glider1, samsonov
Base URL:
http://llvm.org/svn/llvm-project/llvm/trunk/
Visibility:
Public.

Description

Initialization order checking for ASan - LLVM half.

Patch Set 1 #

Total comments: 9

Patch Set 2 : Second version #

Patch Set 3 : Third Version (uploaded wrong patch) #

Total comments: 2

Patch Set 4 : Minor changes #

Total comments: 10

Patch Set 5 : More changes #

Total comments: 2

Patch Set 6 : Even More changes #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+249 lines, -62 lines) Patch
lib/Transforms/Instrumentation/AddressSanitizer.cpp View 1 2 3 4 5 12 chunks +178 lines, -62 lines 8 comments Download
test/Instrumentation/AddressSanitizer/instrument_initializer.ll View 1 2 3 4 5 1 chunk +35 lines, -0 lines 0 comments Download
test/Instrumentation/AddressSanitizer/instrument_initializer_metadata.ll View 1 2 3 4 5 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 15
reidw
12 years, 4 months ago (2012-07-23 21:13:34 UTC) #1
samsonov
http://codereview.appspot.com/6432065/diff/1/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/1/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode383 lib/Transforms/Instrumentation/AddressSanitizer.cpp:383: UE != UI; ++UI) { one more leading space ...
12 years, 4 months ago (2012-07-24 06:47:27 UTC) #2
kcc1
http://codereview.appspot.com/6432065/diff/1/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/1/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode381 lib/Transforms/Instrumentation/AddressSanitizer.cpp:381: static bool HasDynamicInitializer(GlobalVariable *G) { Before we enable this ...
12 years, 4 months ago (2012-07-24 08:11:49 UTC) #3
reidw
Second version
12 years, 4 months ago (2012-07-26 23:43:25 UTC) #4
reidw
See message on the compiler-rt review Much appreciated, Reid http://codereview.appspot.com/6432065/diff/1/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/1/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode381 lib/Transforms/Instrumentation/AddressSanitizer.cpp:381: ...
12 years, 4 months ago (2012-07-26 23:51:49 UTC) #5
kcc1
http://codereview.appspot.com/6432065/diff/10001/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/10001/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode387 lib/Transforms/Instrumentation/AddressSanitizer.cpp:387: for (int i = 0, n = DynamicGlobals->getNumOperands(); Instead ...
12 years, 4 months ago (2012-07-27 08:31:53 UTC) #6
reidw
Minor changes
12 years, 3 months ago (2012-07-31 01:32:37 UTC) #7
samsonov
Thanks! I'll try to take a careful look at these patches tomorrow. On Tue, Jul ...
12 years, 3 months ago (2012-07-31 15:09:45 UTC) #8
samsonov
http://codereview.appspot.com/6432065/diff/14001/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/14001/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode386 lib/Transforms/Instrumentation/AddressSanitizer.cpp:386: = M.getNamedMetadata("dynamically_initialized_globals"); Nit: please move "=" to the previous ...
12 years, 3 months ago (2012-08-01 16:27:10 UTC) #9
reidw
See comments on compilerrt review. http://codereview.appspot.com/6432065/diff/14001/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/14001/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode386 lib/Transforms/Instrumentation/AddressSanitizer.cpp:386: = M.getNamedMetadata("dynamically_initialized_globals"); On 2012/08/01 ...
12 years, 3 months ago (2012-08-01 19:28:31 UTC) #10
reidw
More Changes
12 years, 3 months ago (2012-08-02 17:44:17 UTC) #11
samsonov
This also looks fine. http://codereview.appspot.com/6432065/diff/16002/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/16002/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode421 lib/Transforms/Instrumentation/AddressSanitizer.cpp:421: // in a different TU. ...
12 years, 3 months ago (2012-08-03 08:09:47 UTC) #12
kcc1
Looks good, please commit. http://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): http://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode383 lib/Transforms/Instrumentation/AddressSanitizer.cpp:383: assert(G); use cast<> and remove ...
12 years, 3 months ago (2012-08-16 07:35:22 UTC) #13
glider1
Several style nits. https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp File lib/Transforms/Instrumentation/AddressSanitizer.cpp (right): https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode370 lib/Transforms/Instrumentation/AddressSanitizer.cpp:370: M.getNamedMetadata("dynamically_initialized_globals"); I think it's more common ...
12 years, 3 months ago (2012-08-16 08:57:28 UTC) #14
kcc1
12 years, 3 months ago (2012-08-16 09:07:00 UTC) #15
On Thu, Aug 16, 2012 at 12:57 PM, <glider@chromium.org> wrote:

> Several style nits.
>
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp>
> File lib/Transforms/**Instrumentation/**AddressSanitizer.cpp (right):
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode370<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode370>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:370:
> M.getNamedMetadata("**dynamically_initialized_**globals");
> I think it's more common to use 4-space indentation when breaking a line
> this way.
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode387<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode387>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:387: // Returns
> true
> if a global variable is initialized dynamically in this TU.
> Please insert a newline before the function declaration. Consider also
> running `make -f Makefile.old lint` in the ASan runtime directory.
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode508<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode508>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:508:
> Please remove the spare newlines
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode600<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode600>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:600:
> Spare newlines.
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode609<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode609>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:609: E =
> M.global_end(); G != E; ++G) {
> "E =" should be right below "Module"
>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode636<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode636>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:636: Value
> *FirstDynamic = 0, *LastDynamic = 0;
> It's better to use NULL for pointers.
>

I remember Chandler asking to use 0 instead of NULL.
For me 0 is fine.


>
> https://codereview.appspot.**com/6432065/diff/13004/lib/**
>
Transforms/Instrumentation/**AddressSanitizer.cpp#**newcode688<https://codereview.appspot.com/6432065/diff/13004/lib/Transforms/Instrumentation/AddressSanitizer.cpp#newcode688>
> lib/Transforms/**Instrumentation/**AddressSanitizer.cpp:688: if (
> FirstDynamic == 0 )
> Inconsistent spacing around the expression.
> Also, why not just (!FirstDynamic) ?
>
>
https://codereview.appspot.**com/6432065/<https://codereview.appspot.com/6432...
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b