Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 26 15:05
    csordasmarton milestoned #1797
  • Sep 21 08:32

    csordasmarton on master

    Small typo fix (#3434) * Small… (compare)

  • Sep 21 08:32
    csordasmarton closed #3434
  • Sep 21 08:09

    csordasmarton on master

    [analyzer] Add flags to log_par… Merge pull request #3433 from w… (compare)

  • Sep 21 08:09
    csordasmarton closed #3433
  • Sep 20 06:18
    waqas-mazhar review_requested #3433
  • Sep 20 06:17
    waqas-mazhar edited #3433
  • Sep 20 06:17
    waqas-mazhar synchronize #3433
  • Sep 20 02:42
    waqas-mazhar review_requested #3433
  • Sep 20 00:58
    waqas-mazhar edited #3433
  • Sep 20 00:56
    waqas-mazhar synchronize #3433
  • Sep 17 08:24
    Vodorok labeled #3435
  • Sep 17 08:24
    Vodorok labeled #3435
  • Sep 17 08:24
    Vodorok labeled #3435
  • Sep 17 08:23
    Vodorok opened #3435
  • Sep 17 08:08

    bruntib on master

    [analyzer] Use `-imacros` flag … Merge pull request #3428 from w… (compare)

  • Sep 17 08:08
    bruntib closed #3428
  • Sep 16 20:16
    csordasmarton milestoned #3434
  • Sep 16 20:16
    csordasmarton labeled #3434
  • Sep 16 19:44
    imbur edited #3434
Folkert van Heusden
@flok99
ah. I'm on Ubuntu 20.04 LTS here (as suggested by the docs). I've created a github-issue. They've suggested a stackoverflow page that I already checked but maybe I missed something so I'll continue that route.
Hmmm or I could downgrade to 18.
Jani Mikkonen
@rasjani
or run from docker ?
(which i dont have any clue but seems to be defacto answer to a lot of questions :))
Folkert van Heusden
@flok99
I know even less about docker than python, so I'm hesitant ;-)
Note that one suggestion in that stackoverflow page gave progress: export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages before make venv
This results in something, but that won't run either because of other packages missing or so.
Ah well, the sun shines where I live.
Jani Mikkonen
@rasjani
what where the other packages ?
also, PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages might not need the $PYTHONPATH cuz by default, i think that is not set by default on vanilla bash on ubuntu ..
so your PYTHONPATH value is probably :/usr/lib/python3/dist-packages
probably dont matter ..
Folkert van Heusden
@flok99
The other packages are: yaml, six, mako.
That's when I invoke:
./CodeChecker server
Jani Mikkonen
@rasjani
those should be inside the generated venv if make venv actually passed .. you did activate it before running that server ?
activation needs to be done on every shell session you use CodeChecker
Folkert van Heusden
@flok99
Yes, I did.
I'm going to 'find' for them.
Nope, nowhere under ~ (I'm running it all under a regular user).
Jani Mikkonen
@rasjani
aha! i have an idea ..
i do remember that if "make venv" fails initially and you didnt clean the created folder, running make venv again will not fix the broken one ..
eg, do git clean, make venv again with the PYTHONPATH workaround, and proceed
Folkert van Heusden
@flok99
Yeah, I did that. I even rm -rf ~/codechecker and did a new clone :-)
Jani Mikkonen
@rasjani
and make venv log doesnt show any issues ?
Jani Mikkonen
@rasjani
maybe share that to pastebin or something ..
Folkert van Heusden
@flok99
https://pastebin.com/CCi5bTA6 <-- not seeing anything obviously wrong. also note that it does find mako and such installed
https://pastebin.com/Uq2x78z4
Jani Mikkonen
@rasjani
not that output, thats from make package, i asked for make venv output ..
Folkert van Heusden
@flok99
https://pastebin.com/CCi5bTA6 is from make venv

solved!

wait

@rasjani thank you very much for your help!
Jani Mikkonen
@rasjani
np
engr-basit
@engr-basit
@rasjani I am trying to analyze a linux kernel module using CodeChecker, but it fails to do so. My kernel version is 4.18.0-193.19.1.el8_2.x86_64. It gives these errors.
[INFO 2020-12-21 10:54] - Starting static analysis ...
[ERROR 2020-12-21 10:54] - Analyzing m1.c with clangsa  failed!
[ERROR 2020-12-21 10:54] - 

