Closed Geremia closed 5 years ago
As of 065a0ce, leaks are detected:
$ /usr/include/boost/any.hpp:249:17: runtime error: downcast of address 0x604000000c10 which does not point to an object of type 'holder'
0x604000000c10: note: object is of type 'boost::any::holder<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >'
01 00 80 3f d0 db 6f 67 9b 7f 00 00 f0 79 00 00 30 60 00 00 14 00 00 00 00 00 00 00 14 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'boost::any::holder<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >'
ERROR! Variable requested is far too large
=================================================================
==98904==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 256 byte(s) in 2 object(s) allocated from:
#0 0x7f9b6b1c6320 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xe9320)
#1 0x7f9b6758f2a2 (/usr/lib64/libstdc++.so.6+0x952a2)
Indirect leak of 32768 byte(s) in 1 object(s) allocated from:
#0 0x7f9b6b1c5f30 in malloc (/usr/lib64/libasan.so.5+0xe8f30)
#1 0x7f9b6770b145 (/lib64/libz.so.1+0x8145)
Indirect leak of 16384 byte(s) in 1 object(s) allocated from:
#0 0x7f9b6b1c5f30 in malloc (/usr/lib64/libasan.so.5+0xe8f30)
#1 0x7f9b67710be2 (/lib64/libz.so.1+0xdbe2)
Indirect leak of 8192 byte(s) in 1 object(s) allocated from:
#0 0x7f9b6b1c5f30 in malloc (/usr/lib64/libasan.so.5+0xe8f30)
#1 0x7f9b67710bd2 (/lib64/libz.so.1+0xdbd2)
Indirect leak of 7160 byte(s) in 1 object(s) allocated from:
#0 0x7f9b6b1c5f30 in malloc (/usr/lib64/libasan.so.5+0xe8f30)
#1 0x7f9b6770b4b5 in inflateInit2_ (/lib64/libz.so.1+0x84b5)
Indirect leak of 232 byte(s) in 1 object(s) allocated from:
#0 0x7f9b6b1c5f30 in malloc (/usr/lib64/libasan.so.5+0xe8f30)
#1 0x7f9b67710418 (/lib64/libz.so.1+0xd418)
Indirect leak of 21 byte(s) in 1 object(s) allocated from:
#0 0x7f9b6b1c5f30 in malloc (/usr/lib64/libasan.so.5+0xe8f30)
#1 0x7f9b67710502 (/lib64/libz.so.1+0xd502)
SUMMARY: AddressSanitizer: 65013 byte(s) leaked in 8 allocation(s).
Output:
c Outputting solution to console
c CryptoMiniSat version 5.6.6
c CMS Copyright Mate Soos (soos.mate@gmail.com)
c CMS SHA revision GIT-notfound
c CMS is MIT licensed
c Using code from 'When Boolean Satisfiability Meets Gauss-E. in a Simplex Way'
c by C.-S. Han and J.-H. Roland Jiang in CAV 2012. Fixes by M. Soos
c CMS compilation env CMAKE_CXX_COMPILER = /usr/bin/c++ | CMAKE_CXX_FLAGS = -O2 -fPIC -g -fsanitize=address -fsanitize=undefined -fsanitize=leak -fno-stack-protector -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wshadow -Wformat=2 -Wextra-semi -pedantic -Wno-class-memaccess | COMPILE_DEFINES = -DUSE_GAUSS -DNDEBUG -D_FORTIFY_SOURCE=0 -DLIMITMEM -DBOOST_TEST_DYN_LINK -DUSE_ZLIB | STATICCOMPILE = OFF | ONLY_SIMPLE = OFF | Boost_FOUND = 1 | STATS = OFF | SQLITE3_FOUND = | ZLIB_FOUND = TRUE | VALGRIND_FOUND = TRUE | ENABLE_TESTING = OFF | M4RI_FOUND = FALSE | NOM4RI = OFF | SLOW_DEBUG = OFF | ENABLE_ASSERTIONS = OFF | PYTHON_EXECUTABLE = /usr/bin/python3 | PYTHON_LIBRARY = /usr/lib64/libpython3.6m.so | PYTHON_INCLUDE_DIRS = /usr/include/python3.6m | MY_TARGETS = | LARGEMEM = OFF | LIMITMEM = ON | compilation date time = Jan 19 2019 10:22:28
c CMS compiled with gcc version 8.2.0
c Executed with command line: cryptominisat5 -t 64 in_simplified.cnf.gz
c Reading file 'in_simplified.cnf.gz'
c -- header says num vars: 961856
c -- header says num clauses: 6355738
Hi,
First of all, thanks for the bug reports and I hope you are enjoying using CMS.
Unfortunately, Boost is known to be buggy with respect to address sanitizer. There are plenty of issues with it. They still haven't fix them. I have removed that particular option from CMS, but another option will probably show up. It's the way it is. Please talk to the Boost developers to fix the option parser :(
As for the memory leak -- I can't find it. Maybe it's an outdated/old/new/weird libz your are using? For my libz, there are no issues and I seem to be using libz correctly, i.e. according to the doc. So something may be off on your end? Please check again and if it still persists, maybe you can send me the input file that generated this? I cannot recreate the bug :(
@msoos Yes, I think it did have to do with libz.
I'm not sure if this is a Boost 1.69.0 issue, as I get:
but there does seem to be some issue in solverconf:
when it is reading in a large CNF of about 18million clauses. (The "89" is garbage, which changes between runs.)
GDB reports it gets stuck here:
Memory usage keeps going up indefinitely the longer it runs, so it seems to be a leak.