Page MenuHomePhabricator

balazske (Balázs Kéri)
Engineering

Projects

User does not belong to any projects.

User Details

User Since
May 23 2018, 7:08 AM (87 w, 4 d)

Recent Activity

Fri, Jan 24

balazske added a child revision for D73350: Small StreamChecker refactoring (NFC).: D73359: [clang][checkers]StreamChecker refactoring (NFC)..
Fri, Jan 24, 8:15 AM · Restricted Project
balazske added a parent revision for D73359: [clang][checkers]StreamChecker refactoring (NFC).: D73350: Small StreamChecker refactoring (NFC)..
Fri, Jan 24, 8:15 AM · Restricted Project
balazske created D73359: [clang][checkers]StreamChecker refactoring (NFC)..
Fri, Jan 24, 8:13 AM · Restricted Project
balazske created D73350: Small StreamChecker refactoring (NFC)..
Fri, Jan 24, 6:59 AM · Restricted Project
balazske added a comment to D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..

I am still unsure about how this checker works if the function to check is "modeled" or evaluated by another checker. Then the function may have already a constrained value at the PostCall event (for example if a malloc fails) and the basic idea of this checker that the constraints on the return value indicate the checks that the program makes does not work. So it may be better to check for the initial constraint somehow and if found ignore that function. Or create a new state where the function call's value is not constrained.

Fri, Jan 24, 2:42 AM · Restricted Project
balazske updated the diff for D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..

Using check::DeadSymbols.

Fri, Jan 24, 12:13 AM · Restricted Project

Thu, Jan 23

balazske updated the diff for D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..

Added garbage collection and better problem detection.

Thu, Jan 23, 7:07 AM · Restricted Project
balazske updated the diff for D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..

Small bugfixes, added some tests.

Thu, Jan 23, 6:03 AM · Restricted Project

Mon, Jan 20

balazske added a reviewer for D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.: baloghadamsoftware.
Mon, Jan 20, 1:58 AM · Restricted Project

Fri, Jan 17

balazske updated the diff for D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..

A better (?) implementation.

Fri, Jan 17, 8:05 AM · Restricted Project

Thu, Jan 16

balazske added a comment to D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..

I am experimenting with somewhat other check algorithm for this problem, the review of this code can be suspended for now.

Thu, Jan 16, 8:38 AM · Restricted Project

Tue, Jan 14

balazske added reviewers for D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'.: NoQ, gamesh411.
Tue, Jan 14, 8:02 AM · Restricted Project
balazske added a comment to D71510: [clang][checkers] Added new checker 'error-return-checker'..

Smaller diff with first part:
https://reviews.llvm.org/D72705

Tue, Jan 14, 8:02 AM · Restricted Project
balazske created D72705: [clang][checkers] Added new checker 'alpha.unix.ErrorReturn'..
Tue, Jan 14, 7:52 AM · Restricted Project
balazske added a comment to D71510: [clang][checkers] Added new checker 'error-return-checker'..

I wanted to implement the rules described here:
https://wiki.sei.cmu.edu/confluence/display/c/ERR33-C.+Detect+and+handle+standard+library+errors
This lists the functions to check so this knowledge has to be built into the checker and there are examples of this in other checkers (stream or memory or string functions for example). The functions have different kinds conditions on the return value in case of error. It is not sufficient to simply check that the return value is assigned to something or used because it may be used without check for error. So I tried to do something that can find if exactly a check for the error condition was made. (Still it is not perfect because the value can be used before the error checking.)
The cast to void is the special way to avoid the warning, in every other case the return value has to be checked for error or there is an exception that should be documented (if the function "can not fail" or the error does not matter). This may be too much warnings for a normal project but acceptable if extra safe code is needed. If we want to have that clang SA can (at least partially) check for that rule "ERR33-C" this (or similar) check is needed.

Tue, Jan 14, 2:09 AM · Restricted Project
balazske added a comment to D71510: [clang][checkers] Added new checker 'error-return-checker'..

The checker was implemented in smaller parts that are visible in the commit list. I can split the patch at the commits (and figure out how to use git history manipulations and phabricator in a better way?).

Tue, Jan 14, 1:51 AM · Restricted Project

Mon, Jan 13

