Page MenuHomePhabricator

xazax.hun (Gábor Horváth)
User

Projects

User does not belong to any projects.

User Details

User Since
Sep 17 2012, 3:16 AM (505 w, 5 d)

Recent Activity

Thu, May 26

xazax.hun accepted D126420: [clang][dataflow] Remove private-field filtering from `StorageLocation` creation..
Thu, May 26, 9:00 AM · Restricted Project, Restricted Project

Tue, May 24

xazax.hun accepted D126314: [clang][dataflow] Relax `Environment` comparison operation..
Tue, May 24, 1:08 PM · Restricted Project, Restricted Project
xazax.hun accepted D126316: [clang][dataflow] Make limit on fixpoint-algorithm iterations proportional to size of CFG..
Tue, May 24, 12:36 PM · Restricted Project, Restricted Project
xazax.hun added a comment to D126316: [clang][dataflow] Make limit on fixpoint-algorithm iterations proportional to size of CFG..

An alternative approach is to maintain separate counters for back edges and bail if those reach a certain limit. But this global limit is way simpler, so it looks good to me.

Tue, May 24, 12:24 PM · Restricted Project, Restricted Project

Mon, May 23

xazax.hun added a comment to D126198: [analyzer][NFCi] Annotate major nonnull returning functions.

I prefer references to annotations, but this is also a step in the right direction :l

Mon, May 23, 7:39 AM · Restricted Project, Restricted Project

Fri, May 20

xazax.hun added a comment to D125931: [clang][dataflow] Add support for correlated branches to optional model.
  1. In this patch, we go with a widening operation, but put the relevant logic in the core, so it can be reused for booleans in general.
Fri, May 20, 7:24 AM · Restricted Project, Restricted Project

Thu, May 19

xazax.hun added a comment to D125931: [clang][dataflow] Add support for correlated branches to optional model.

Actually, I think in most cases we want to consistent how to merge bool values. So I wonder whether instead of reimplementing the merge operation in this check we should just call a function that does the work. And the same function should be used within the engine to merge states after if statements and so on.

Thu, May 19, 11:28 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D125931: [clang][dataflow] Add support for correlated branches to optional model.
Thu, May 19, 9:16 AM · Restricted Project, Restricted Project

Tue, May 17

xazax.hun accepted D125706: [analyzer][NFC] Use idiomatic classof instead of isKind.
Tue, May 17, 10:19 AM · Restricted Project, Restricted Project
xazax.hun accepted D125707: [analyzer][NFC] Remove unused friend SVal declarations.
Tue, May 17, 10:17 AM · Restricted Project, Restricted Project
xazax.hun accepted D125708: [analyzer][NFC] Remove unused default SVal constructors.
Tue, May 17, 10:17 AM · Restricted Project, Restricted Project
xazax.hun added a comment to D125709: [analyzer][Casting] Support isa, cast, dyn_cast of SVals.

While not having tests might be OK, but I'd prefer to introduce at least a couple uses of the new facilities so existing tests cover them.

Tue, May 17, 10:14 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D125749: [analyzer][NFC] Introduce SVal::isa<Ts...>.
Tue, May 17, 10:02 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Tue, May 17, 9:02 AM · Restricted Project, Restricted Project
xazax.hun accepted D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Tue, May 17, 9:00 AM · Restricted Project, Restricted Project

Fri, May 13

xazax.hun added inline comments to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Fri, May 13, 8:38 AM · Restricted Project, Restricted Project

Wed, May 11

xazax.hun accepted D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.

Overall looks good to me. I wish some parts would be simpler but it looks like sometimes it is not easy to extend the current code and we might need to do some refactoring at some point.

Wed, May 11, 10:08 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Wed, May 11, 9:56 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Wed, May 11, 9:51 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Wed, May 11, 9:49 AM · Restricted Project, Restricted Project

Fri, May 6

xazax.hun accepted D123685: [clang][ASTImporter] Add isNewDecl.

Thanks, this looks good to me!

Fri, May 6, 11:54 AM · Restricted Project, Restricted Project
xazax.hun added a comment to D123784: [clang][analyzer][ctu] Traverse the ctu CallEnter nodes in reverse order.

