-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static analysis #108
Comments
For reference, the following seems to work reasonably well on Fedora 23 (inside Qubes 3.2):
The above displays all of the warnings from the compiler, Clang Analyzer, and cppcheck that appear in Namecoin Core but not Bitcoin Core. It finds a decent number of warnings, 1 of which involves a null pointer dereference (although by eye I don't think it's particularly dangerous). It took somewhere around an hour to run, although I didn't time it. Might be short enough to fit into a Travis CI build, not entirely sure. EDIT: Added note about working directory |
Potentially relevant links:
EDIT: Added some links. |
Here is the source code repo for csbuild: https://git.fedorahosted.org/git/csmock.git. |
Hello, |
Thanks for your analysis! From a quick glance, those errors seem to be unrelated to Namecoin (and are instead in code that is untouched from upstream Bitcoin) - but I may be mistaken. @JeremyRand, where is the nullptr dereference? If an error is in code related to Namecoin, please point it out explicitly for me - then I'll fix it. Pull requests with fixes are also very welcome in general, of course. :) |
I ended up trying to install csbuild from the csmock repo and had trouble, so I just extracted the deb files for Ubuntu and installed that. From the below errors (when just running
I get that csbuild is useful because it allows us to just see the errors that are introduced by Namecoin, but it would be nice to use something that is developed without just rpm-based systems in mind. Or just use the tools directly like what @khaledJabr is doing with cppCheck. I know I am on Arch and it isn't as if we need everybody to be able to run the tools, but it would be a nice extra consideration if possible. @khaledJabr - There is also a cppcheck-htmlreport tool that can be used to turn the cppCheck.txt you got into an HTML report that can be opened in a web browser.
Then look in /some/directory/for/output/ for the HTML to open. |
@domob1812 the null pointer dereference was found by Clang Analyzer. Interestingly csbuild reported that no issues unique to Namecoin were found by cppcheck; it's unclear to me whether I did something wrong there. I'll refrain from posting the csbuild output here, since there was some criticism last year that I appeared to be doing too much with regards to projects from new contributors, and I'd rather that @khaledJabr contribute that rather than myself. @josephbisch my take is that it doesn't necessarily need to run on a lot of platforms, as long as it runs on a platform that Travis CI can handle. (It looks to me like it's not resource-intensive enough to be a problem for Travis CI, but I could be wrong.) The links I gave for Travis CI OS support include instructions for using either Fedora or Ubuntu Precise, both of which csbuild supports. I do agree with @josephbisch that it would be nice if csbuild were packaged for more distros. I spent several hours looking for similar tools, and didn't find any that looked anywhere near as good. Maybe I missed something. @khaledJabr so my suggestion for next steps would be the following:
Of course, these suggestions might be invalidated if @domob1812 or @josephbisch have other ideas. And as usual, feel free to ask questions (and let us know how things are going) on IRC. Usually IRC will get responses faster than GitHub. |
We could try modifying the existing packaging source to rebuild the csbuild deb packages for Ubuntu Trusty if that would make things any easier with Travis CI. I don't know if there is any technical reason for there just being Precise packages currently, or if it is just a matter of time or resources. |
Ubuntu trusty packages for csbuild have been uploaded. So, that in |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Typo on this line:
https://github.com/namecoin/namecoin-core/blob/fddcd12297c7b3930f0d28a61
15c2a3bb599850f/.travis.yml#L48
`sudp` should be `sudo`
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJYG+f1AAoJELPy0WV4bWVwhRsP/2OhfXiYlqzfiyFQrESgysqA
S/yQDGMaN+p9sf8hg52JiwoQCH0eespBxCqlMFWhmyFjval60t4oIzcx9HI8sFrw
ahUUK+/mFYSefrv/U/LcZOW+wyPqoyLNLgJ0yHwFez5MUB45srOU1Nq/O9od4Jpz
B7yUUufUwYP3ULudruCFQZpfJQm0y9bacb5U9dLq3YYNvNMzkdFCaxEgNjNWJFKh
7JA/EpywvcaNk7m9slnuDM32kbnOSa0T8S1qFcGwuqOZbjG5UsumoXuJsUMl8M8b
qDVvA9Ankt7cIZWiL+DyZZXZt/joMe/5eLhWTgQQbn5atC2L93Wb/CwgkiSvvs95
RPvWKnNeZusQvwuDTpRnhxlOCHpXaK8k5W7xB6+7sV12a0Sij5YooJinkEzsWFLR
LPuActy8J7q4nJz89y9xt0j5OfvNxurd+m2Ya+siK8PRnb+LDTECQ8fM2QR8Rvc9
6TG5EEdc3FQu9ixv94N6XT/bS52GYJ6XeqWrW8htLw/a20cM06pr6VmNpdTZPuTh
YFiZAwGrzIZT/525xAszWaRl6BKdXBKlJJ2elkGqQG2KsXuEsdjOwecKtWpGvmNb
KYbODusKsMumEOi1SeB4+rHkliieplfsUSd3lxTS62BNjsxTCQwxyk5Bj/vf9obs
mGOReERNcU9dgcDWQryK
=O9+S
-----END PGP SIGNATURE-----
|
fixed and created a pull request. On Thu, Nov 3, 2016 at 8:45 PM, JeremyRand [email protected] wrote:
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Another error:
https://travis-ci.org/namecoin/namecoin-core/jobs/173141190#L157
Looks like --qq should be -qq (only 1 hyphen).
(Sorry if this message gets duplicated; it appears that it failed to
send the first time.)
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJYG+xNAAoJELPy0WV4bWVwjFsQANBW6rfsB+tPsq3cdDbIcKV1
1RStUDtQCgVSfnTCsTnaIShbXFtFOnS9yF7TvH9dOT0H3/BzZ5iUf9hp4l+c1kWf
kcij26E48duLEV4gBRUKGcJPoAwvEn+yA3OEss36R4+39sdP6RG8DcXyTqQZY5YD
PbOAy8HbuAUQrQuy59YWyfyPIeGRoLSjrr3s3A0xIzTdGMBYuadCkbjpjFlILyAg
/RPy3Y1IF8iJE6BuTAmwXxUML/GA7vYuqadHU13AU8Wl0JjwEpHjIvHPU98pZDG2
uscbGlaCAwW9QT/M2/PD7g9KEsY+BsbKrFlatf6kmzvEb5yDmYnO9EaP/UnM0cCg
ICvxSFxT6R+NX3h5UmasqFSiQNu2GWDGKeQxBXSJYy//OpCjh5jRjlIsOKAbMw3w
Y4xVc06FYmctPc7K5SRQGZnOv/dIyS88FX3Ev7kG4sR194INlh5D6arxzGrgTYpw
WgXyeGx/gFhi1ymxwcR67Juh+ipFxQUKtUkLdF7WOzk5bp676Ydr6dB+TtMEB6xK
n8LnLzZd6T81KjeYa6nshOJIbcVgKpI/tt0cYpmJuRlaoj3wVTF499QncrB4NaQD
EnskYRrfszFz7mxQDfPdqvl2MbUrlPtqCh/G17uW6WXljd+PsFaspZ+4HaF5ABkI
/1TLXcY3UHuWh4lYnqw5
=Xmvv
-----END PGP SIGNATURE-----
|
fixed and made another pull request. Sorry about this, promise it'll be On Thu, Nov 3, 2016 at 9:03 PM, JeremyRand [email protected] wrote:
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Some static analysis stuff is making its way through the upstream
Bitcoin Core review process; it may be a good idea to wait until it
gets merged upstream. See
bitcoin-core/bitcoin-maintainer-tools#10
…-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJZDnO5AAoJELPy0WV4bWVw2nAP/iWzc9Gvn2Hx0841tLD1+eZO
j6MBAoc6oPSpc2alyoR+tTx3n93DIoMFZnoznDCFRhFGnPactBA8prIohAkiXk+R
V6nJgJt44ybxB84jMufJ2Pl/St/Oh990BnD2Ps80pbQ34bhucH1rG95JFiG9bSe/
LaH6qB0g7id6FSyRQm5mHZo8Kt1XJp6wFFhwxWhSYw0pv9bPt75keVK5Xw7HLOMf
3cNqmcxH0f91UNz3QrQJ3T96BsH/zqeuY3etgKSPbWYbcFPYhrg0CcpGdc8XYFmq
5mvaSF6HLiwz8vGazZAL8TjxgnXue6HXu137kijEs3/SgGtO4X7tiM0mQcINnBc2
UlPoW6W4hKwNaVjVMPYVMIOb+rROhkaSL0Jfu+0yn+mtPY9EhLxJYo6W7MYue+73
oAkRhPkGpLb0QogWSebUwlRn9HyF2fqlNFQa7lvWpGcwVwaZ4O+kQE473dgMvG7R
L7cpT57PZq2kHADP4o3bW0cpB62z7SrymJ7pdcINnEqwKiW83CVPf8Sop//qXdwX
lMm1zhSezb7Neq8GDLVGtHlGtMVAXdNaJn7sSgGNeOs1u8aQfnLCNvSCqxn5+ATU
qYJhKWF1uSL+B+cKkueWgEtq+15t5yrgkXi7PrAFK0zep0m4MRYLo1gww6DeL9uv
gkq4WunQ+v39XTGFeOpy
=LZSg
-----END PGP SIGNATURE-----
|
There's some interest in running static analysis of the Namecoin Core codebase. @khaledJabr is currently tinkering around with this; I figure it's useful to make a GitHub issue for this work so that everyone's on the same page.
The text was updated successfully, but these errors were encountered: