Page MenuHomePhabricator

aabbaabb (Yu Shan)
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 28 2020, 6:51 PM (27 w, 3 d)

Recent Activity

Thu, May 6

aabbaabb updated the diff for D101139: Create install targets for scan-build-py..

Renamed lib to libexec and add custom rules to copy files to build output.

Thu, May 6, 5:07 PM · Restricted Project

Mon, May 3

aabbaabb added inline comments to D101139: Create install targets for scan-build-py..
Mon, May 3, 1:33 PM · Restricted Project
aabbaabb updated the diff for D101139: Create install targets for scan-build-py..

Rename scan-build to scan-build-py during install to prevent overwriting pearl implementation.

Mon, May 3, 1:32 PM · Restricted Project

Wed, Apr 28

aabbaabb added a comment to D101139: Create install targets for scan-build-py..

The python script assumes relative directory while finding things. For example, for resources folder, it uses os.path.join(this_dir, 'resources') in report.py, which means resource need to be in the same dir as report.py. Similarly for the libscanbuild. it assumes the library is always at one level up from bin folder. Installing them to different directories would break the script.

We could reorganize things to match the final layout, that's the strategy that https://github.com/llvm/llvm-project/tree/main/clang/tools/scan-build uses as well.

libear is built dynamically at runtime from build_libear function in libear/__init__.py which would be called by libscanbuild/analyze.py. It is not built statically.

Could we modify the code to avoid building libear at runtime and instead build it with CMake. Is libear even needed when using compilation database?