This approach fixes the worklist for the second phase. Would it be possible to create a wrapper that reverses the order of any worklist instead of committing to one and hardcode that?

Fri, May 6, 9:12 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.
Fri, May 6, 9:08 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123685: [clang][ASTImporter] Add isNewDecl.
Fri, May 6, 8:40 AM · Restricted Project, Restricted Project
xazax.hun added a comment to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..

Just realized we left this open. How about a disclaimer at the top of the doc (.rst) file noting the potential cost? Anyone using clang-tidy should be explicitly configuring which checks to run, so that may be sufficient. If we want to allow users to enable/disable flow-sensitive checks across the board, though, it seems like we would need to add a new option to ClangTidyOptions (https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-tidy/ClangTidyOptions.h#L50).

Fri, May 6, 7:38 AM · Restricted Project, Restricted Project, Restricted Project

Thu, May 5

xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 4:27 PM · Restricted Project, Restricted Project, Restricted Project
xazax.hun accepted D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..

It looks like all of my comments are resolved now, thanks!

Thu, May 5, 1:43 PM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 1:21 PM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 1:19 PM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 11:58 AM · Restricted Project, Restricted Project, Restricted Project
xazax.hun accepted D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..

Overall this looks good to me. However, I think this might not use the full potential of the check itself. With the information that the dataflow framework have it could distinguish between potentially unsafe accesses and provably unsafe accesses depending on whether the has_value property is constrained to be false. From the user point of view, it would be nice to emit different warning messages for the above two cases. This can help to gradually introduce this check to a larger codebase and focus on the higher severity diagnostics first.

Thu, May 5, 10:30 AM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 10:14 AM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 10:13 AM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added inline comments to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..
Thu, May 5, 8:51 AM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added a comment to D121120: [clang-tidy] New check for safe usage of `std::optional` and like types..

Most checks in Clang Tidy will run relatively quickly as they usually can do most/all of their work in a single traversal. I wonder whether flow sensitive checks will prove to be a bit slower. I think adding slower checks to Tidy is fine, but it would be nice to properly set the expectations to the user (e.g. if an IDE is running Tidy in the background it might want to opt out from flow sensitive checks if they turn out to be slow). In case the performance is good, I think it should be fine as is. Otherwise I wonder if we want to add something like a tag to mark flow sensitive checks and give an option to turn them off.

Thu, May 5, 8:31 AM · Restricted Project, Restricted Project, Restricted Project
xazax.hun added a comment to D124932: [clang][dataflow] Track `optional` contents in `optional` model..

Thanks for the clarifications!

Thu, May 5, 8:26 AM · Restricted Project, Restricted Project
xazax.hun accepted D124932: [clang][dataflow] Track `optional` contents in `optional` model..
Thu, May 5, 8:24 AM · Restricted Project, Restricted Project

Wed, May 4

xazax.hun accepted D124943: [clang][dataflow] Add flowConditionIsTautology function.

The code looks good to me too. I was also wondering what sort of check will need this info.

Wed, May 4, 3:50 PM · Restricted Project, Restricted Project
xazax.hun added a comment to D124932: [clang][dataflow] Track `optional` contents in `optional` model..

Overall looks good to me. I am curious what will the strategy be to properly support construction. Do you plan to introduce a customization point to Env.createValue to give checks/models a way to set properties up? Or do you have something else in mind?

Wed, May 4, 3:26 PM · Restricted Project, Restricted Project

Tue, May 3

xazax.hun accepted D124807: [clang][dataflow] Only skip ExprWithCleanups when visiting terminators.
Tue, May 3, 2:26 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D124807: [clang][dataflow] Only skip ExprWithCleanups when visiting terminators.
Tue, May 3, 9:40 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D120495: [clang][dataflow] Add transfer functions for structured bindings.
Tue, May 3, 9:33 AM · Restricted Project, Restricted Project

Fri, Apr 29

xazax.hun accepted D124395: [clang][dataflow] Optimize flow condition representation.
Fri, Apr 29, 8:09 AM · Restricted Project, Restricted Project

Apr 27 2022

xazax.hun accepted D124540: [clang][dataflow] Perform structural comparison of indirection values in `join`..
Apr 27 2022, 10:41 AM · Restricted Project, Restricted Project

Apr 25 2022

xazax.hun added a comment to D124395: [clang][dataflow] Optimize flow condition representation.

Nice! Did you do some measurements? Does this improve the performance or decrease the memory consumption?

Apr 25 2022, 2:01 PM · Restricted Project, Restricted Project

Apr 22 2022

xazax.hun accepted D124239: [analyzer] Fix ValistChecker false-positive involving symbolic pointers.
Apr 22 2022, 6:21 AM · Restricted Project, Restricted Project

Apr 20 2022

xazax.hun accepted D124104: [clang][dataflow] Fix `Environment::join`'s handling of flow condition merging.
Apr 20 2022, 12:52 PM · Restricted Project, Restricted Project

Apr 19 2022

xazax.hun accepted D123858: [clang][dataflow] Ensure well-formed flow conditions..
Apr 19 2022, 11:18 AM · Restricted Project, Restricted Project
xazax.hun accepted D123961: [clang][dataflow] Do not crash on missing `Value` for struct-typed variable init..
Apr 19 2022, 9:02 AM · Restricted Project, Restricted Project

Apr 14 2022

xazax.hun added a comment to D123773: [clang][analyzer][ctu] Make CTU a two phase analysis.

> Make CTU a two phase analysis

Apr 14 2022, 8:55 AM · Restricted Project, Restricted Project

Apr 13 2022

xazax.hun added a comment to D123586: [clang][dataflow] Weaken abstract comparison to enable loop termination..

Yeah, this is a hard problem in general. This looks like a sensible workaround for the short term, but I'm looking forward to a better solution. I'm a bit worried that the memory model will need some upgrades to properly solve this problem.

Thanks for the quick review! Yes, I have my concerns as well. It seems like some amount of a) additional allocation stabilization/memoization, b) introduction of explicit widening operator and c) structural comparison will fully solve the problem. Solving this properly is a high priority.