balazske updated the diff for D71510: [clang][checkers] Added new checker 'error-return-checker'..
  • Improved function list format in documentation.
Mon, Jan 13, 7:53 AM · Restricted Project

Fri, Jan 10

balazske added a reviewer for D71510: [clang][checkers] Added new checker 'error-return-checker'.: NoQ.

Checker was tested with tmux, no problems found (there are false positives but not easy to fix).

Fri, Jan 10, 2:47 AM · Restricted Project

Thu, Jan 9

balazske updated the diff for D71510: [clang][checkers] Added new checker 'error-return-checker'..
  • More fixes in test files.
Thu, Jan 9, 6:46 AM · Restricted Project
balazske retitled D71510: [clang][checkers] Added new checker 'error-return-checker'. from [clang][checkers] Added new checker 'error-return-checker'. (WIP) to [clang][checkers] Added new checker 'error-return-checker'..
Thu, Jan 9, 6:37 AM · Restricted Project
balazske updated the diff for D71510: [clang][checkers] Added new checker 'error-return-checker'..
  • Prevent warning if call is in a return statement.
  • Prevent warning if call is casted to void.
  • Added documentation.
  • Fixed the tests.
  • Some other fixes.
Thu, Jan 9, 6:27 AM · Restricted Project

Tue, Jan 7

balazske added inline comments to D71510: [clang][checkers] Added new checker 'error-return-checker'..
Tue, Jan 7, 12:08 AM · Restricted Project

Mon, Jan 6

balazske updated the diff for D71510: [clang][checkers] Added new checker 'error-return-checker'..
  • Added variadic functions, improved comments.
Mon, Jan 6, 6:23 AM · Restricted Project
balazske added inline comments to D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc).
Mon, Jan 6, 3:12 AM · Restricted Project

Fri, Jan 3

balazske added a comment to D71510: [clang][checkers] Added new checker 'error-return-checker'..

Works relatively good now but not perfect. The tests are sometimes too strict so there are some false positives, for example this case:

unsigned long X = strtoul("345", NULL, 10);
if (X > 100) {
 // handle error
}

The result is not checked for ULONG_MAX but still the code is correct in this way. But we can not figure out the intention of the programmer to detect what is an "error handling code" to check for error handling branches. Other solution is to detect any branch condition that involves the value (returned from the function) as a "test for error return value" but this is probably not better.

Fri, Jan 3, 8:32 AM · Restricted Project
balazske updated the diff for D71510: [clang][checkers] Added new checker 'error-return-checker'..
  • Implemented all (now possible) functions.
  • Moved ParmVal value to own state map.
  • Improved state data and bug reporting.
Fri, Jan 3, 8:21 AM · Restricted Project

Dec 19 2019

balazske added reviewers for D71510: [clang][checkers] Added new checker 'error-return-checker'.: baloghadamsoftware, Szelethus.
Dec 19 2019, 8:43 AM · Restricted Project
balazske updated the diff for D71510: [clang][checkers] Added new checker 'error-return-checker'..

Adding a new diff over the previous one.
(The commit was amended accidentally.)

Dec 19 2019, 8:41 AM · Restricted Project

Dec 14 2019

balazske added a comment to D71510: [clang][checkers] Added new checker 'error-return-checker'..

Code is to be reformatted later.

Dec 14 2019, 2:45 AM · Restricted Project
balazske created D71510: [clang][checkers] Added new checker 'error-return-checker'..
Dec 14 2019, 2:27 AM · Restricted Project

Dec 6 2019

balazske added a comment to D60499: [ASTImporter] Various source location and range import fixes..

The fix looks OK (other alternative is to remove the CHECK with CXXRecordDecl, or make a single line with regular expressions).

Dec 6 2019, 2:00 AM · Restricted Project

Dec 5 2019

balazske committed rGa9f10ebffaa2: [ASTImporter] Various source location and range import fixes. (authored by balazske).
[ASTImporter] Various source location and range import fixes.
Dec 5 2019, 8:46 AM
balazske closed D60499: [ASTImporter] Various source location and range import fixes..
Dec 5 2019, 8:46 AM · Restricted Project
balazske committed rG7eafde981c69: [Checkers] Added support for freopen to StreamChecker. (authored by balazske).
[Checkers] Added support for freopen to StreamChecker.
Dec 5 2019, 2:12 AM
balazske closed D69948: [Checkers] Added support for freopen to StreamChecker..
Dec 5 2019, 2:11 AM · Restricted Project

