[Networkit] Possible bugs
daniel.hoske at student.kit.edu
Wed Jun 25 17:54:15 CEST 2014
> I found a few bugs (as of 2357a1ad2389/Dev). Could the persons
> reponsible please look at them and check whether they really are bugs?
some additional possible problems as of 30e92808c06f:
- io/EdgeListPartitionReader.cpp, line 47: writing newOmega
- community/PLP.cpp, lines 94, 96, 99:
writing nUpdated and activeNodes (already annotated with TODO)
- community/PLM.cpp line 138: writing moved
- viz/FruchtermanReingold.cpp lines 133, 134, 140, 141:
writing forces[u] and forces[v]
I also found some uses of raw pointers that lead to memory leaks.
You should rarely use pointers. If you need pointers, then unique
ownership with std::unique_ptr is usually what you want. (Interacting
with cython may be an exception):
- community/test/CommunityGTest.cpp, lines 55, 57, 58, 414:
Why do you use new and then deref immediately?
- community/EPPFactory.cpp, lines 14, 16, 23, 25, 27, 30
- distmeasures/test/DistMeasuresGTest.cpp, line 29
- generators/DynamicGraphSource.cpp, lines 44, 45
- generators/GeneratorsGTest.cpp, lines 34, 35, 59, 61, 88, 89
(Only G constructed in lines 36, 62 and 90 is deleted.)
- community/test/CommunityDetectionBenchmark.cpp, lines 54, 71,
93, 115: You use the "lu" format specifier for printing a count
(uint64_t) with printf.The actual specifier is given by the macro
"PRIu64" in <cinttypes>.
(Why do you use the type-unsafe printf anyway?)
- auxiliary/MissingMath.h, log_b(): Possibly add checks for x < 0
and b <= 0 to make this safer.
More information about the NetworKit