Apr 13 2022, 12:23 PM · Restricted Project, Restricted Project

Apr 12 2022

xazax.hun accepted D123586: [clang][dataflow] Weaken abstract comparison to enable loop termination..

Yeah, this is a hard problem in general. This looks like a sensible workaround for the short term, but I'm looking forward to a better solution. I'm a bit worried that the memory model will need some upgrades to properly solve this problem.

Apr 12 2022, 4:16 PM · Restricted Project, Restricted Project

Apr 7 2022

xazax.hun added inline comments to D111548: [Clang] Add the `annotate_type` attribute.
Apr 7 2022, 9:00 AM · Restricted Project, Restricted Project

Apr 5 2022

xazax.hun accepted D123155: [analyzer] Expose Taint.h to plugins.

The changes look good to me but please wait at least one more reviewer before committing.

Apr 5 2022, 4:02 PM · Restricted Project, Restricted Project
xazax.hun added reviewers for D123155: [analyzer] Expose Taint.h to plugins: NoQ, steakhal, Szelethus, martong, xazax.hun.

Adding some reviewers

Apr 5 2022, 3:58 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123032: [clang][dataflow] Exclude protobuf types from modeling in the environment..
Apr 5 2022, 9:03 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123032: [clang][dataflow] Exclude protobuf types from modeling in the environment..
Apr 5 2022, 9:01 AM · Restricted Project, Restricted Project

Apr 4 2022

xazax.hun accepted D123037: [clang][dataflow] Support integral casts.
Apr 4 2022, 3:06 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D123032: [clang][dataflow] Exclude protobuf types from modeling in the environment..
Apr 4 2022, 3:02 PM · Restricted Project, Restricted Project

Apr 1 2022

xazax.hun accepted D122908: [clang][dataflow] Add support for clang's `__builtin_expect`..

Speaking of builtins, it might be great to add tests for __builtin_unreachable, __builtin_trap, __builtin_debugtrap. The CFG might already have the right shape so we might not need to add any code to support them. But it would be nice to know :) Maybe we could even add a comment to VisitCallExpr why those wouldn't need explicit support.

