This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][MallocChecker][NFC] Document and reorganize some functions
ClosedPublic

Authored by Szelethus on Nov 21 2018, 6:02 PM.

Details

Summary

I'm in the process of splitting this checker into multiple other ones, and while I was there, I provided documentation to most functions, and made some static, and in some cases moved them out of class.

This patch merely reorganizes some things, and features no functional change.

In detail:

  • Provided documentation, or moved existing documentation in more obvious places.
  • Added dividers. (the //===----------===// thing).
  • Moved getAllocationFamily, printAllocDeallocName, printExpectedAllocName and printExpectedDeallocName in the global namespace on top of the file where AllocationFamily is declared, as they are very strongly related.
  • Moved isReleased and MallocUpdateRefState near RefState's definition for the same reason.
  • Realloc modeling was very poor in terms of variable and structure naming, as well as documentation, so I renamed some of them and added much needed docs.
  • Moved function IdentifierInfos to a separate struct, and moved isMemFunction, isCMemFunction adn isStandardNewDelete inside it. This makes the patch affect quite a lot of lines, should I extract it to a separate one?
  • Moved MallocBugVisitor out of MallocChecker.
  • Preferred switches to long else-if branches in some places.
  • Neatly organized some RUN: lines.

Diff Detail

Repository
rL LLVM

Event Timeline

Szelethus created this revision.Nov 21 2018, 6:02 PM
Szelethus added a comment.EditedNov 21 2018, 6:10 PM

I also have some cool ideas how the split up should go, but I'd like to mature the idea in my head for just a bit longer.

lib/StaticAnalyzer/Checkers/MallocChecker.cpp
24–27 ↗(On Diff #175006)
242–245 ↗(On Diff #175006)
435–443 ↗(On Diff #175006)
1359–1363 ↗(On Diff #175006)
Szelethus edited the summary of this revision. (Show Details)Nov 21 2018, 6:15 PM
MTC added a subscriber: MTC.Nov 21 2018, 6:24 PM
MTC added a comment.Nov 22 2018, 8:35 AM

Thank you for doing the cleaning that no one else is interested in! Comments is inline below.

lib/StaticAnalyzer/Checkers/MallocChecker.cpp
342 ↗(On Diff #175006)

I can't say that abstracting MemFunctionInfo is a perfect solution, for example IsOptimistic and ShouldIncludeOwnershipAnnotatedFunctions are close to each other in the object layout, but they do the same thing, which makes me feel weird. And there are so many MemFunctionInfo. :)

422 ↗(On Diff #175006)

CE typo?

428 ↗(On Diff #175006)

Personally, ProcessZeroAllocation is like half the story, maybe ProcessZeroAllocCheck or ProcessZeroAllocationCheck is better.

448 ↗(On Diff #175006)

Maybe program state or just ProgramState is better?
Same as 462, 476, 507, 575, 593.

592 ↗(On Diff #175006)

before realloction typo?

1087 ↗(On Diff #175006)

If I not wrong, MemFunctionInfo is mainly a class member of MallocChecker that hold a bunch of memory function identifiers and provide corresponding helper APIs. And we should pick a proper time to initialize it.

I want to known why you call initIdentifierInfo() in checkPostStmt(const CallExpr *E,), this callback is called after checkPreCall(const CallEvent &Call, ) in which we need MemFunctionInfo.

1247 ↗(On Diff #175006)

const qualifier missing?

1323 ↗(On Diff #175006)

I'm not sure hasNonTrivialConstructorCall() is a good name although you explained it in details in the comments below. And the comments for this function is difficult for me to understand, which is maybe my problem.

And I also think this function doesn't do as much as described in the comments, it is just true if the invoked constructor in \p NE has a parameter - pointer or reference to a record, right?

2407 ↗(On Diff #175006)

The parameter name ShouldFreeOnFail is not consistent with the declaration, see line 577.

And thank you for helping me along the way! :D

lib/StaticAnalyzer/Checkers/MallocChecker.cpp
342 ↗(On Diff #175006)

Well the thinking here was that MallocChecker is seriously overcrowded -- it's a one-tool-to-solve-everything class, and moving these IdentifierInfos in their separate class was pretty much the first step I took: I think it encapsulates a particular task well and eases a lot on MallocChecker. Sure MemFunctionInfo. is reduntant, but each time you see it, it indicates that we're calling a function or using a data member that has no effect on the actual analysis, that we're inquiring about more information about a given function. and nothing more. For a checker that emits warning at seemingly random places wherever, I think this is valuable.

By the way, it also forces almost all similar conditions in a separate line, which is an unexpected, but pleasant help to the untrained eye:

if (Fun == MemFunctionInfo.II_malloc ||
    Fun == MemFunctionInfo.II_whatever)

Nevertheless, this is the only change I'm not 100% confident about, if you and/or others disagree, I'll happily revert it.

342 ↗(On Diff #175006)

(leaving a separate inline for a separate topic)
The was this checker abuses checker options isn't nice at all, I agree. I could just rename MallocChecker::IsOptimistic to MallocChecker::ShouldIncludeOwnershipAnnotatedFunctions, and have it passed around as a parameter in MemFunctionInfoTy. Would you prefer that, should you be okay with MemFunctionInfoTy in general?

1087 ↗(On Diff #175006)

Well, I'd like to know too! I think lazy initializing this struct creates more problems that it solves, but I wanted to draw a line somewhere in terms of how invasive I'd like to make this patch.

1247 ↗(On Diff #175006)

This method was made static.

1323 ↗(On Diff #175006)

I admit that I copy-pasted this from the source I provided below, and I overlooked it before posting it here. I very much prefer what you proposed :)

Szelethus added inline comments.Nov 22 2018, 10:27 AM
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
342 ↗(On Diff #175006)

The way* this checker abuses

MTC added inline comments.Nov 24 2018, 7:34 AM
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
342 ↗(On Diff #175006)

Easier said than done :). I have no objection to this change, but I think merge IsOptimistic and ShouldIncludeOwnershipAnnotatedFunctions together is a good idea. This option seems from gabor, he may have new ideas.

1087 ↗(On Diff #175006)

How about put the initialization stuff into constructor? Let the constructor do the initialization that it should do, let register*() do its registration, like setting setOptimism and so on.

1247 ↗(On Diff #175006)

You are right, sorry for my oversight!

1323 ↗(On Diff #175006)

The comments you provided is from the summary of the patch D4025, ayartsev has not updated the summary information in time to adapt to his patch, so I think it is appropriate to extract the summary information when he submitted this patch, see [[ https://github.com/llvm-mirror/clang/commit/2e61d2893934f7b91ca9e2f889a4e4cc9939b05c#diff-ff9160d4628cb9b6186559837c2c8668 | [Analyzer] fix for PR19102 ]]. What do you think?

Szelethus marked 3 inline comments as done.Nov 24 2018, 8:10 AM
Szelethus added inline comments.
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
1087 ↗(On Diff #175006)

Interestingly, MemFunctionInfo is not always initialized, so a performance argument can be made here. I specifically checked whether there's any point in doing this hackery, and the answer is... well, some. I'll probably touch on these in a followup patch.

1247 ↗(On Diff #175006)

Actually, I forgot about it 10 times when I re-read the patch, no shame in that :)

1323 ↗(On Diff #175006)

Wow, nice detective work there :D Sounds good to me.

NoQ accepted this revision.Nov 30 2018, 5:00 PM

Yay. Wow. Cool. Thanks.

I heard that previously there was an explicit desire to avoid doxygen comments in checkers because they're quite useless because the checker is usually all in one file and doesn't have any clients that are interested in calling its methods directly.

But now that our checkers are split into files and start interacting with each other, this argument no longer holds.

So, well, thanks a lot.

lib/StaticAnalyzer/Checkers/MallocChecker.cpp
16 ↗(On Diff #175006)

it's its

23 ↗(On Diff #175006)

it's its

283–300 ↗(On Diff #175006)

Not now of course, but see also D45458. It'd be great to have call descriptions here, so that it looked like

CallDescription alloca("alloca"),
                win_alloca("win_alloca"),
                malloc("malloc"),
                // ...

..and no initialization necessary later.

(we can even wrap them into a macro so that we didn't have to write names twice).

422 ↗(On Diff #175006)

Looks fine. It's the name of the parameter in the doxygen syntax.

592 ↗(On Diff #175006)

Seems fine.

1087 ↗(On Diff #175006)

Lazy initialization of identifiers is kinda perceived as a fairly worthless optimization. Hence CallDescription.

Also it cannot be done during registration because the AST is not constructed yet at this point. Well, probably it can be done anyway because the empty identifier table is already there in the ASTContext and we can always eagerly add a few items into it, but it still sounds scary.

This revision is now accepted and ready to land.Nov 30 2018, 5:00 PM
Szelethus updated this revision to Diff 177002.Dec 6 2018, 9:58 AM
Szelethus marked 32 inline comments as done.
Szelethus added a reviewer: MTC.

Addressing inline comments.

Szelethus added inline comments.Dec 6 2018, 10:06 AM
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
1087 ↗(On Diff #175006)

I would personally prefer to risk initializing these during registration, but if we're this many comments into this discussion, then I believe it deserves a separate patch.

I'll leave a TODO: in the code.

1323 ↗(On Diff #175006)

Umm, yea, I really couldn't come up with a better name. Hopefully the comments both here and at the call site help on this.

Szelethus marked an inline comment as done.Dec 6 2018, 10:09 AM
Szelethus added inline comments.
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
1087 ↗(On Diff #175006)

Or just go with CallDescription.

Szelethus updated this revision to Diff 177057.Dec 6 2018, 2:52 PM

Woops, forgot to fix the doc of deallocation functions.

This revision was automatically updated to reflect the committed changes.
Szelethus reopened this revision.Dec 17 2018, 4:31 AM

Reverted in rC349344.

This revision is now accepted and ready to land.Dec 17 2018, 4:31 AM

Lit test failures are gone for Windows after reverting this. Will probably deal with this revision after 8.0.0.

MTC resigned from this revision.Jan 27 2019, 1:05 AM
Szelethus marked an inline comment as done.Sep 19 2019, 7:50 AM
Szelethus added inline comments.
cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
3105

Praise clangd! This is why the buildbots broke :) checkIfNewOrNewArrayFamily doesn't return false in all cases.

Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2019, 7:50 AM
Herald added a subscriber: Charusso. · View Herald Transcript
Szelethus updated this revision to Diff 220873.Sep 19 2019, 8:35 AM

Rebase, fix (suspected) error that caused buildbot errors. Hold off commiting in favor checking whether putting CallDescriptionMap in would be too invasive, but really, can't be worse then it already is.

Szelethus set the repository for this revision to rG LLVM Github Monorepo.Sep 19 2019, 8:36 AM
Szelethus edited projects, added Restricted Project; removed Restricted Project.

Rebase, fix (suspected) error that caused buildbot errors. Hold off commiting in favor checking whether putting CallDescriptionMap in would be too invasive, but really, can't be worse then it already is.

Nope. It implies far too heavy changes. I'll land this as is, but will wait a bit as its been a while since the acceptance.

NoQ added a comment.Sep 19 2019, 1:14 PM

Is it just me or phabricator somehow refuses to display the changes since the last diff here? That's probably the commit diff is involved somehow. So i'm confused what exactly has changed >.<

Szelethus marked an inline comment as done.Sep 19 2019, 1:28 PM
In D54823#1675604, @NoQ wrote:

Is it just me or phabricator somehow refuses to display the changes since the last diff here? That's probably the commit diff is involved somehow. So i'm confused what exactly has changed >.<

File name change, I'm using the monorepo now.

clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
3137 ↗(On Diff #220873)

This was the change.

Szelethus added a comment.EditedSep 19 2019, 1:52 PM

In retrospect, I would have made this patch a little more fragmented (its almost a year old, does it beat the revival of the symbolreaper patch?), but it would be a painful chore to separate at this point, if you dont mind. I have a couple more cooking in the cauldron that are more digestible, so, lesson learned :)

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 20 2019, 11:01 AM
Szelethus added a comment.EditedSep 20 2019, 12:47 PM

Welp, windows builtbots broke again. I'll try to see whats wrong with undef sanitizer, but fear this will end up in a revert.

http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/19769/steps/test-check-all/logs/stdio

******************** TEST 'Clang :: Analysis/MismatchedDeallocator-path-notes.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=text -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp
: 'RUN: at line 2';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp -o C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\tools\clang\test\Analysis\Output\MismatchedDeallocator-path-notes.cpp.tmp.plist
: 'RUN: at line 3';   tail -n +11 C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\tools\clang\test\Analysis\Output\MismatchedDeallocator-path-notes.cpp.tmp.plist | grep -Ev '^[[:space:]]*<string>.* version .*</string>[[:space:]]*$|^[[:space:]]*<string>/.*</string>[[:space:]]*$|^[[:space:]]*<string>.:.*</string>[[:space:]]*$' | diff -ub C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis/copypaste/Inputs/expected-plists/MismatchedDeallocator-path-notes.cpp.plist -
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe" "-cc1" "-internal-isystem" "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,unix.MismatchedDeallocator" "-analyzer-output=text" "-verify" "C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp"
# command stderr:
error: 'warning' diagnostics expected but not seen: 

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 13: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'

error: 'note' diagnostics expected but not seen: 

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 7: Memory is allocated

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 10: Calling 'allocIntArray'

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 10 (directive at C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp:11): Returned allocated memory

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 13 (directive at C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp:14): Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'

5 errors generated.


error: command failed with exit status: 1

--

********************
PASS: Clang :: ASTMerge/typedef/test.c (4365 of 49400)
FAIL: Clang :: Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp (4366 of 49400)
******************** TEST 'Clang :: Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete -std=c++11 -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp
: 'RUN: at line 2';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -DLEAKS -std=c++11 -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe" "-cc1" "-internal-isystem" "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete" "-std=c++11" "-verify" "C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp"
# command stderr:
error: 'warning' diagnostics expected but not seen: 

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 32: Argument to free() is offset by 4 bytes from the start of memory allocated by malloc()

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 72: Argument to operator delete is offset by 4 bytes from the start of memory allocated by 'new'

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 91: Memory allocated by malloc() should be deallocated by free(), not 'delete'

  File C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 106: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'

4 errors generated.


error: command failed with exit status: 1

--

********************

******************** TEST 'Clang :: Analysis/NewDelete-intersections.mm' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm
: 'RUN: at line 2';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm
: 'RUN: at line 3';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -DTEST_INLINABLE_ALLOCATORS -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm
: 'RUN: at line 4';   c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -DTEST_INLINABLE_ALLOCATORS -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm
--
Exit Code: -2147483645

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe" "-cc1" "-internal-isystem" "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,cplusplus.NewDelete" "-std=c++11" "-fblocks" "-verify" "C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm"
$ ":" "RUN: at line 2"
$ "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe" "-cc1" "-internal-isystem" "c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks" "-std=c++11" "-DLEAKS" "-fblocks" "-verify" "C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm"
# command stderr:
unhandled family

UNREACHABLE executed at C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\StaticAnalyzer\Checkers\MallocChecker.cpp:1936!

Stack dump:

0.	Program arguments: c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\bin\clang.exe -cc1 -internal-isystem c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\build\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -verify C:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\test\Analysis\NewDelete-intersections.mm 

1.	<eof> parser at end of file

2.	While analyzing stack: 

	#0 Calling testMallocFreeNoWarn

 #0 0x00007ff72dda62dc HandleAbort c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\lib\support\windows\signals.inc:408:0

 #1 0x00007fff25b0bba1 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x6bba1)

 #2 0x00007fff25b0d7f9 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x6d7f9)

 #3 0x00007ff72dd0c3b3 llvm::llvm_unreachable_internal(char const *,char const *,unsigned int) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\lib\support\errorhandling.cpp:215:0

 #4 0x00007ff7314adf32 `anonymous namespace'::MallocChecker::getCheckIfTracked c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:1937:0

 #5 0x00007ff7314b1459 `anonymous namespace'::MallocChecker::reportLeak c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2571:0

 #6 0x00007ff7314a7442 `anonymous namespace'::MallocChecker::checkDeadSymbols c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2671:0

 #7 0x00007ff7314c0abc clang::ento::check::DeadSymbols::_checkDeadSymbols<class `anonymous namespace'::MallocChecker>(void *,class clang::ento::SymbolReaper &,class clang::ento::CheckerContext &) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\include\clang\staticanalyzer\core\checker.h:322:0

 #8 0x00007ff731a48242 clang::ento::CheckerFn<void (class clang::ento::SymbolReaper &,class clang::ento::CheckerContext &)>::operator()(class clang::ento::SymbolReaper &,class clang::ento::CheckerContext &)const  c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\include\clang\staticanalyzer\core\checkermanager.h:70:0

 #9 0x00007ff731a61079 `anonymous namespace'::CheckDeadSymbolsContext::runChecker c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:578:0

#10 0x00007ff731a2ec1c expandGraphWithCheckers<`anonymous namespace'::CheckDeadSymbolsContext> c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:139:0

#11 0x00007ff731a2b208 clang::ento::CheckerManager::runCheckersForDeadSymbols(class clang::ento::ExplodedNodeSet &,class clang::ento::ExplodedNodeSet const &,class clang::ento::SymbolReaper &,class clang::Stmt const *,class clang::ento::ExprEngine &,enum clang::ProgramPoint::Kind) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:592:0

#12 0x00007ff731b84791 clang::ento::ExprEngine::removeDead(class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &,class clang::Stmt const *,class clang::LocationContext const *,class clang::Stmt const *,enum clang::ProgramPoint::Kind) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\exprengine.cpp:739:0

#13 0x00007ff731c47eda clang::ento::ExprEngine::removeDeadOnEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\exprenginecallandreturn.cpp:182:0

#14 0x00007ff731b89683 clang::ento::ExprEngine::processEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ReturnStmt const *) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\exprengine.cpp:2320:0

#15 0x00007ff731b77cbf clang::ento::CoreEngine::HandleBlockEdge(class clang::BlockEdge const &,class clang::ento::ExplodedNode *) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\coreengine.cpp:259:0

#16 0x00007ff731b79a43 clang::ento::CoreEngine::dispatchWorkItem(class clang::ento::ExplodedNode *,class clang::ProgramPoint,class clang::ento::WorkListUnit const &) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\coreengine.cpp:160:0

#17 0x00007ff731b7979d clang::ento::CoreEngine::ExecuteWorkList(class clang::LocationContext const *,unsigned int,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\core\coreengine.cpp:149:0

#18 0x00007ff7311516c9 clang::ento::ExprEngine::ExecuteWorkList(class clang::LocationContext const *,unsigned int) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\include\clang\staticanalyzer\core\pathsensitive\exprengine.h:169:0

#19 0x00007ff73113dedf `anonymous namespace'::AnalysisConsumer::RunPathSensitiveChecks c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:827:0

#20 0x00007ff73113dcdf `anonymous namespace'::AnalysisConsumer::HandleCode c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:799:0

#21 0x00007ff73113d892 `anonymous namespace'::AnalysisConsumer::HandleDeclsCallGraph c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:584:0

#22 0x00007ff73113ee0d `anonymous namespace'::AnalysisConsumer::runAnalysisOnTranslationUnit c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:634:0

#23 0x00007ff73113d533 `anonymous namespace'::AnalysisConsumer::HandleTranslationUnit c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:665:0

#24 0x00007ff731d39697 clang::ParseAST(class clang::Sema &,bool,bool) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\parse\parseast.cpp:178:0

#25 0x00007ff72ef4a03b clang::ASTFrontendAction::ExecuteAction(void) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\frontend\frontendaction.cpp:1044:0

#26 0x00007ff72ef499cc clang::FrontendAction::Execute(void) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\frontend\frontendaction.cpp:939:0

#27 0x00007ff72eeace83 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\frontend\compilerinstance.cpp:957:0

#28 0x00007ff72f12a343 clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:290:0

#29 0x00007ff729b0b4ea cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\cc1_main.cpp:250:0

#30 0x00007ff729af323d ExecuteCC1Tool c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\driver.cpp:309:0

#31 0x00007ff729af3a9b main c:\ps4-buildslave2\llvm-clang-x86_64-expensive-checks-win\llvm\tools\clang\tools\driver\driver.cpp:382:0

#32 0x00007ff733faa784 invoke_main d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:79:0

#33 0x00007ff733faa62e __scrt_common_main_seh d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0

#34 0x00007ff733faa4ee __scrt_common_main d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0

#35 0x00007ff733faa819 mainCRTStartup d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0

#36 0x00007fff415f7e94 (C:\WINDOWS\System32\KERNEL32.DLL+0x17e94)

#37 0x00007fff424da251 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6a251)


error: command failed with exit status: 0x80000003

--

********************

edit: Seems like UB. Let's hope the sanitizer catches it, after it finished the painfully slow build.

http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/10848/steps/annotate/logs/stdio

Testing: 
FAIL: Clang :: Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp (234 of 15728)
******************** TEST 'Clang :: Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete -std=c++11 -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp
: 'RUN: at line 2';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -DLEAKS -std=c++11 -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,unix.Malloc,unix.MismatchedDeallocator,cplusplus.NewDelete" "-std=c++11" "-verify" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp"
# command stderr:
error: 'warning' diagnostics expected but not seen: 

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 32: Argument to free() is offset by 4 bytes from the start of memory allocated by malloc()

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 72: Argument to operator delete is offset by 4 bytes from the start of memory allocated by 'new'

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 91: Memory allocated by malloc() should be deallocated by free(), not 'delete'

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\Malloc+MismatchedDeallocator+NewDelete.cpp Line 106: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'

4 errors generated.


error: command failed with exit status: 1

--

********************
Testing: 
FAIL: Clang :: Analysis/MismatchedDeallocator-path-notes.cpp (244 of 15728)
******************** TEST 'Clang :: Analysis/MismatchedDeallocator-path-notes.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=text -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp
: 'RUN: at line 2';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.MismatchedDeallocator -analyzer-output=plist C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp -o C:\b\slave\clang-x64-windows-msvc\build\build\stage1\tools\clang\test\Analysis\Output\MismatchedDeallocator-path-notes.cpp.tmp.plist
: 'RUN: at line 3';   tail -n +11 C:\b\slave\clang-x64-windows-msvc\build\build\stage1\tools\clang\test\Analysis\Output\MismatchedDeallocator-path-notes.cpp.tmp.plist | grep -Ev '^[[:space:]]*<string>.* version .*</string>[[:space:]]*$|^[[:space:]]*<string>/.*</string>[[:space:]]*$|^[[:space:]]*<string>.:.*</string>[[:space:]]*$' | diff -ub C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis/copypaste/Inputs/expected-plists/MismatchedDeallocator-path-notes.cpp.plist -
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,unix.MismatchedDeallocator" "-analyzer-output=text" "-verify" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp"
# command stderr:
error: 'warning' diagnostics expected but not seen: 

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 13: Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'

error: 'note' diagnostics expected but not seen: 

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 7: Memory is allocated

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 10: Calling 'allocIntArray'

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 10 (directive at C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp:11): Returned allocated memory

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp Line 13 (directive at C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\MismatchedDeallocator-path-notes.cpp:14): Memory allocated by 'new[]' should be deallocated by 'delete[]', not 'delete'

5 errors generated.


error: command failed with exit status: 1

--

********************
Testing: 0 
FAIL: Clang :: Analysis/malloc.mm (627 of 15728)
******************** TEST 'Clang :: Analysis/malloc.mm' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,unix.Malloc -analyzer-store=region -verify -fblocks C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.mm
--
Exit Code: 1

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,unix.Malloc" "-analyzer-store=region" "-verify" "-fblocks" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.mm"
# command stderr:
error: 'warning' diagnostics expected but not seen: 

  File C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.mm Line 71: Argument to +dataWithBytesNoCopy:length:freeWhenDone: is offset by 4 bytes from the start of memory allocated by malloc()

1 error generated.


error: command failed with exit status: 1

--

********************
Testing: 0 
FAIL: Clang :: Analysis/NewDelete-intersections.mm (819 of 15728)
******************** TEST 'Clang :: Analysis/NewDelete-intersections.mm' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm
: 'RUN: at line 2';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm
: 'RUN: at line 3';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete -std=c++11 -fblocks -DTEST_INLINABLE_ALLOCATORS -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm
: 'RUN: at line 4';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -DTEST_INLINABLE_ALLOCATORS -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm
--
Exit Code: -2147483645

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,cplusplus.NewDelete" "-std=c++11" "-fblocks" "-verify" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm"
$ ":" "RUN: at line 2"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks" "-std=c++11" "-DLEAKS" "-fblocks" "-verify" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm"
# command stderr:
unhandled family

UNREACHABLE executed at C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\StaticAnalyzer\Checkers\MallocChecker.cpp:1936!

Stack dump:

0.	Program arguments: c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=core,cplusplus.NewDelete,cplusplus.NewDeleteLeaks -std=c++11 -DLEAKS -fblocks -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\NewDelete-intersections.mm 

1.	<eof> parser at end of file

2.	While analyzing stack: 

	#0 Calling testMallocFreeNoWarn

 #0 0x00007ff6ced316c5 HandleAbort c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\windows\signals.inc:408:0

 #1 0x00007ffd9003d167 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6d167)

 #2 0x00007ffd9003dff1 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6dff1)

 #3 0x00007ff6cecf6440 llvm::llvm_unreachable_internal(char const *,char const *,unsigned int) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\errorhandling.cpp:209:0

 #4 0x00007ff6cfd4e99b `anonymous namespace'::MallocChecker::getCheckIfTracked c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:1936:0

 #5 0x00007ff6cfd53408 `anonymous namespace'::MallocChecker::reportLeak c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2571:0

 #6 0x00007ff6cfd4a451 `anonymous namespace'::MallocChecker::checkDeadSymbols c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2670:0

 #7 0x00007ff6cfe80b82 expandGraphWithCheckers<`anonymous namespace'::CheckDeadSymbolsContext> c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:138:0

 #8 0x00007ff6cfe84187 clang::ento::CheckerManager::runCheckersForDeadSymbols(class clang::ento::ExplodedNodeSet &,class clang::ento::ExplodedNodeSet const &,class clang::ento::SymbolReaper &,class clang::Stmt const *,class clang::ento::ExprEngine &,enum clang::ProgramPoint::Kind) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:592:0

 #9 0x00007ff6cfeeea3d clang::ento::ExprEngine::removeDead(class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &,class clang::Stmt const *,class clang::LocationContext const *,class clang::Stmt const *,enum clang::ProgramPoint::Kind) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:739:0

#10 0x00007ff6cff27c29 clang::ento::ExprEngine::removeDeadOnEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprenginecallandreturn.cpp:182:0

#11 0x00007ff6cfeed5ad clang::ento::ExprEngine::processEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ReturnStmt const *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:2320:0

#12 0x00007ff6cfed935f clang::ento::CoreEngine::HandleBlockEdge(class clang::BlockEdge const &,class clang::ento::ExplodedNode *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:259:0

#13 0x00007ff6cfeda143 clang::ento::CoreEngine::dispatchWorkItem(class clang::ento::ExplodedNode *,class clang::ProgramPoint,class clang::ento::WorkListUnit const &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:160:0

#14 0x00007ff6cfed8e6b clang::ento::CoreEngine::ExecuteWorkList(class clang::LocationContext const *,unsigned int,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:129:0

#15 0x00007ff6cfc921fd `anonymous namespace'::AnalysisConsumer::RunPathSensitiveChecks c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:827:0

#16 0x00007ff6cfc91477 `anonymous namespace'::AnalysisConsumer::HandleCode c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:799:0

#17 0x00007ff6cfc91938 `anonymous namespace'::AnalysisConsumer::HandleDeclsCallGraph c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:584:0

#18 0x00007ff6cfcb1544 `anonymous namespace'::AnalysisConsumer::runAnalysisOnTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:634:0

#19 0x00007ff6cfc91db5 `anonymous namespace'::AnalysisConsumer::HandleTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:665:0

#20 0x00007ff6cff6a375 clang::ParseAST(class clang::Sema &,bool,bool) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\parse\parseast.cpp:178:0

#21 0x00007ff6cf40350d clang::ASTFrontendAction::ExecuteAction(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:1044:0

#22 0x00007ff6cf403328 clang::FrontendAction::Execute(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:939:0

#23 0x00007ff6cf3c7e92 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\compilerinstance.cpp:957:0

#24 0x00007ff6cf46544d clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:290:0

#25 0x00007ff6cd33d900 cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\cc1_main.cpp:251:0

#26 0x00007ff6cd3381c5 ExecuteCC1Tool c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:319:0

#27 0x00007ff6cd33a6ab main c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:382:0

#28 0x00007ff6d0ae018c __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0

#29 0x00007ffd987d13f2 (C:\windows\system32\KERNEL32.DLL+0x13f2)

#30 0x00007ffd9b0954f4 (C:\windows\SYSTEM32\ntdll.dll+0x154f4)


error: command failed with exit status: 0x80000003

--

********************
Testing: 0 .
FAIL: Clang :: Analysis/free.c (1014 of 15728)
******************** TEST 'Clang :: Analysis/free.c' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -fblocks -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\free.c -analyzer-store=region    -analyzer-checker=core    -analyzer-checker=unix.Malloc
: 'RUN: at line 5';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -fblocks -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\free.c -analyzer-store=region    -analyzer-checker=core    -analyzer-checker=unix.Malloc    -analyzer-config unix.DynamicMemoryModeling:Optimistic=true
--
Exit Code: -2147483645

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-fblocks" "-verify" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\free.c" "-analyzer-store=region" "-analyzer-checker=core" "-analyzer-checker=unix.Malloc"
# command stderr:
unhandled family

UNREACHABLE executed at C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\StaticAnalyzer\Checkers\MallocChecker.cpp:1936!

Stack dump:

0.	Program arguments: c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -fblocks -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\free.c -analyzer-store=region -analyzer-checker=core -analyzer-checker=unix.Malloc 

1.	<eof> parser at end of file

2.	While analyzing stack: 

	#0 Calling t11

 #0 0x00007ff6ced316c5 HandleAbort c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\windows\signals.inc:408:0

 #1 0x00007ffd9003d167 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6d167)

 #2 0x00007ffd9003dff1 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6dff1)

 #3 0x00007ff6cecf6440 llvm::llvm_unreachable_internal(char const *,char const *,unsigned int) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\errorhandling.cpp:209:0

 #4 0x00007ff6cfd4e99b `anonymous namespace'::MallocChecker::getCheckIfTracked c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:1936:0

 #5 0x00007ff6cfd53408 `anonymous namespace'::MallocChecker::reportLeak c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2571:0

 #6 0x00007ff6cfd4a451 `anonymous namespace'::MallocChecker::checkDeadSymbols c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2670:0

 #7 0x00007ff6cfe80b82 expandGraphWithCheckers<`anonymous namespace'::CheckDeadSymbolsContext> c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:138:0

 #8 0x00007ff6cfe84187 clang::ento::CheckerManager::runCheckersForDeadSymbols(class clang::ento::ExplodedNodeSet &,class clang::ento::ExplodedNodeSet const &,class clang::ento::SymbolReaper &,class clang::Stmt const *,class clang::ento::ExprEngine &,enum clang::ProgramPoint::Kind) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:592:0

 #9 0x00007ff6cfeeea3d clang::ento::ExprEngine::removeDead(class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &,class clang::Stmt const *,class clang::LocationContext const *,class clang::Stmt const *,enum clang::ProgramPoint::Kind) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:739:0

#10 0x00007ff6cff27c29 clang::ento::ExprEngine::removeDeadOnEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprenginecallandreturn.cpp:182:0

#11 0x00007ff6cfeed5ad clang::ento::ExprEngine::processEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ReturnStmt const *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:2320:0

#12 0x00007ff6cfed935f clang::ento::CoreEngine::HandleBlockEdge(class clang::BlockEdge const &,class clang::ento::ExplodedNode *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:259:0

#13 0x00007ff6cfeda143 clang::ento::CoreEngine::dispatchWorkItem(class clang::ento::ExplodedNode *,class clang::ProgramPoint,class clang::ento::WorkListUnit const &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:160:0

#14 0x00007ff6cfed8e6b clang::ento::CoreEngine::ExecuteWorkList(class clang::LocationContext const *,unsigned int,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:129:0

#15 0x00007ff6cfc921fd `anonymous namespace'::AnalysisConsumer::RunPathSensitiveChecks c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:827:0

#16 0x00007ff6cfc91477 `anonymous namespace'::AnalysisConsumer::HandleCode c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:799:0

#17 0x00007ff6cfc91938 `anonymous namespace'::AnalysisConsumer::HandleDeclsCallGraph c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:584:0

#18 0x00007ff6cfcb1544 `anonymous namespace'::AnalysisConsumer::runAnalysisOnTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:634:0

#19 0x00007ff6cfc91db5 `anonymous namespace'::AnalysisConsumer::HandleTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:665:0

#20 0x00007ff6cff6a375 clang::ParseAST(class clang::Sema &,bool,bool) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\parse\parseast.cpp:178:0

#21 0x00007ff6cf40350d clang::ASTFrontendAction::ExecuteAction(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:1044:0

#22 0x00007ff6cf403328 clang::FrontendAction::Execute(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:939:0

#23 0x00007ff6cf3c7e92 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\compilerinstance.cpp:957:0

#24 0x00007ff6cf46544d clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:290:0

#25 0x00007ff6cd33d900 cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\cc1_main.cpp:251:0

#26 0x00007ff6cd3381c5 ExecuteCC1Tool c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:319:0

#27 0x00007ff6cd33a6ab main c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:382:0

#28 0x00007ff6d0ae018c __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0

#29 0x00007ffd987d13f2 (C:\windows\system32\KERNEL32.DLL+0x13f2)

#30 0x00007ffd9b0954f4 (C:\windows\SYSTEM32\ntdll.dll+0x154f4)


error: command failed with exit status: 0x80000003

--

********************
Testing: 0 .
FAIL: Clang :: Analysis/inner-pointer.cpp (1145 of 15728)
******************** TEST 'Clang :: Analysis/inner-pointer.cpp' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=cplusplus.InnerPointer      -Wno-dangling -Wno-dangling-field -Wno-return-stack-address    C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\inner-pointer.cpp -analyzer-output=text -verify
--
Exit Code: -2147483645

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-checker=cplusplus.InnerPointer" "-Wno-dangling" "-Wno-dangling-field" "-Wno-return-stack-address" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\inner-pointer.cpp" "-analyzer-output=text" "-verify"
# command stderr:
unhandled family

UNREACHABLE executed at C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\StaticAnalyzer\Checkers\MallocChecker.cpp:1936!

Stack dump:

0.	Program arguments: c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-checker=cplusplus.InnerPointer -Wno-dangling -Wno-dangling-field -Wno-return-stack-address C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\inner-pointer.cpp -analyzer-output=text -verify 

1.	<eof> parser at end of file

2.	While analyzing stack: 

	#0 Calling escape_via_return_local

 #0 0x00007ff6ced316c5 HandleAbort c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\windows\signals.inc:408:0

 #1 0x00007ffd9003d167 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6d167)

 #2 0x00007ffd9003dff1 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6dff1)

 #3 0x00007ff6cecf6440 llvm::llvm_unreachable_internal(char const *,char const *,unsigned int) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\errorhandling.cpp:209:0

 #4 0x00007ff6cfd4e99b `anonymous namespace'::MallocChecker::getCheckIfTracked c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:1936:0

 #5 0x00007ff6cfd47340 `anonymous namespace'::MallocChecker::ReportUseAfterFree c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2241:0

 #6 0x00007ff6cfd4c6bb `anonymous namespace'::MallocChecker::checkUseAfterFree c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2841:0

 #7 0x00007ff6cfd4a8fe `anonymous namespace'::MallocChecker::checkEscapeOnReturn c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2761:0

 #8 0x00007ff6cfe84333 clang::ento::CheckerManager::runCheckersForEndFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNodeSet &,class clang::ento::ExplodedNode *,class clang::ento::ExprEngine &,class clang::ReturnStmt const *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:458:0

 #9 0x00007ff6cfeed607 clang::ento::ExprEngine::processEndOfFunction(struct clang::ento::NodeBuilderContext &,class clang::ento::ExplodedNode *,class clang::ReturnStmt const *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:2321:0

#10 0x00007ff6cfed935f clang::ento::CoreEngine::HandleBlockEdge(class clang::BlockEdge const &,class clang::ento::ExplodedNode *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:259:0

#11 0x00007ff6cfeda143 clang::ento::CoreEngine::dispatchWorkItem(class clang::ento::ExplodedNode *,class clang::ProgramPoint,class clang::ento::WorkListUnit const &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:160:0

#12 0x00007ff6cfed8e6b clang::ento::CoreEngine::ExecuteWorkList(class clang::LocationContext const *,unsigned int,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:129:0

#13 0x00007ff6cfc921fd `anonymous namespace'::AnalysisConsumer::RunPathSensitiveChecks c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:827:0

#14 0x00007ff6cfc91477 `anonymous namespace'::AnalysisConsumer::HandleCode c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:799:0

#15 0x00007ff6cfc91938 `anonymous namespace'::AnalysisConsumer::HandleDeclsCallGraph c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:584:0

#16 0x00007ff6cfcb1544 `anonymous namespace'::AnalysisConsumer::runAnalysisOnTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:634:0

#17 0x00007ff6cfc91db5 `anonymous namespace'::AnalysisConsumer::HandleTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:665:0

#18 0x00007ff6cff6a375 clang::ParseAST(class clang::Sema &,bool,bool) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\parse\parseast.cpp:178:0

#19 0x00007ff6cf40350d clang::ASTFrontendAction::ExecuteAction(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:1044:0

#20 0x00007ff6cf403328 clang::FrontendAction::Execute(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:939:0

#21 0x00007ff6cf3c7e92 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\compilerinstance.cpp:957:0

#22 0x00007ff6cf46544d clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:290:0

#23 0x00007ff6cd33d900 cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\cc1_main.cpp:251:0

#24 0x00007ff6cd3381c5 ExecuteCC1Tool c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:319:0

#25 0x00007ff6cd33a6ab main c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:382:0

#26 0x00007ff6d0ae018c __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0

#27 0x00007ffd987d13f2 (C:\windows\system32\KERNEL32.DLL+0x13f2)

#28 0x00007ffd9b0954f4 (C:\windows\SYSTEM32\ntdll.dll+0x154f4)


error: command failed with exit status: 0x80000003

--

********************
Testing: 0 ..
FAIL: Clang :: Analysis/malloc.c (1324 of 15728)
******************** TEST 'Clang :: Analysis/malloc.c' FAILED ********************
Script:
--
: 'RUN: at line 1';   c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-store=region -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.c    -analyzer-checker=core    -analyzer-checker=alpha.deadcode.UnreachableCode    -analyzer-checker=alpha.core.CastSize    -analyzer-checker=unix.Malloc    -analyzer-checker=debug.ExprInspection
--
Exit Code: -2147483645

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe" "-cc1" "-internal-isystem" "c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include" "-nostdsysteminc" "-analyze" "-analyzer-constraints=range" "-analyzer-store=region" "-verify" "C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.c" "-analyzer-checker=core" "-analyzer-checker=alpha.deadcode.UnreachableCode" "-analyzer-checker=alpha.core.CastSize" "-analyzer-checker=unix.Malloc" "-analyzer-checker=debug.ExprInspection"
# command stderr:
unhandled family

UNREACHABLE executed at C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\StaticAnalyzer\Checkers\MallocChecker.cpp:1936!

Stack dump:

0.	Program arguments: c:\b\slave\clang-x64-windows-msvc\build\build\stage1\bin\clang.exe -cc1 -internal-isystem c:\b\slave\clang-x64-windows-msvc\build\build\stage1\lib\clang\10.0.0\include -nostdsysteminc -analyze -analyzer-constraints=range -analyzer-store=region -verify C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.c -analyzer-checker=core -analyzer-checker=alpha.deadcode.UnreachableCode -analyzer-checker=alpha.core.CastSize -analyzer-checker=unix.Malloc -analyzer-checker=debug.ExprInspection 

1.	<eof> parser at end of file

2.	While analyzing stack: 

	#0 Calling CheckUseZeroWinAllocated2

3.	C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.c:273:10: Error evaluating statement

4.	C:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\test\Analysis\malloc.c:273:10: Error evaluating statement

 #0 0x00007ff6ced316c5 HandleAbort c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\windows\signals.inc:408:0

 #1 0x00007ffd9003d167 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6d167)

 #2 0x00007ffd9003dff1 (C:\windows\SYSTEM32\ucrtbase.DLL+0x6dff1)

 #3 0x00007ff6cecf6440 llvm::llvm_unreachable_internal(char const *,char const *,unsigned int) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\lib\support\errorhandling.cpp:209:0

 #4 0x00007ff6cfd4e99b `anonymous namespace'::MallocChecker::getCheckIfTracked c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:1936:0

 #5 0x00007ff6cfd47647 `anonymous namespace'::MallocChecker::ReportUseZeroAllocated c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\checkers\mallocchecker.cpp:2335:0

 #6 0x00007ff6cfd40911 clang::ento::check::Location::_checkLocation<class `anonymous namespace'::MallocChecker>(void *,class clang::ento::SVal const &,bool,class clang::Stmt const *,class clang::ento::CheckerContext &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\include\clang\staticanalyzer\core\checker.h:199:0

 #7 0x00007ff6cfe80f06 expandGraphWithCheckers<`anonymous namespace'::CheckLocationContext> c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:138:0

 #8 0x00007ff6cfe84c12 clang::ento::CheckerManager::runCheckersForLocation(class clang::ento::ExplodedNodeSet &,class clang::ento::ExplodedNodeSet const &,class clang::ento::SVal,bool,class clang::Stmt const *,class clang::Stmt const *,class clang::ento::ExprEngine &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\checkermanager.cpp:359:0

 #9 0x00007ff6cfee7ed7 clang::ento::ExprEngine::evalLocation(class clang::ento::ExplodedNodeSet &,class clang::Stmt const *,class clang::Stmt const *,class clang::ento::ExplodedNode *,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >,class clang::ento::SVal,bool) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:2904:0

#10 0x00007ff6cfee79e2 clang::ento::ExprEngine::evalLoad(class clang::ento::ExplodedNodeSet &,class clang::Expr const *,class clang::Expr const *,class clang::ento::ExplodedNode *,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >,class clang::ento::SVal,class clang::ProgramPointTag const *,class clang::QualType) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:2848:0

#11 0x00007ff6cff332f5 clang::ento::ExprEngine::VisitCast(class clang::CastExpr const *,class clang::Expr const *,class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprenginec.cpp:314:0

#12 0x00007ff6cfee1e73 clang::ento::ExprEngine::Visit(class clang::Stmt const *,class clang::ento::ExplodedNode *,class clang::ento::ExplodedNodeSet &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:1697:0

#13 0x00007ff6cfedf594 clang::ento::ExprEngine::ProcessStmt(class clang::Stmt const *,class clang::ento::ExplodedNode *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:791:0

#14 0x00007ff6cfeecb4b clang::ento::ExprEngine::processCFGElement(class clang::CFGElement,class clang::ento::ExplodedNode *,unsigned int,struct clang::ento::NodeBuilderContext *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\exprengine.cpp:637:0

#15 0x00007ff6cfeda43d clang::ento::CoreEngine::dispatchWorkItem(class clang::ento::ExplodedNode *,class clang::ProgramPoint,class clang::ento::WorkListUnit const &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:195:0

#16 0x00007ff6cfed8e6b clang::ento::CoreEngine::ExecuteWorkList(class clang::LocationContext const *,unsigned int,class llvm::IntrusiveRefCntPtr<class clang::ento::ProgramState const >) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\core\coreengine.cpp:129:0

#17 0x00007ff6cfc921fd `anonymous namespace'::AnalysisConsumer::RunPathSensitiveChecks c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:827:0

#18 0x00007ff6cfc91477 `anonymous namespace'::AnalysisConsumer::HandleCode c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:799:0

#19 0x00007ff6cfc91938 `anonymous namespace'::AnalysisConsumer::HandleDeclsCallGraph c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:584:0

#20 0x00007ff6cfcb1544 `anonymous namespace'::AnalysisConsumer::runAnalysisOnTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:634:0

#21 0x00007ff6cfc91db5 `anonymous namespace'::AnalysisConsumer::HandleTranslationUnit c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\staticanalyzer\frontend\analysisconsumer.cpp:665:0

#22 0x00007ff6cff6a375 clang::ParseAST(class clang::Sema &,bool,bool) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\parse\parseast.cpp:178:0

#23 0x00007ff6cf40350d clang::ASTFrontendAction::ExecuteAction(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:1044:0

#24 0x00007ff6cf403328 clang::FrontendAction::Execute(void) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\frontendaction.cpp:939:0

#25 0x00007ff6cf3c7e92 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontend\compilerinstance.cpp:957:0

#26 0x00007ff6cf46544d clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\lib\frontendtool\executecompilerinvocation.cpp:290:0

#27 0x00007ff6cd33d900 cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\cc1_main.cpp:251:0

#28 0x00007ff6cd3381c5 ExecuteCC1Tool c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:319:0

#29 0x00007ff6cd33a6ab main c:\b\slave\clang-x64-windows-msvc\build\llvm.src\tools\clang\tools\driver\driver.cpp:382:0

#30 0x00007ff6d0ae018c __scrt_common_main_seh f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0

#31 0x00007ffd987d13f2 (C:\windows\system32\KERNEL32.DLL+0x13f2)

#32 0x00007ffd9b0954f4 (C:\windows\SYSTEM32\ntdll.dll+0x154f4)


error: command failed with exit status: 0x80000003

--

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
Testing Time: 103.83s
********************
Failing Tests (7):
    Clang :: Analysis/Malloc+MismatchedDeallocator+NewDelete.cpp
    Clang :: Analysis/MismatchedDeallocator-path-notes.cpp
    Clang :: Analysis/NewDelete-intersections.mm
    Clang :: Analysis/free.c
    Clang :: Analysis/inner-pointer.cpp
    Clang :: Analysis/malloc.c
    Clang :: Analysis/malloc.mm

edit2: UBSan found nothing, giving one last shot with MemSan.

edit3: No luck. I'll try to make a windows build happen, but have little faith. If this fails, I'll revert.

edit4: rL372462 seems to have solved the issue. * biiiiiiiiiiiiiiiiig sigh of relief *