I got a free: invalid pointer when running my project. But when I try to hunt the root cause using -fsanitize=address, the error disappears. When I remove the sanitizer, the error appears again. Can anyone give some hint about what was happening and how to pinpoint the problem in such a case? Thanks!
Update:
I understand it is hard to give suggestions without code. As the project is pretty big and I am still trying to build a minimal working example, I cannot provide any code right now. So I would like to change my question to a more general one:
According to my understanding of address sanitizer, it should track all allocation/access operations and report error if there is any invalid access. So if there is an error when not applying address sanitizer, the error should be still there after applying sanitizer. Is this understanding correct?