Apr 1 2022, 9:08 AM · Restricted Project, Restricted Project
xazax.hun accepted D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values.
Apr 1 2022, 8:00 AM · Restricted Project, Restricted Project

Mar 31 2022

xazax.hun added inline comments to D122838: [clang][dataflow] Add support for correlation of boolean (tracked) values.
Mar 31 2022, 1:26 PM · Restricted Project, Restricted Project
xazax.hun accepted D122273: [clang][dataflow] Fix handling of base-class fields.
Mar 31 2022, 9:36 AM · Restricted Project, Restricted Project
xazax.hun accepted D122830: [clang][dataflow] Add support for (built-in) (in)equality operators.
Mar 31 2022, 9:23 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D122273: [clang][dataflow] Fix handling of base-class fields.
Mar 31 2022, 8:20 AM · Restricted Project, Restricted Project

Mar 29 2022

xazax.hun accepted D122231: [clang][dataflow] Add support for `value_or` in a comparison..

Wow. This did take some iterations and I feel like I just added to the confusion at some point :D But the latest iteration looks much simpler and I'm confident it is right this time. Thanks!

Mar 29 2022, 8:27 AM · Restricted Project, Restricted Project

Mar 25 2022

xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 25 2022, 1:23 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 25 2022, 1:02 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 25 2022, 12:56 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 25 2022, 12:54 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 25 2022, 12:50 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 25 2022, 11:33 AM · Restricted Project, Restricted Project

Mar 23 2022

xazax.hun added inline comments to D122231: [clang][dataflow] Add support for `value_or` in a comparison..
Mar 23 2022, 9:28 AM · Restricted Project, Restricted Project

Mar 21 2022

xazax.hun added inline comments to D122143: [clang][dataflow] Add support for disabling warnings on smart pointers..
Mar 21 2022, 9:23 AM · Restricted Project, Restricted Project
xazax.hun added a comment to D122143: [clang][dataflow] Add support for disabling warnings on smart pointers..

So, do you mean to add a FIXME to move to allowlist, or do you mean to hold off until we've switched? I have a short-term interest in getting this through for a particular usecase, but I understand if you feel it just not a good idea. Regardless, I'm going to get started exploring an allowlist approach.

Mar 21 2022, 9:12 AM · Restricted Project, Restricted Project
xazax.hun accepted D122121: [clang][dataflow] Add action caching support to MatchSwitch.

Thanks! Did you have a chance whether this makes a difference in real world scenarios? I'm mostly curious because I do not have a good mental model of how the matchers are implemented, specifically what optimizations are in place, so I don't really know how much of an impact can caching make :)

Mar 21 2022, 8:59 AM · Restricted Project, Restricted Project
xazax.hun added a comment to D122143: [clang][dataflow] Add support for disabling warnings on smart pointers..

Are smart pointers special? I would expect to see similar problems with containers (or even a nested optional). I wonder whether an allowlist instead of a denylist approach is better here. E.g., instead of disabling the modeling for smart pointers, we could enable it for cases that we actually support (or alternatively, we could add a confidence value to the unsafe access). Usually, these checks are pretty robust when we deal with objects on the stack of the analyzed function (locals, parameters), but it is really hard to reason about objects from the outside (e.g., when a reference to an object is acquired from a container or smart pointer) unless we have explicit modeling for the APIs. The confidence approach might be useful as we are unlikely to cover all the custom smart pointers the users have.

Mar 21 2022, 8:36 AM · Restricted Project, Restricted Project
xazax.hun accepted D122129: [clang][dataflow] Model the behavior of optional and std swap.
Mar 21 2022, 8:28 AM · Restricted Project, Restricted Project

Mar 18 2022

xazax.hun added inline comments to D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality.
Mar 18 2022, 9:46 AM · Restricted Project, Restricted Project

Mar 17 2022

xazax.hun accepted D121863: [clang][dataflow] Model the behavior of non-standard optional assignment.
Mar 17 2022, 9:03 AM · Restricted Project, Restricted Project

Mar 16 2022

