scan-build always reports No Bugs found with make but working with single file on Linux - scan-build

I am trying to use scan-build to do static analysis for my project.
When I run the scan-build with single .cpp or .c file , it reports the bugs correctly.
But when I use with cmake/make , it always says No Bugs found.
Commands used:
scan-build --use-cc /usr/bin/gcc --use-c++ /usr/bin/c++ --keep-cc cmake -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/c++
scan-build -V -v -v --use-cc /usr/bin/gcc --use-c++ /usr/bin/c++ --keep-cc --force-analyze-debug-code -analyze-headers -stats --status-bugs --use-analyzer=/llvm-project/build/bin/clang-15 --analyzer-target --keep-going -enable-checker all checkers separated by comma -o reports path
Actual Output:
scan-build: Analysis run complete.
scan-build: Removing directory '/tmp/scan-build-' because it contains no reports.
scan-build: No bugs found.
Expected Output:
scan-build bugs with html reports
Single file output:
11: warning: Division by zero [core.DivideZero]
return 5/(x-x); // warn
~^~~~~~
1 warning generated.
scan-build: Analysis run complete.
scan-build: 1 bug found.
scan-build: Run 'scan-view /tmp/scan-build-' to examine bug reports.
I have tried all the other options mentioned in this forum, but nothing worked for me.
Tried below also,
export CCC_CC=clang
export CCC_CXX=clang++
Would be very helpful if someone provide exact options that can work and generate bugs with gcc/make.

Related

LyX-2.3.6.1 not finding scrpage2.sty

Installed here are: texlive-2021.210418-x86_64-1slint and texlive-extra-2020.200608-x86_64-1_SBo.
LyX-2.3.6.1 has had no issues with other classes.
I'm using the KOMA-letter2 class. The .sty file is in /usr/share/texmf/tex/latex/koma-script/scrpage2.sty.
$ kpsewhich scrpage2.sty does not find the file.
When I try to print the developing letter I get an error; the 229-line output log can be downloaded from
tinyurl.com/3ah24w96
I've looked at it without seeing where LyX fell of the track. The log reports that letter class option 'DIN' is loaded on input line 6, but I don't see that anywhere in the Settings.
$ su -c texhash does not allow the file to compile with pdflatex.
I tried several tlmgr actions/options without success.
How do I allow pdflatex to recognize scrpage2.sty?
Rich

nbsphinx causes build to fail when building Jupyter Notebooks

Details
I am getting a build failure of my read-the-docs that I don't understand. The assertion of "verbatim" in line 2151 of nbsphinx.py is causing the build failure. So the build fails when I try to include the Jupyter Notebook tutorials I created. I compared current versions of the tutorials to previous versions which had not caused the build to fail, and I can't find a difference that could account for the current failure.
Read the Docs project URL: lofti_gaia
Build URL: https://github.com/logan-pearce/lofti_gaia
Read the Docs username: logan-pearce
Expected Result
A passing build including *.ipynb files
Actual Result
Build failed at line 2151 of nbsphinx.py due to assertion of 'Verbatim' failing.
Terminal output:
Running Sphinx v4.1.2
loading translations [en]... done
making output directory... done
WARNING: html_static_path entry '_static' does not exist
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing lofti_gaia.tex... index installation tutorials/QuickStart tutorials/Tutorial api lofti loftitools
resolving references...
done
writing... failed
Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/lofti-gaia/conda/latest/lib/python3.7/site-packages/nbsphinx.py", line 2151, in depart_codearea_latex
assert 'Verbatim' in lines[0]
AssertionError
The full traceback has been saved in /tmp/sphinx-err-x1h83s3m.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
According to the github issue 584 for nbsphinx (https://github.com/spatialaudio/nbsphinx/issues/584), this is due to a compatibility issue with sphinx 4.1.0. It can be gotten around by requiring sphinx version 4.0.2.
So in my requirements.txt file, I included sphinx==4.0.2, after which the build passes. So now my requirements.txt file looks like:
numpy
matplotlib
astropy>=4.0.1.post1
astroquery>=0.4
sphinx==4.0.2
ipython==7.19.0
nbsphinx>=0.8.6
and the build passes.
I have encountered the same issue. I did not solve it with .ipynb format, but converting the jupyter notebook to .rst format works.
May it helps

Building PhantomJS 2.0 on Windows results in a strange error

I am trying to build PhantomJS 2.0 on Windows from the c:\fastio\phantomjs\phantomjs directory. For some reason, the build process fails after a while, with 2 errors (see error message below):
1) It tries to access "C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe". Obviously, the backslash characters between directory names are somehow getting stripped away deep in the build process - possibly a mismatch between Windows-style "\" and Linux-style "/" (but this is only a guess).
2) There's another error, "Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in".
If I remove sh.exe from the PATH, the build still gets to this point, and only error #2 appears, leading me to think that error #2 is the real problem here.
Here is the full error message (as far as I can tell this is happening while building WebKit):
sh: C:fastiophantomjsphantomjssrcqtqtbasebinmoc.exe: command not found
Failed to read names from file: C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/mathml/mathtags.in at C:/fastio/phantomjs/phantomjs/src/qt/qtwebkit/Source/WebCore/dom/make_names.pl line 315.
NMAKE : fatal error U1077: 'C:\Users\Eugene\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff37326ad\bin\perl.EXE' : return code '0x7f'
Stop.
(By the way, I saw this question but I'm already past the issues described there, my error is happening later in the build process.)
How can I make this work?
Full logs below:
Console output:
http://pastebin.com/btMeNPz4
QT build log file build_qt_4-285-20-0859.log:
http://pastebin.com/LUEJz7E0
WebKit build log file build_webkit_4-285-20_0859.log:
http://pastebin.com/494TivXF
PhantomJS build log file build_phantomjs_4-285-20_0859.log:
Empty
Looks like I found the solution myself, here were my steps:
Remove as much as possible from the PATH leaving only the entries critical to the build process
Most importantly, remove all GitHub's git directories from the PATH
Install GIT separately (not from GitHub but from git-scm.com), add its cmd directory only (not its bin directory) to the PATH
Install ActivePerl separately, add it to the PATH
It's moving past the error I asked about with the steps above (still not sure if it will finish the build successfully, it's taking a while).