Dec 4 2019

balazske added inline comments to D71018: [ASTImporter] Improved import of TypeSourceInfo (TypeLoc).
Dec 4 2019, 8:27 AM · Restricted Project
balazske updated the diff for D60499: [ASTImporter] Various source location and range import fixes..

Rebased to monorepo and newer master.

Dec 4 2019, 5:38 AM · Restricted Project

Dec 3 2019

balazske added inline comments to D69948: [Checkers] Added support for freopen to StreamChecker..
Dec 3 2019, 7:18 AM · Restricted Project
balazske updated the diff for D69948: [Checkers] Added support for freopen to StreamChecker..
  • rearrangement in evelFreopen, updated comment in test
Dec 3 2019, 7:09 AM · Restricted Project

Nov 20 2019

balazske added inline comments to D69948: [Checkers] Added support for freopen to StreamChecker..
Nov 20 2019, 2:06 AM · Restricted Project

Nov 19 2019

balazske added inline comments to D69948: [Checkers] Added support for freopen to StreamChecker..
Nov 19 2019, 8:15 AM · Restricted Project
balazske updated the diff for D69948: [Checkers] Added support for freopen to StreamChecker..
  • Moved freopen after fopen, removed 'SValBuilder'.
Nov 19 2019, 8:06 AM · Restricted Project
balazske committed rGc9b87981d20a: [clang-tidy] DefaultOperatorNewCheck test fixes. (authored by balazske).
[clang-tidy] DefaultOperatorNewCheck test fixes.
Nov 19 2019, 6:26 AM
balazske committed rGe8a4c74f1157: [clang-tidy] Added DefaultOperatorNewCheck. (authored by balazske).
[clang-tidy] Added DefaultOperatorNewCheck.
Nov 19 2019, 2:43 AM
balazske closed D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Nov 19 2019, 2:43 AM · Restricted Project

Nov 18 2019

balazske added a comment to D67545: [clang-tidy] Added DefaultOperatorNewCheck..

Ping. It should be accepted before I can land it.

Nov 18 2019, 3:24 AM · Restricted Project

Nov 15 2019

balazske committed rGc2f6efc732ef: [Clang][ASTImporter] Added visibility check for ClassTemplateDecl. (authored by balazske).
[Clang][ASTImporter] Added visibility check for ClassTemplateDecl.
Nov 15 2019, 6:13 AM
balazske closed D67543: [Clang][ASTImporter] Added visibility check for ClassTemplateDecl..
Nov 15 2019, 6:13 AM · Restricted Project

Nov 14 2019

balazske added inline comments to D69948: [Checkers] Added support for freopen to StreamChecker..
Nov 14 2019, 4:10 AM · Restricted Project
balazske updated the diff for D69948: [Checkers] Added support for freopen to StreamChecker..
  • Simplified the code.
Nov 14 2019, 4:01 AM · Restricted Project

Nov 8 2019

balazske added a comment to D69948: [Checkers] Added support for freopen to StreamChecker..

I am still not sure in the auto type, I did not see that way of auto usage often in clang code.

Nov 8 2019, 5:59 AM · Restricted Project
balazske updated the diff for D69948: [Checkers] Added support for freopen to StreamChecker..
  • Do not allow null stream to freopen.
  • Added comments.
Nov 8 2019, 5:47 AM · Restricted Project
balazske added a comment to D69948: [Checkers] Added support for freopen to StreamChecker..

From the description The original stream (if it exists) is closed. I think it is possible that the original stream does "not exist". But a test program crashed with NULL argument (but not with a closed file). So null argument is not permitted or at least does not work always.

Nov 8 2019, 1:25 AM · Restricted Project

Nov 7 2019

balazske added reviewers for D69948: [Checkers] Added support for freopen to StreamChecker.: NoQ, baloghadamsoftware, Szelethus.
Nov 7 2019, 8:00 AM · Restricted Project
balazske created D69948: [Checkers] Added support for freopen to StreamChecker..
Nov 7 2019, 7:23 AM · Restricted Project
balazske added a comment to D69662: [Checkers] Avoid using evalCall in StreamChecker..

