Page MenuHomePhabricator
Feed Advanced Search

Today

martong added a comment to D77809: [Analyzer] Include typedef statements in CFG build..

There must be a way to dump the CFG. Perhaps you could add a test that dumps the CFG of a given source and then by using FileCheck we could see the exact feature that is missing.

Thu, Apr 9, 9:04 AM · Restricted Project
martong added a comment to D75665: [analyzer] On-demand parsing capability for CTU.

The warning below suggests that we parse the ctu-other.c file (and presumably every file) as a C++ file, even if it should be parsed as a C file. Perhaps the invocation of the parser is missing some setting? Also, could this be the reason why on-the-fly and pch driven ctu gives different statistics?

warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
/mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/clang/test/Analysis/Inputs/ctu-other.c:47:26: error: 'DataType' cannot be defined in a parameter type
int structInProto(struct DataType {int a;int b; } * d) {
                         ^
1 error generated.
Error while processing /mnt/disks/ssd0/agent/workspace/amd64_debian_testing_clang8/clang/test/Analysis/Inputs/ctu-other.c.

I have investigated the issue, and the compiler flags were looked up using the heuristic implemented in tooling.
This heuristic looks for the suitable compilation database in an upward ascending fashion inside the directory tree startin from the input source file.
By copying both the source file and the compilation database to the test directory this heuristic does the right thing now. (up until now the found compile_commands.json was the one used for llvm-project itself, and picked up a c++ specific compilation).

This issue is solved, however the ASTImporter still cannot import the inline definition of the struct, and emits an error.
Right now I am debugging the master branch that uses the AST-dumps wheter I also encounter this error inside the ASTImporter (just to see if I am operating on sane assumptions).

Thu, Apr 9, 8:58 AM · Restricted Project
martong added a comment to D77792: [analyzer] Extend constraint manager to be able to compare simple SymSymExprs.

I like it, nice work!

Thu, Apr 9, 8:46 AM · Restricted Project
martong added inline comments to D77066: [analyzer] ApiModeling: Add buffer size arg constraint.
Thu, Apr 9, 8:40 AM · Restricted Project
martong accepted D77721: [ASTImporter] Add support for importing fixed point literals.

Hi Vince, this looks good to me!

Thu, Apr 9, 8:07 AM · Restricted Project
martong added a comment to D77745: [analyzer] SADMatchers: Static Analyzer Data matchers.

What is the concrete problem you are trying to solve? Could you please elaborate on why do we need this raw copy of the original ASTMatchers library? Why is it not possible to use the matchers from libAST? I am not sure that a raw copy paste of a whole library is the most appropriate solution to any problem.

Thu, Apr 9, 3:45 AM · Restricted Project

Yesterday

martong added inline comments to D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints.
Wed, Apr 8, 9:44 AM · Restricted Project
martong added a comment to D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls.
In D77641#1969412, @NoQ wrote:

So you only do the lookup in the global scope? What about namespace std?

Do you also plan to support class methods by looking up the class first and then looking up the method in the class?

Wed, Apr 8, 9:12 AM · Restricted Project
martong added a comment to D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls.

I suspect your change made compiler errors a bit nicer as well, so you don't get one giant "Well, this huuuuuge single argument doesn't match any of the assignment operators".

The reason why I added addToFunctionSummaryMap calls is because we have to do a lookup and based on the lookup result we either map the summary or not. (I did not have any problems with the compiler diagnostics regarding the initializer list.)

Wed, Apr 8, 9:12 AM · Restricted Project
martong added a child revision for D57226: [Fixed Point] [AST] Add an AST serialization code for fixed-point literals.: D77721: [ASTImporter] Add support for importing fixed point literals.
Wed, Apr 8, 8:39 AM · Restricted Project
martong added a parent revision for D77721: [ASTImporter] Add support for importing fixed point literals: D57226: [Fixed Point] [AST] Add an AST serialization code for fixed-point literals..
Wed, Apr 8, 8:39 AM · Restricted Project
martong accepted D77305: [Analyzer][VLASize] Support multi-dimensional arrays..

LGTM, nice work!

Wed, Apr 8, 8:39 AM · Restricted Project
martong accepted D76605: [analyzer] Display the checker name in the text output.

I was just wondering if it would make sense to have a test with display-checker-name=true. Other than that, LGTM!

Wed, Apr 8, 7:34 AM · Restricted Project

Tue, Apr 7

martong added a parent revision for D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints: D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls.
Tue, Apr 7, 9:12 AM · Restricted Project
martong created D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints.
Tue, Apr 7, 9:12 AM · Restricted Project
martong added a child revision for D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls: D77658: [analyzer] StdLibraryFunctionsChecker: Add sanity checks for constraints.
Tue, Apr 7, 9:12 AM · Restricted Project
martong added inline comments to D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls.
Tue, Apr 7, 5:23 AM · Restricted Project
Herald added a reviewer for D77641: [analyzer] StdLibraryFunctionsChecker: Associate summaries to FunctionDecls: sstefan1.
Tue, Apr 7, 5:23 AM · Restricted Project

Mon, Apr 6

martong committed rG8f961399739f: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl (authored by martong).
[analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl
Mon, Apr 6, 8:39 AM
martong closed D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl.
Mon, Apr 6, 8:39 AM · Restricted Project
martong committed rGab1fad8a3a8b: [analyzer] StdLibraryFunctionsChecker: Add test for function with default… (authored by martong).
[analyzer] StdLibraryFunctionsChecker: Add test for function with default…
Mon, Apr 6, 8:39 AM
martong closed D77411: [analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter.
Mon, Apr 6, 8:39 AM · Restricted Project
martong added a comment to D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl.

LGTM! Maybe its worth glancing over the rest of the code (comments in particular) whether anything would be outdated by this change.

Mon, Apr 6, 8:38 AM · Restricted Project

Fri, Apr 3

martong created D77411: [analyzer] StdLibraryFunctionsChecker: Add test for function with default parameter.
Fri, Apr 3, 9:07 AM · Restricted Project
martong updated the summary of D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl.
Fri, Apr 3, 9:07 AM · Restricted Project
martong updated the summary of D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl.
Fri, Apr 3, 9:07 AM · Restricted Project
martong updated the summary of D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl.
Fri, Apr 3, 9:07 AM · Restricted Project
martong created D77410: [analyzer] StdLibraryFunctionsChecker: match signature based on FunctionDecl.
Fri, Apr 3, 8:37 AM · Restricted Project

Thu, Apr 2

martong committed rG1525232e2761: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints (authored by martong).
[analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints
Thu, Apr 2, 8:07 AM
martong closed D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.
Thu, Apr 2, 8:06 AM · Restricted Project
martong added a comment to D77125: [Analyzer] Model return values of container insert and delete operations.

It seems like we could model here emplace and emplace_after exactly the same way we do with insert and insert_after, couldn't we? Perhaps that could go into this patch too.

They are already in this patch (see the tests and the CallDescriptionMap), but they share their handing function with insert and insert_after.

Thu, Apr 2, 6:28 AM · Restricted Project

Wed, Apr 1

martong added a comment to D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.

Ping :)

Wed, Apr 1, 7:52 AM · Restricted Project
martong awarded D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints a Burninate token.
Wed, Apr 1, 7:51 AM · Restricted Project
martong added inline comments to D77177: [Analyzer][WebKit] RefCntblBaseVirtualDtorChecker & shared utils.
Wed, Apr 1, 7:41 AM
martong added inline comments to D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved.
Wed, Apr 1, 7:40 AM · Restricted Project

Tue, Mar 31

martong added a comment to D77150: [Analyzer] New Option for ContainerModeling: AggressiveEraseModeling.

Do you have a lit test as well? It would be useful to have one that is similar to the one you mention in the review's summary.

Tue, Mar 31, 10:33 AM · Restricted Project
martong added a comment to D77125: [Analyzer] Model return values of container insert and delete operations.

It seems like we could model here emplace and emplace_after exactly the same way we do with insert and insert_after, couldn't we? Perhaps that could go into this patch too.

Tue, Mar 31, 9:22 AM · Restricted Project
martong added a parent revision for D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved: D77066: [analyzer] ApiModeling: Add buffer size arg constraint.
Tue, Mar 31, 8:49 AM · Restricted Project
martong created D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved.
Tue, Mar 31, 8:49 AM · Restricted Project
martong added a child revision for D77066: [analyzer] ApiModeling: Add buffer size arg constraint: D77148: [analyzer] ApiModeling: Add buffer size arg constraint with multiplier involved.
Tue, Mar 31, 8:49 AM · Restricted Project
martong accepted D76996: [analyzer] Improve PlacementNewChecker.

LGTM! Thanks! But I am not that confident with the element regions and field regions, so @NoQ could you please take another look?

Tue, Mar 31, 2:42 AM · Restricted Project
martong added inline comments to D76996: [analyzer] Improve PlacementNewChecker.
Tue, Mar 31, 1:04 AM · Restricted Project

Mon, Mar 30

martong committed rG1a1bb876dba4: [analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's… (authored by martong).
[analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's…
Mon, Mar 30, 9:11 AM
martong added a comment to D77062: [analyzer] Added check for unacceptable equality operation between Loc and NonLoc types.

Seems okay to me, but please wait for other reviewers please. And I have some questions.
Could you please add a reproducer lit test file? E.g. maybe from the bug you mentioned.
Did the crash happen only when driven from clang-tidy?

Mon, Mar 30, 9:11 AM · Restricted Project
martong closed D77061: [analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's dependency.
Mon, Mar 30, 9:11 AM · Restricted Project
martong added a parent revision for D77066: [analyzer] ApiModeling: Add buffer size arg constraint: D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.
Mon, Mar 30, 9:10 AM · Restricted Project
martong created D77066: [analyzer] ApiModeling: Add buffer size arg constraint.
Mon, Mar 30, 9:10 AM · Restricted Project
martong added a child revision for D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints: D77066: [analyzer] ApiModeling: Add buffer size arg constraint.
Mon, Mar 30, 9:10 AM · Restricted Project
martong created D77061: [analyzer] Add core.CallAndMessage to StdCLibraryFunctionArgsChecker's dependency.
Mon, Mar 30, 8:09 AM · Restricted Project
martong updated the diff for D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.
  • Test multiple constraints on the same arg
Mon, Mar 30, 8:03 AM · Restricted Project
martong added a comment to D76996: [analyzer] Improve PlacementNewChecker.

Wohoow! I am impressed, this is really nice work, I like it! :) Could not find any glitch, looks good from my side once you address NoQ's concerns.

Mon, Mar 30, 7:00 AM · Restricted Project
martong accepted D77012: [analyzer] Fix StdLibraryFunctionsChecker NotNull Constraint Check.

LGTM and thanks!

Mon, Mar 30, 2:40 AM · Restricted Project

Fri, Mar 27

martong updated the diff for D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.
  • Add tests with a subchecker
Fri, Mar 27, 11:28 AM · Restricted Project

Thu, Mar 26

martong accepted D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR..

LGTM!

Thu, Mar 26, 7:33 AM · Restricted Project
martong added inline comments to D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR..
Thu, Mar 26, 4:17 AM · Restricted Project
martong added inline comments to D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR..
Thu, Mar 26, 4:17 AM · Restricted Project
martong added inline comments to D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR..
Thu, Mar 26, 3:12 AM · Restricted Project
martong added inline comments to D76830: [Analyzer][MallocChecker] No warning for kfree of ZERO_SIZE_PTR..
Thu, Mar 26, 2:40 AM · Restricted Project

Wed, Mar 25

martong added inline comments to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
Wed, Mar 25, 11:23 AM · Restricted Project
martong added a comment to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.

I just created a quick fix for the issue: https://reviews.llvm.org/D76790

Wed, Mar 25, 11:21 AM · Restricted Project
martong added a comment to D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.

I was thinking about the below test, but then I reverted back because I don't want to add "fake" summaries for testing purposes. Perhaps adding a new checker option could enable these "fake" summaries, @Szelethus what's your opinion?

Wed, Mar 25, 11:21 AM · Restricted Project
martong created D76790: [analyzer] StdLibraryFunctionsChecker: fix bug with arg constraints.
Wed, Mar 25, 11:21 AM · Restricted Project
martong committed rGeaa7d00f366b: [analyzer][NFC] Add missing LLVM header blurb (and license) (authored by martong).
[analyzer][NFC] Add missing LLVM header blurb (and license)
Wed, Mar 25, 10:17 AM
martong added inline comments to D71612: [analyzer] Add PlacementNewChecker.
Wed, Mar 25, 8:37 AM · Restricted Project
martong added inline comments to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
Wed, Mar 25, 8:04 AM · Restricted Project

Mon, Mar 23

martong added inline comments to D76604: [Analyzer] Model `size()` member function of containers.
Mon, Mar 23, 9:14 AM · Restricted Project
martong added inline comments to D76590: [Analyzer] Model `empty()` member function of containers.
Mon, Mar 23, 8:42 AM · Restricted Project
martong accepted D76509: [analyzer][NFC] Move the text output type to its own file, move code to PathDiagnosticConsumer creator functions.

OK, LGTM.

Mon, Mar 23, 8:41 AM · Restricted Project
martong added inline comments to D72281: [Matrix] Add matrix type to Clang..
Mon, Mar 23, 8:41 AM · Restricted Project
martong added inline comments to D76590: [Analyzer] Model `empty()` member function of containers.
Mon, Mar 23, 8:41 AM · Restricted Project
martong added inline comments to D76605: [analyzer] Display the checker name in the text output.
Mon, Mar 23, 7:03 AM · Restricted Project
martong added inline comments to D76509: [analyzer][NFC] Move the text output type to its own file, move code to PathDiagnosticConsumer creator functions.
Mon, Mar 23, 7:03 AM · Restricted Project

Fri, Mar 20

martong committed rGf59bb40e361c: Attempt to fix failing build-bot with [-Werror,-Wcovered-switch-default] (authored by martong).
Attempt to fix failing build-bot with [-Werror,-Wcovered-switch-default]
Fri, Mar 20, 10:17 AM
martong committed rGededa65d559d: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint (authored by martong).
[analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint
Fri, Mar 20, 9:45 AM
martong closed D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint.
Fri, Mar 20, 9:45 AM · Restricted Project
martong accepted D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`.

LGTM!

Fri, Mar 20, 9:44 AM · Restricted Project
martong added a comment to D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint.
In D75063#1923780, @NoQ wrote:

This is basically a shorthand for "outside [0, 0]", right? I don't mind ^.^

Fri, Mar 20, 9:44 AM · Restricted Project
martong updated the diff for D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint.
  • Use report/bugpath verify prefixes in test
  • Address review nits
Fri, Mar 20, 9:44 AM · Restricted Project
martong committed rG94061df6e5f2: [analyzer] StdLibraryFunctionsChecker: Add argument constraints (authored by martong).
[analyzer] StdLibraryFunctionsChecker: Add argument constraints
Fri, Mar 20, 8:39 AM
martong closed D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
Fri, Mar 20, 8:39 AM · Restricted Project
martong added a comment to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.

Thanks for the review guys!

Fri, Mar 20, 8:38 AM · Restricted Project
martong updated the diff for D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
  • Use prefixes for -verify to check different things in the same test file
Fri, Mar 20, 8:38 AM · Restricted Project

Wed, Mar 18

martong added inline comments to D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`.
Wed, Mar 18, 11:24 AM · Restricted Project
martong added a comment to D76361: [Analyzer] Iterator Modeling - Model `std::advance()`, `std::prev()` and `std::next()`.

Whenever the analyzer budget runs out just at the point where std::advance(), std::prev() or std::next() is invoked the function are not inlined. This results in strange behavior such as std::prev(v.end()) equals v.end(). To prevent this model these functions if they were not inlined. It may also happend that although std::advance() is inlined but a function it calls inside (e.g. __advance() in some implementations) is not. This case is also handled in this patch.

Wed, Mar 18, 10:52 AM · Restricted Project
martong added a comment to D76229: [clang-tidy] Added PlacementNewStorageCheck.

Please note about the alignment requirements that they are not checked in the static analyzer for a reason. To track the alignment data across the data flow, probably we should modify the analyzer's core structure (e.g. MemRegion) and some modeling checkers like the MallocChecker. That is not an impossible task but also far from easy IMHO (would require several patches built on top of each other). Just as an example for the subtleties: think about the nuances of operator news default alignment and specific C++17 rules (https://reviews.llvm.org/D67545).

Wed, Mar 18, 10:52 AM · Restricted Project, Restricted Project
martong added a comment to D67336: [analyzer][NFC] Introduce SuperChecker<>, a convenient alternative to Checker<> for storing subcheckers.

The way I see perhaps we need a 3rd class of checkers (beside super and sub). And that would be those checkers which are not dependent closely on any super checker but they do emit diagnostics. E.g. the PlacementNewChecker is implemented in it's own, it emits some diagnostics, and does not model. However, it depends on MallocChecker's modeling when we are interested in dynamically allocated buffers sizes. Or would you add PlacementNewChecker as MallocChecker's subchecker? That seems a bit overkill to me.

Wed, Mar 18, 8:41 AM · Restricted Project
martong added inline comments to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
Wed, Mar 18, 8:08 AM · Restricted Project
martong updated the diff for D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
  • Add comments about what is a branch
  • Do not use 'this' for BugType
  • Lazily init BT and BT -> BT_InvalidArg
  • ReportBug -> reportBug
Wed, Mar 18, 8:08 AM · Restricted Project
martong added inline comments to D75063: [analyzer] StdLibraryFunctionsChecker: Add NotNull Arg Constraint.
Wed, Mar 18, 6:30 AM · Restricted Project

Tue, Mar 17

martong updated the diff for D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
  • tmp -> Tmp
Tue, Mar 17, 12:57 PM · Restricted Project
martong added inline comments to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
Tue, Mar 17, 12:57 PM · Restricted Project
martong added a comment to D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance.

Please have my post-commit approval :^) Nice work!

Tue, Mar 17, 10:43 AM · Restricted Project
martong updated the diff for D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
  • Address review comments
Tue, Mar 17, 10:43 AM · Restricted Project
martong added inline comments to D73898: [analyzer] StdLibraryFunctionsChecker: Add argument constraints.
Tue, Mar 17, 10:43 AM · Restricted Project
martong committed rGc6b8484e855b: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance (authored by martong).
[analyzer] StdLibraryFunctionsChecker refactor w/ inheritance
Tue, Mar 17, 5:45 AM
martong closed D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance.
Tue, Mar 17, 5:44 AM · Restricted Project
martong added inline comments to D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance.
Tue, Mar 17, 5:43 AM · Restricted Project
martong updated the diff for D74973: [analyzer] StdLibraryFunctionsChecker refactor w/ inheritance.
  • Rebase to master
  • Add comments to ValueConstraint
  • Add virtual dtor
  • Add comments to ValueConstraintPtr
Tue, Mar 17, 5:43 AM · Restricted Project

Mon, Mar 16

martong added a comment to D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc).
  • Remove redundant VisitQualifiedTypeLoc and VisitAttributedTypeLoc
Mon, Mar 16, 8:42 AM · Restricted Project
martong updated the diff for D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc).
  • Fix the base commit of this patch
Mon, Mar 16, 8:42 AM · Restricted Project