Closed izbyshev closed 8 years ago
@izbyshev The assert was added by me in 6c966bba59677589fbaf76d6c29a8aceab70eaa6 . There was a bug in the bounds check which meant out of bounds writes would happen.
Unfortunately I don't think usable ASan builds of Z3 on x86_64 are possible yet. I first reported the problem in #436 (sorry the issue is rather long because it took me rather a long time to find the underlying issue).
See https://github.com/Z3Prover/z3/issues/436#issuecomment-184713859
for an explanation of the issue.
@wintersteiger any progress on a fix?
@delcypher, @izbyshev. I have somewhat limited ability to test this fix fully. Therefore, so far it is a pull request. If you get any chance to try it out, it will be appreciated.
@delcypher Thank you for your response! Sorry that I didn't mention that my debug build was with ASan. I've checked that a normal debug build doesn't fail on my test. @NikolajBjorner Thank you for the patch! I'll have a chance to test it tomorrow, but I've added several comments.
I confirm that #722 fixes debug+asan build on my tests as well. Thank you very much!
After moving to larger tests, I've found a problem in #722. When clause_allocator::del_clause()
is called, mapping for cls->id()
is not removed from m_last_seg_id2cls
, so a stale pointer is reused when get_clause()
is called with corresponding offset. I've checked that adding m_last_seg_id2cls.remove(cls->id());
to del_clause()
fixed the problem.
Sweet, thanks for the quick test, report, and fix! That was indeed a blatant omission on my part, I added that to the PR now.
PR has been integrated.
Debug build of Z3 (e8141aaa84bb47a927282ce0318686fd12c7b2f9) reports the following assertion failure when given query.txt as input.
The stack trace follows.
I know that at least 4.4.1 release has this issue on the same input, but it seems there was no assertion back then, so it was caught by address sanitizer as "heap-buffer-overflow" instead.