[ERROR 2020-12-21 10:54] - 
clang-10: error: unknown argument: '-mskip-rax-setup'
clang-10: warning: optimization flag '-falign-jumps=1' is not supported [-Wignored-optimization-argument]
clang-10: warning: optimization flag '-falign-loops=1' is not supported [-Wignored-optimization-argument]
clang-10: warning: optimization flag '-fno-inline-functions-called-once' is not supported [-Wignored-optimization-argument]
clang-10: warning: optimization flag '-fmerge-constants' is not supported [-Wignored-optimization-argument]
clang-10: error: unsupported option '-mrecord-mcount' for target 'x86_64-redhat-linux'
2 replies
engr-basit
@engr-basit
I have opened an issue #3110. You can have a look for the details there.
Folkert van Heusden
@flok99

Something weird is happing:

  • every night I clone our repo (after an rm -rf from the previous clone)
  • then I run CodeChecker check -b make -o ~/results
    that all runs fine without errors.
    Yet when I run:
  • CodeChecker store ~/results -n mf
    I get the following output:

[WARNING 2020-12-23 00:47] - /usr/home/sa/repo/[...]template.c did change since the last analysis.
...
Please analyze your project again to update the reports!

How can this be resolved?
This is especially strange as it is cloned to a local ext4 filesystem with no other users or processes at all that can touch those files.

Also running the store again gives the same error.
Folkert van Heusden
@flok99
should I remove ~/results before each 'check'-run?
Whisperity
@whisperity
There used to be some distinction between an "incremental analysis" (i.e. you still have your build and result directory, and run the analysis that way and upload that way), or between a "from-scratch" analysis when uploaded to the server...
But I have to check, maybe the server now supports it properly.
If you always do a full analysis, and always store the result of the full analysis to the server, it should be fine. The problem is if you do the following:
  • rm -rf results
  • change some files in your source
  • CodeChecker check -b "make" # in case make doesn't execute a full build just an incremental one on your changed files
  • results now contains only results for the files that were actually built by make
  • store results
  • on the server, you'll see every result that was from files you did not analyse in the last run marked as "Resolved"

The error you're getting is store checking your actual files against what the analyze command output as the state of the files. This is done because store packages the necessary source files at the moment of upload but the results of analyze can be older, so there could be the off-chance that you're uploading reports that point to locations in the source code that aren't there anymore in your source files. It's a safeguard.

I think it works based simply on timestamp.

Whisperity
@whisperity
https://github.com/Ericsson/codechecker/blob/cca6517822260a6d1e85c82ef29a6400efeba0df/analyzer/codechecker_analyzer/cmd/parse.py#L577 Here is where the message is coming from. Basically, there is a map that maps every result file to the source file it came from. And if the mtime of the source file is newer than that of the plist, this is emitted.
Try doing a fully new results directory, always with a brand new analysis.
Folkert van Heusden
@flok99

Thank you.

But if I want to do it as it was supposed to be done, will it work if I:

  • git pull
  • CodeChecker check -b make -o $RESULT
  • CodeChecker store $RESULTS -n mf

exactly that?

So first run:

  • git clone / check / store
  • and then each run the 3 steps I mentioned above
    Or should I also use a new results directory in this situation? (if I understood you correctly, I should only purge the results directory when doing a new analysis, e.g. with a new clone of the repo, but just to be sure)
Whisperity
@whisperity

The workflow you described:

clone -> build -> check -> store -> pull -> build new version -> check the changed files -> store all results (incl. new ones and old ones still in results)

SHOULD work. I'm not sure why you get the timestamp issue. This workflow will work as long as you retain your results directory.

There is another workflow, which runs the analysis from scratch and uploads the full result set all the time:

clone -> build -> check -> store -> rm -rf results -> make clean -> pull -> make (all!) -> check -> store

That should work too. The server will not lose the results, the only thing you have to be careful about is to not have:

clone -> build -> check -> store -> rm -rf results -> pull -> make (the changed files) -> check (the changed files only!) -> store (a smaller result set)