If i copy libscanbuild/resources to out/share/, libscanbuild to out/libscanbuild, bin/* to bin, then resources would be in a different layout than the original src. You mean modifying the original source and move libscanbuild/resources out to share/resources and update the code reference?

Do we still keep the source in sync with https://github.com/rizsotto/scan-build? I was under the impression that the two codebases have already started diverging.

We are not using libear, we are only using analyze-build not scan-build. For our usage, I could define a target that only copies analyze-build, not scan-build. However, I am not sure whether this is appropriate. On the other hand, building libear statically might require significant change to the code.

We may consider introducing a CMake option to control whether to include libear or not (which would also control whether to include scan-build or not).

Wed, Apr 28, 4:33 PM · Restricted Project
aabbaabb updated the diff for D101139: Create install targets for scan-build-py..
Wed, Apr 28, 4:29 PM · Restricted Project

Mon, Apr 26

aabbaabb added a comment to D101139: Create install targets for scan-build-py..

The python script assumes relative directory while finding things. For example, for resources folder, it uses os.path.join(this_dir, 'resources') in report.py, which means resource need to be in the same dir as report.py. Similarly for the libscanbuild. it assumes the library is always at one level up from bin folder. Installing them to different directories would break the script.

We could reorganize things to match the final layout, that's the strategy that https://github.com/llvm/llvm-project/tree/main/clang/tools/scan-build uses as well.

libear is built dynamically at runtime from build_libear function in libear/__init__.py which would be called by libscanbuild/analyze.py. It is not built statically.

Could we modify the code to avoid building libear at runtime and instead build it with CMake. Is libear even needed when using compilation database?

Mon, Apr 26, 3:26 PM · Restricted Project

Fri, Apr 23

aabbaabb added a comment to D101139: Create install targets for scan-build-py..

I don't think this is sufficient. First, we want to be explicit and always list individual files to install, we don't use patterns. Second, since libscanbuild is a library, it shouldn't be installed inside the bin directory. I think those should go either into lib or share. libscanbuild/resources should definitely go into share as is already the case for scan-build. Third, libear is a native component so that one needs to be compiled first.

Fri, Apr 23, 2:18 PM · Restricted Project
aabbaabb added a comment to D101139: Create install targets for scan-build-py..

The python script assumes relative directory while finding things. For example, for resources folder, it uses os.path.join(this_dir, 'resources') in report.py, which means resource need to be in the same dir as report.py. Similarly for the libscanbuild. it assumes the library is always at one level up from bin folder. Installing them to different directories would break the script.

Fri, Apr 23, 2:12 PM · Restricted Project
aabbaabb added a reviewer for D101139: Create install targets for scan-build-py.: isthismyaccount.
Fri, Apr 23, 1:28 PM · Restricted Project

Thu, Apr 22

aabbaabb set the repository for D101139: Create install targets for scan-build-py. to rG LLVM Github Monorepo.
Thu, Apr 22, 11:31 PM · Restricted Project
aabbaabb requested review of D101139: Create install targets for scan-build-py..
Thu, Apr 22, 11:30 PM · Restricted Project

Feb 18 2021

aabbaabb accepted D96570: [scan-build-py] Add sarif-html support in scan-build-py.

lgtm

Feb 18 2021, 6:02 PM · Restricted Project

Feb 4 2021

aabbaabb added a comment to D94251: [scan-build-py] Update scan-build-py to allow outputing as SARIF..

lgtm

Feb 4 2021, 2:16 PM · Restricted Project
aabbaabb accepted D94251: [scan-build-py] Update scan-build-py to allow outputing as SARIF..
Feb 4 2021, 2:15 PM · Restricted Project

Feb 2 2021

aabbaabb requested changes to D94251: [scan-build-py] Update scan-build-py to allow outputing as SARIF..
Feb 2 2021, 5:24 PM · Restricted Project
aabbaabb added inline comments to D94251: [scan-build-py] Update scan-build-py to allow outputing as SARIF..
Feb 2 2021, 5:24 PM · Restricted Project

Jan 12 2021

aabbaabb accepted D94251: [scan-build-py] Update scan-build-py to allow outputing as SARIF..

LGTM

Jan 12 2021, 5:40 PM · Restricted Project

Dec 28 2020

aabbaabb added reviewers for D93868: [analyzer] Update Fuchsia checker to catch when releasing unowned handles.: xazax.hun, haowei.
Dec 28 2020, 1:00 PM · Restricted Project
aabbaabb accepted D93868: [analyzer] Update Fuchsia checker to catch when releasing unowned handles..

LGTM

Dec 28 2020, 12:59 PM · Restricted Project

Dec 2 2020

aabbaabb added inline comments to D91902: [analyzer] Ignore annotations if func is inlined..
Dec 2 2020, 6:57 PM · Restricted Project
aabbaabb updated the diff for D91902: [analyzer] Ignore annotations if func is inlined..
Dec 2 2020, 6:57 PM · Restricted Project

Dec 1 2020

aabbaabb updated the diff for D91902: [analyzer] Ignore annotations if func is inlined..
Dec 1 2020, 5:51 PM · Restricted Project

Nov 20 2020

aabbaabb requested review of D91902: [analyzer] Ignore annotations if func is inlined..
Nov 20 2020, 5:18 PM · Restricted Project
aabbaabb updated the diff for D91223: Support struct annotations in FuchsiaHandleChecker..
Nov 20 2020, 2:07 PM · Restricted Project

Nov 19 2020

aabbaabb added a comment to D91223: Support struct annotations in FuchsiaHandleChecker..

I think I might have an idea of what is going on. The handles are released in a PostCall. This is intended, as the handles are in the released state AFTER the call. When you call an unknown function with a pointer, that function is free to modify the contents of the pointer. Since the analyzer has no knowledge about the body of the function, it will do a conservative evaluation, escape the symbols in the struct, and create new symbols. This is why new symbols might be introduced. I think you could subscribe to escapes and check if you access the old symbols there. If that is the case and the escape is the result of calling an annotated function, maybe you can correctly mark those symbols as deleted.

Nov 19 2020, 5:18 PM · Restricted Project

Nov 18 2020

aabbaabb added a comment to D91223: Support struct annotations in FuchsiaHandleChecker..

I also have some questions:

  1. This patch does not work for case where the structure is passed in as pointer. The structure becomes lazycompoundval and I could not find the symbol there. Do you know what is going on?

Invoking scanReachableSymbols on the pointer itself would also not work?

  1. If the structure contains a union, the escape logic could not correctly find the escaped handle:

Unfortunately, union support is rather incomplete in the analyzer. There could be many problems in code relying on unions. In case you want to solve this problem it is very likely that you will need to improve the analyzer itself. You might be able to add workarounds in the checker to avoid false positives, like stop following symbols after it was stored into a union eagerly.

Nov 18 2020, 12:49 PM · Restricted Project
aabbaabb added a comment to D91223: Support struct annotations in FuchsiaHandleChecker..

I have a question about pointer members and I'd like to see some tests added. Otherwise, I like the direction.

Where should i add the tests?

We have the tests here: https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/fuchsia_handle.cpp
In LLVM, we have a very strong requirement to commit tests together with features (unless it is really hard to devise a test).
As a result, you can almost always find the location of the tests by looking at the commit that created the file or introduced the feature.

Nov 18 2020, 1:54 AM · Restricted Project

Nov 16 2020

aabbaabb updated the diff for D91223: Support struct annotations in FuchsiaHandleChecker..
Nov 16 2020, 6:28 PM · Restricted Project
aabbaabb added a comment to D91223: Support struct annotations in FuchsiaHandleChecker..

I have a question about pointer members and I'd like to see some tests added. Otherwise, I like the direction.

Where should i add the tests?

We have the tests here: https://github.com/llvm/llvm-project/blob/master/clang/test/Analysis/fuchsia_handle.cpp
In LLVM, we have a very strong requirement to commit tests together with features (unless it is really hard to devise a test).
As a result, you can almost always find the location of the tests by looking at the commit that created the file or introduced the feature.

Nov 16 2020, 6:27 PM · Restricted Project

Nov 13 2020

aabbaabb added inline comments to D91223: Support struct annotations in FuchsiaHandleChecker..
Nov 13 2020, 5:28 PM · Restricted Project
aabbaabb added a comment to D91223: Support struct annotations in FuchsiaHandleChecker..

I have a question about pointer members and I'd like to see some tests added. Otherwise, I like the direction.

Nov 13 2020, 5:25 PM · Restricted Project

Nov 12 2020

aabbaabb updated the diff for D91223: Support struct annotations in FuchsiaHandleChecker..
Nov 12 2020, 8:46 PM · Restricted Project

Nov 10 2020

aabbaabb requested review of D91223: Support struct annotations in FuchsiaHandleChecker..
Nov 10 2020, 6:05 PM · Restricted Project

Nov 2 2020

aabbaabb added a comment to D90362: scan-build supprot relative 'file' in cdb..

I think there are also some patches that only exist here not on that repo so there is no strict upstream/downstream, just two forked versions.
Since in our use case, we would likely use this version instead of the python version (easier to update/maintain), I suggest just adding the fix we need here.
For this specific bug, the python version is already fixed in a different way by reading the code.

Nov 2 2020, 1:51 PM · Restricted Project
aabbaabb added a comment to D90362: scan-build supprot relative 'file' in cdb..

kindly ping for help to submit this.

Nov 2 2020, 11:08 AM · Restricted Project

Oct 29 2020

aabbaabb added a comment to D90362: scan-build supprot relative 'file' in cdb..

Gabor or Petr,
Can any one of you help me commit this change? Not sure if I could commit myself.

Oct 29 2020, 10:00 AM · Restricted Project
aabbaabb added a comment to D90362: scan-build supprot relative 'file' in cdb..
Oct 29 2020, 9:56 AM · Restricted Project

Oct 28 2020

aabbaabb requested review of D90362: scan-build supprot relative 'file' in cdb..
Oct 28 2020, 6:56 PM · Restricted Project