xazax.hun added inline comments to D121863: [clang][dataflow] Model the behavior of non-standard optional assignment.
Mar 16 2022, 3:43 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality.
Mar 16 2022, 3:23 PM · Restricted Project, Restricted Project
xazax.hun accepted D121797: [clang][dataflow] Add modeling of Chromium's CHECK functionality.
Mar 16 2022, 12:49 PM · Restricted Project, Restricted Project
xazax.hun accepted D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components..

Thanks!

Mar 16 2022, 12:39 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D121796: [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components..
Mar 16 2022, 8:45 AM · Restricted Project, Restricted Project

Mar 15 2022

xazax.hun added a comment to D121694: [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators.

The change itself looks good. But out of curiosity, could you give me an example when we do not want to use the builtin transfer functions?

Sure! Pretty much any plain-vanilla dataflow analysis that sticks to its own lattice and doesn't care about the environment. The demo constant-propagation analyses are like this, but we have additional real analyses using the framework in this way. Examples include an analysis to detect raw pointers that could be unique pointers and one that detects missed opportunies to use std::move.

Mar 15 2022, 8:23 AM · Restricted Project, Restricted Project
xazax.hun accepted D121694: [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators.

The change itself looks good. But out of curiosity, could you give me an example when we do not want to use the builtin transfer functions?

Mar 15 2022, 7:45 AM · Restricted Project, Restricted Project

Mar 14 2022

xazax.hun added inline comments to D121602: [clang][dataflow] Model the behavior of non-standard optional constructors.
Mar 14 2022, 12:10 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D121602: [clang][dataflow] Model the behavior of non-standard optional constructors.
Mar 14 2022, 12:08 PM · Restricted Project, Restricted Project
xazax.hun accepted D121602: [clang][dataflow] Model the behavior of non-standard optional constructors.
Mar 14 2022, 12:06 PM · Restricted Project, Restricted Project
xazax.hun added inline comments to D121602: [clang][dataflow] Model the behavior of non-standard optional constructors.
Mar 14 2022, 9:13 AM · Restricted Project, Restricted Project
xazax.hun accepted D121455: [clang][dataflow] Add support for nested composite bool expressions.
Mar 14 2022, 8:54 AM · Restricted Project, Restricted Project
xazax.hun added inline comments to D121455: [clang][dataflow] Add support for nested composite bool expressions.
Mar 14 2022, 8:19 AM · Restricted Project, Restricted Project

Mar 11 2022

xazax.hun added inline comments to D121455: [clang][dataflow] Add support for nested composite bool expressions.
Mar 11 2022, 9:21 AM · Restricted Project, Restricted Project

Mar 10 2022

xazax.hun accepted D121378: [clang][dataflow] Model the behavior of various optional members.

Thanks!

Mar 10 2022, 8:41 AM · Restricted Project, Restricted Project

Mar 8 2022

xazax.hun accepted D121197: [clang][dataflow] Add analysis that detects unsafe accesses to optionals.
Mar 8 2022, 4:41 PM · Restricted Project, Restricted Project
xazax.hun added a comment to D120992: [analyzer] ReverseNull: New checker to warn for pointer value conditions, if the pointer value is unconditionally non-null.

I guess there's the usual direction that I occasionally suggest: develop a way to verify that all possible paths were explored during symbolic execution (CoreEngine::hasWorkRemaining() on steroids), then do most of the work in checkEndAnalysis.

Mar 8 2022, 1:47 PM · Restricted Project, Restricted Project

Mar 7 2022

xazax.hun accepted D121158: [clang][dataflow] Fix nullptr dereferencing error..

Wonderful, thanks!

Mar 7 2022, 6:30 PM · Restricted Project, Restricted Project
xazax.hun added a comment to D121158: [clang][dataflow] Fix nullptr dereferencing error..

When pre-initializing fields in the environment, the code assumed that all fields of a struct would be initialized

Mar 7 2022, 1:49 PM · Restricted Project, Restricted Project
xazax.hun accepted D121158: [clang][dataflow] Fix nullptr dereferencing error..
Mar 7 2022, 1:48 PM · Restricted Project, Restricted Project