because this one will switch all the reports from all the files that were not built after the subsequent pulls to Resolved (because from the server's perspective, the bugs disappered from the upload)

Folkert van Heusden
@flok99
Thank you!
I'm giving it a try now.
Folkert van Heusden
@flok99

Weird. Something is still going wrong.

I do exactly this:

! /bin/bash

export PATH=~/codechecker/build/CodeChecker/bin:$PATH
export PATH=/opt/rh/llvm-toolset-7/root/usr/bin:$PATH

REPO=~/repo

cd $REPO

should not be required

git reset --hard

update repo

git pull --all

source ~/codechecker/venv/bin/activate

verify that CodeChecker server is running and if not; start it

/usr/sbin/ss -tnl | grep -q 'LISTEN.*:8001'

if [ $? -ne 0 ] ; then
echo Starting CodeChecker server
nohup CodeChecker server --host 0.0.0.0 &

# hopefully this is long enough. this should only be invoked
# on the first run after a system boot. if it is not reliable;
# replace it then by a while loop which invokes the 'ss'
# command above
sleep 5

fi

RESULTS=~/results

cd $REPO/mf

perform the analysis

CodeChecker check -b make -o $RESULTS

store results in the server

CodeChecker store $RESULTS -n mf

Yet I get (in the second run):

[WARNING 2020-12-23 16:14] - The following source file contents changed since the latest analysis:

  • [list of files that are indeed updated by the git pull]
    Multiple reports were not shown and skipped from the statistics. Please analyze your project again to update the reports!
    [INFO 2020-12-23 16:14] - Storing analysis results for run 'mf'
    [INFO 2020-12-23 16:14] - Checking local passwords or tokens in /usr/home/sa/.codechecker.passwords.json
    [INFO 2020-12-23 16:14] - Password file not found.
    [INFO 2020-12-23 16:14] - Checking for local valid sessions.
    [WARNING 2020-12-23 16:14] - Check name wasn't found in the plist file '/usr/home/sa/results/parser.c_clangsa_83ff4b537b2be004d37c504baf2319c1.plist'.
    [INFO 2020-12-23 16:14] - Processing report files done.
    [WARNING 2020-12-23 16:14] - The following source file contents changed since the latest analysis:
  • [that same list of files that are indeed updated by the git pull]
Whisperity
@whisperity
Is make actively rebuilding all the files that git pull updated? It seems the issue is there somewhere... there are files that get updated, but not re-analysed, and thus it breaks. Does it work if you always do a full new analysis (with removing ~/results, and also make clean (or make distclean) and then doing a full build & full analysis)?

[WARNING 2020-12-23 16:14] - Check name wasn't found in the plist file '/usr/home/sa/results/parser.c_clangsa_83ff4b537b2be004d37c504baf2319c1.plist'.

This is worrying. For some reason, the output of the Clang Static Analyzer generated a bogus plist. But this is just a warning, I think if the plist is too old (in terms of format), it'll just go with whatever or unknown as the name of the checker when storing.

engr-basit
@engr-basit
@whisperity is it possible to do the analysis of specific files? As in my case when I do the build it goes through all the includes as well which is not required.
Folkert van Heusden
@flok99
@whisperity Yes, make is indeed correctly rebuilding all files touched by git pull (and any depencies, like if common.h is touched).
@whisperity I have not tried the full rebuild yet (make clean && rm -rf ~/results). Will CodeChecker then still be able to correlate new/old errors?
Jani Mikkonen
@rasjani
^ CodeChecker cmd diff is for that .. for example, i have nightly builds that does full scan, then on pull requests, i scan only changed files and use cmd diff to strip away all already known reports ..
Jani Mikkonen
@rasjani
Is there any way to mass tag findings in the webui as, say "intentional" ?
Stefan Seefeld
@stefanseefeld
Hello, I just tried to use the codechecker pypi package (https://pypi.org/project/codechecker/), but ran into a few issues. Is this supposed to work ?
(primary issue: there is no CodeChecker or codechecker tool installed, apparently. Secondary issues: Lots of links on https://pypi.org/project/codechecker/ are broken, i.e. result in 404 errors)