Bug 16221 - List of possible bugs (cppcheck)
Summary: List of possible bugs (cppcheck)
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: 3.2.x
Hardware: PC All
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-11-14 07:13 UTC by etienne.champetier
Modified: 2013-12-04 21:00 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

cppcheck with --enable=all (217.35 KB, text/plain)
2013-11-14 07:13 UTC, etienne.champetier
cppcheck with only errors (7.64 KB, text/plain)
2013-11-14 07:14 UTC, etienne.champetier

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description etienne.champetier 2013-11-14 07:13:32 UTC
Created attachment 5422 [details]
cppcheck with --enable=all


i've just run cppcheck 1.62 (http://cppcheck.sourceforge.net/)
on mono codebase and it report 81 errors like:
Division by zero
Uninitialized variable
Resource leak
Array accessed out of bounds
Buffer is accessed out of bounds
Common realloc mistake: nulled but not freed upon failure
Memory leak
format string problems

This was run on commit 0927129c35f5a2d6df891857b2155ad5fb6ba3d2

to reproduce:
git clone https://github.com/mono/mono.git
cd mono/
git submodule init
git submodule update

cppcheck -j 20 --force . 2> ../cppcheck-short.txt

cppcheck -j 20 --force --enable=all . 2> ../cppcheck-all.txt
Comment 1 etienne.champetier 2013-11-14 07:14:29 UTC
Created attachment 5423 [details]
cppcheck with only errors
Comment 2 Rodrigo Kumpera 2013-11-14 12:43:41 UTC
I reviewed all changes in metadata and mini. They are either harmless of false positives.
Comment 3 etienne.champetier 2013-11-20 04:06:47 UTC

What about:
[mono/profiler/decode.c:2150]: (error) Memory leak: monitors
[mono/profiler/decode.c:2230]: (error) Memory leak: classes
[mono/profiler/decode.c:2320]: (error) Memory leak: methods
[mono/profiler/decode.c:2458]: (error) Memory leak: hs_sorted
[support/minizip/zip.c:605]: (error) Memory leak: zi

please do not close the ticket if you haven't reviewed all errors
Thanks in advance
Comment 4 Rodrigo Kumpera 2013-11-20 12:07:07 UTC
I don't care about those leaks as the tool exits right after that.
Comment 5 Zoltan Varga 2013-12-04 21:00:56 UTC
We won't be fixing those.