I removed the previous comment because I realized that StdCLibraryFunctionsChecker does not use evalCall for fread (returns false because "non-pure" evaluation).

Nov 7 2019, 12:50 AM · Restricted Project

Nov 5 2019

balazske added a comment to D69662: [Checkers] Avoid using evalCall in StreamChecker..
Nov 5 2019, 1:30 AM · Restricted Project

Nov 4 2019

balazske added a comment to D69662: [Checkers] Avoid using evalCall in StreamChecker..

From the same book:

There are multiple preconditions required for inlining to happen, including:
— Source code of the callee function body needs to be available;
— No checker should evaluate the function call via eval::Call;

Abandon this change?

Nov 4 2019, 7:19 AM · Restricted Project
balazske added a comment to D69662: [Checkers] Avoid using evalCall in StreamChecker..

I wanted to remove eval::Call because only one checker can do this otherwise it is undefined behavior (according to the not very new "Analyzer Guide"). If it is essentially needed in this checker it will remain.

Nov 4 2019, 1:09 AM · Restricted Project

Oct 31 2019

balazske added reviewers for D69662: [Checkers] Avoid using evalCall in StreamChecker.: NoQ, Charusso, Szelethus.
Oct 31 2019, 8:09 AM · Restricted Project
balazske created D69662: [Checkers] Avoid using evalCall in StreamChecker..
Oct 31 2019, 8:09 AM · Restricted Project
balazske committed rG4980c1333fa4: [clang][analyzer] Using CallDescription in StreamChecker. (authored by balazske).
[clang][analyzer] Using CallDescription in StreamChecker.
Oct 31 2019, 4:40 AM
balazske closed D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Oct 31 2019, 4:40 AM · Restricted Project

Oct 30 2019

balazske added inline comments to D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Oct 30 2019, 8:24 AM · Restricted Project
balazske updated the diff for D67706: [clang][analyzer] Using CallDescription in StreamChecker..
  • Redesign again.
Oct 30 2019, 7:37 AM · Restricted Project

Oct 29 2019

balazske added a reviewer for D67706: [clang][analyzer] Using CallDescription in StreamChecker.: baloghadamsoftware.
Oct 29 2019, 4:05 AM · Restricted Project
balazske added a comment to D67706: [clang][analyzer] Using CallDescription in StreamChecker..

Ping again

Oct 29 2019, 4:05 AM · Restricted Project

Oct 24 2019

balazske updated the diff for D67545: [clang-tidy] Added DefaultOperatorNewCheck..
  • Improved check for C++17.
Oct 24 2019, 1:22 AM · Restricted Project

Oct 21 2019

balazske added a comment to D67543: [Clang][ASTImporter] Added visibility check for ClassTemplateDecl..

Ping

Oct 21 2019, 1:47 AM · Restricted Project

Oct 18 2019

balazske updated the diff for D67545: [clang-tidy] Added DefaultOperatorNewCheck..
  • Fixes from review comments, added C++ version test.
Oct 18 2019, 8:00 AM · Restricted Project

Oct 11 2019

balazske added inline comments to D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Oct 11 2019, 8:51 AM · Restricted Project
balazske added a comment to D67706: [clang][analyzer] Using CallDescription in StreamChecker..

Ping

Oct 11 2019, 7:27 AM · Restricted Project

Oct 10 2019

balazske committed rL374368: Request commit access for balazske.
Request commit access for balazske
Oct 10 2019, 8:33 AM

Oct 2 2019

balazske updated the diff for D67706: [clang][analyzer] Using CallDescription in StreamChecker..
  • Re-design of eval functions.
  • Added a C++ test with fopen-looking function.
Oct 2 2019, 3:40 AM · Restricted Project

Oct 1 2019

balazske added inline comments to D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Oct 1 2019, 7:59 AM · Restricted Project
balazske added inline comments to D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Oct 1 2019, 6:29 AM · Restricted Project
balazske updated the diff for D67706: [clang][analyzer] Using CallDescription in StreamChecker..
  • Various code cleanups. Eval functions use CallEvent, CallExpr is removed from state.
Oct 1 2019, 2:26 AM · Restricted Project

Sep 30 2019

