Ericsson / codechecker

CodeChecker is an analyzer tooling, defect database and viewer extension for static and dynamic analyzer tools.
https://codechecker.readthedocs.io
Apache License 2.0
2.27k stars 383 forks source link

`CodeChecker store` prints WARNING but the command is failing, so it should be ERROR #3644

Open jimis opened 2 years ago

jimis commented 2 years ago

I'm trying to store some converted reports from ASAN, and the store command returns with error exit code and nothing is stored:

$ CodeChecker  store /path/to/converted_reports --trim-path-prefix /path/to/src -n run_name --url http://localhost:8001/product --verbose debug
[...]
[DEBUG][2022-04-04 15:26:16] {system} [1065412] <140109274101568> - store.py:780 main() - Assembling zip file.
[DEBUG][2022-04-04 15:26:16] {report-converter} [1065412] <140109274101568> - report_file.py:95 analyzer_result_files() - Parsing input argument: '/path/to/converted_reports'
[DEBUG][2022-04-04 15:26:16] {system} [1065412] <140109274101568> - store.py:451 assemble_zip() - Processing report files ...
[INFO][2022-04-04 15:26:17] {system} [1065412] <140109274101568> - store.py:466 assemble_zip() - Processing report files done.
[WARNING][2022-04-04 15:26:17] {report-converter} [1065412] <140109274101568> - reports.py:51 dump_changed_files() - The following source file contents changed or missing since the latest analysis:
 - /include/c++/9/bits/alloc_traits.h
 - /include/c++/9/bits/stl_map.h
 - /include/c++/9/bits/shared_ptr.h
 - /include/c++/9/bits/shared_ptr_base.h
 - /include/c++/9/bits/stl_tree.h
 - /include/c++/9/bits/stl_iterator.h
 - /include/c++/9/ext/new_allocator.h
Please re-analyze your project to update the reports!

$ echo $?
1

Apparently the WARNING should be ERROR, or CodeChecker should continue with storing the results despite the file-not-found warning.

There is something else going on here as these paths don't even exist on my system but that's another story.

jimis commented 2 years ago

The files are missing a /usr prefix, and this seems to be a bug of ASAN, as the same issue can be found on the ASAN stacktraces. Here is a line from the a stacktrace:

    #2 0xa7164f in std::_Sp_counted_ptr<QQmlJS::Dom::ModuleIndex*, (__gnu_cxx::_Lock_policy)2>::_M_dispose() \
        /bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/shared_ptr_base.h:377:9

I think report-converted should handle this more gracefully, i.e. continue with storing the results.