GOBJECT_INTROSPECTION_CHECK syntax error on configure

On "./configure" of an open source project I get:
user agent OS = Linux
./configure: line 13957: syntax error near unexpected token 0.9.3'
./configure: line 13957: GOBJECT_INTROSPECTION_CHECK(0.9.3)'
make: *** [config.status] Error 2
Ubuntu 12.04 package "gobject-introspection" and "libgirepository1.0-dev" are present. Removing the GOBJECT_INTROSPECTION_CHECK line allows configure to complete, but the project fails a dependency later.
How can I get past this configure step cleanly? Googling for this issue shows bugs filed against numerous OS projects for this same blocking issue, but the usual answer is "install gobject-introspection".
As the OP discovered on his own he had to install the gobject-introspection package to get the m4 macros that were being used.
The error message has the raw macro in it, as configure scripts are generated from configure.in/configure.ac files via m4/etc the fact that the raw macro is in the output file indicates that the macro did not get translated at generation time.
The gobject-introspection m4 files were apparently installed after autogen.sh (or equivalent) was run to generate the configure script. Re-running the autogen.sh script should regenerate the configure script and run the macro correctly.

frama-c jessie killed during VC generation

I'm trying to apply frama-c/jessie on a module of a proprietary safety critical system from our customer. The function under analysis is pretty big (image 700 uncommented lines count) with a lot of conditional statements as well as complex (&&, ||, etc).
I got this error message when I ran it on Ubuntu VM 64 bit machine. It appears Error 137 is related to memory size, etc. But I'm not quite sure.
Any suggestion for how to approach this error is greatly appreciated.
[
formal_verification]$ frama-c -jessie test.c
[kernel] preprocessing with "gcc -C -E -I. -dD test.c"
[jessie] Starting Jessie translation
[jessie] Producing Jessie files in subdir test.jessie
[jessie] File test.jessie/test.jc written.
[jessie] File test.jessie/test.cloc written.
[jessie] Calling Jessie tool in subdir tests.jessie
Generating Why function testFun
[jessie] Calling VCs generator.
gwhy-bin [...] why/test.why
Computation of VCs...
Killed
make: *** [test.stat] Error 137
with a lot of conditional statements as well as complex (&&, ||, etc).
You should use the so-called “fast WP” option when analyzing functions with lots of nested conditionals. Otherwise, the target does not even need to be very large to cause a blowup.
It happens to be the example in Jessie's manual for passing options to Why (it is really a Why option):
-jessie-why-opt=<s>
give an option to Why (e.g., -fast-wp)
You would therefore use -jessie-why-opt=-fast-wp.

Resources