balazske added inline comments to D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Sep 30 2019, 3:58 AM · Restricted Project

Sep 27 2019

balazske updated the diff for D67545: [clang-tidy] Added DefaultOperatorNewCheck..
  • Rename to DefaultOperatorNewAlignmentCheck.
Sep 27 2019, 6:21 AM · Restricted Project
balazske updated the diff for D67706: [clang][analyzer] Using CallDescription in StreamChecker..

Using CallDescriptionMap.

Sep 27 2019, 5:16 AM · Restricted Project

Sep 18 2019

balazske added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Sep 18 2019, 7:49 AM · Restricted Project
balazske created D67706: [clang][analyzer] Using CallDescription in StreamChecker..
Sep 18 2019, 6:50 AM · Restricted Project
balazske abandoned D67480: [analyzer] Add 'freopen' support to SimpleStreamChecker..

I try to improve StreamChecker instead.

Sep 18 2019, 2:49 AM · Restricted Project
balazske updated the diff for D67545: [clang-tidy] Added DefaultOperatorNewCheck..

Fixed the test, fixed problems in list.rst.

Sep 18 2019, 2:15 AM · Restricted Project
balazske updated the diff for D67545: [clang-tidy] Added DefaultOperatorNewCheck..

Rebase and update according to comments.
C++17 related changes not implemented yet (possible check for the called allocation function).

Sep 18 2019, 2:03 AM · Restricted Project

Sep 17 2019

balazske added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Sep 17 2019, 8:01 AM · Restricted Project
balazske accepted D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Sep 17 2019, 7:10 AM · Restricted Project, Restricted Project
balazske added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Sep 17 2019, 2:03 AM · Restricted Project
balazske added inline comments to D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Sep 17 2019, 1:08 AM · Restricted Project

Sep 16 2019

balazske added a comment to D67545: [clang-tidy] Added DefaultOperatorNewCheck..

C++17 makes things more difficult because the align is probably handled by operator new, probably not, depending on the defined allocation functions. This can be observed only with a non clang-tidy checker (we could compute the used alignment?). Probably the CERT rule is from the time before C++17. It looks like that by default the alignment is handled correctly in C++17 so the whole check is out of scope for that language version.

Sep 16 2019, 11:53 PM · Restricted Project
balazske added inline comments to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.
Sep 16 2019, 12:54 AM · Restricted Project, Restricted Project

Sep 13 2019

balazske created D67545: [clang-tidy] Added DefaultOperatorNewCheck..
Sep 13 2019, 4:04 AM · Restricted Project
Herald added a reviewer for D67543: [Clang][ASTImporter] Added visibility check for ClassTemplateDecl.: a.sidorin.
Sep 13 2019, 3:37 AM · Restricted Project
balazske committed rGf8a89c8fa7fe: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl. (authored by balazske).
[Clang][ASTImporter] Added visibility check for FunctionTemplateDecl.
Sep 13 2019, 1:05 AM
balazske committed rL371820: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl..
[Clang][ASTImporter] Added visibility check for FunctionTemplateDecl.
Sep 13 2019, 1:04 AM
balazske closed D67490: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl..
Sep 13 2019, 1:04 AM · Restricted Project, Restricted Project
balazske added a comment to D67480: [analyzer] Add 'freopen' support to SimpleStreamChecker..

Code of StreamChecker does not look much better, it uses deprecated eval::Call and does not check for escape. But it handles more functions and error at open (still not freopen). A mixture of both would be a better option.

Sep 13 2019, 12:12 AM · Restricted Project

Sep 12 2019

Herald added a reviewer for D67490: [Clang][ASTImporter] Added visibility check for FunctionTemplateDecl.: a.sidorin.
Sep 12 2019, 3:55 AM · Restricted Project, Restricted Project

Sep 11 2019

balazske created D67480: [analyzer] Add 'freopen' support to SimpleStreamChecker..
Sep 11 2019, 11:51 PM · Restricted Project

Sep 6 2019

balazske added a comment to D66951: [ASTImporter] Add comprehensive tests for ODR violation handling strategies.

OK
Probably the ClassTemplateSpec can not be handled in liberal way because the AST data structure for template specializations do not allow multiple instances with same argument values?

Sep 6 2019, 7:25 AM · Restricted Project, Restricted Project