Open mikael-s opened 4 years ago
nicely spotted!
could be identified with https://developers.redhat.com/blog/2020/03/26/static-analysis-in-gcc-10/
Here is the (lengthy) report produced with -fanalyzer
and g++ 10, after eating more than 20GB of RAM
nice! worth it. Double frees are at the end and one is
src/../blight/bmalloc.h:99:15: warning: double-‘free’ of ‘_6’ [CWE-415] [-Wanalyzer-double-free]
99 | ::free(p);
| ^
‘__dt_base ’: events 1-5
|
|src/../blight/bmbuffer.h:282:9:
| 280 | void free_buffer()
| | ~
| | |
| | (3) first ‘free’ here
| 281 | {
| 282 | if (byte_buf_)
| | ^
| | |
| | (1) following ‘true’ branch...
| | (4) following ‘true’ branch...
| 283 | {
| 284 | allocator_type::deallocate((bm::word_t*)byte_buf_, alloc_factor_);
| | ~
| | |
| | (2) ...to here
| | (5) ...to here
|
‘__dt_base ’: event 6
|
|src/../blight/bmalloc.h:99:15:
| 99 | ::free(p);
| | ^
| | |
| | (6) second ‘free’ here; first ‘free’ was at (3)
|
When compiling REINDEER with g++ version 9.3.0 the index construction specified in the README fails with a double free error.
Command:
./Reindeer --index -f test/fof_unitigs.txt -o quick_out
Output:
The backtrace is :
Which (unexpectedly) points to
src/build_index.cpp:64
:Workaround index construction succeeds when compiled with g++ version 8 or 10. It also succeeds with g++ 9 when compiling with
-O2
instead of-Ofast
(eg.sed -i 's/Ofast/O2/g' makefile
)