mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1125] ASan error "attempting free on address which was not malloc()-ed" in debug build. #701
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#701
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @frank-dittrich on GitHub (Mar 19, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1125
This is on 64bit Linux, latest commit at time of test: commit
b1aab2545cAnd with --enable-memdbg in addition to --enable-asan:
@magnumripper commented on GitHub (Mar 19, 2015):
I too saw some strange effects of using ASan today. Perhaps it's not working really well together with our recent introduction of posix_memalign()?
I got some really random behavior with OpenCL and CUDA when using ASan (eg no devices seen at all, or random garbage seen in --list=cuda-devices). I also got some less critical version of what you posted, with a notice that I could disable it (in case of false positive) with some environment variable (which I did). BTW that one was from dynamic_fmt.c.
I'll check what gcc version that was.
@magnumripper commented on GitHub (Mar 19, 2015):
I also saw that reference to MEMDBG_off_free btw. Why is memdbg involved at all when memdbg is not in use? Perhaps we have some bug in that?
@frank-dittrich commented on GitHub (Mar 19, 2015):
When built without memdbg, it is MEMDBG_off_free, when built with memdbg, it is MEMDBG_free.
@magnumripper commented on GitHub (Mar 19, 2015):
Yes. I meant MEMDBG_off_free. Why is memdbg involved when I did not ask for it. The fact it's named
_off_doesn't really cut it. I want memdbg to not be involved at all unless I wanted it.@frank-dittrich commented on GitHub (Mar 19, 2015):
BTW, it is not just raw-sha1-ng format.
Probably it just depends on the alignment of the allocated buffer.
@magnumripper commented on GitHub (Mar 19, 2015):
After
d298640I see no problem whatsoever using ASan with gcc-4.9.2 under OSX and usingposix_memalign(). I think the machine I had problems with (some vanilla LTS Linux) were using gcc-4.8 at best, possibly 4.7. I'm pretty sure that system ended up usingaligned_alloc()- not sure that matters at all (should not).@magnumripper commented on GitHub (Mar 19, 2015):
I also see no problem using ASan with clang "Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)" (ending up using
posix_memalign())EDIT it turns out I do not get ASan with that compiler. The --enable-asan silently fails.
@magnumripper commented on GitHub (Mar 19, 2015):
I think we have now already established this is an external issue (ASan bug in older versions) but let's document it further. I am REALLY glad it did not end up a real problem with something else.
@magnumripper commented on GitHub (Mar 19, 2015):
Try a 32-bit build, that's much more likely to get alignment problems.
@jfoug commented on GitHub (Mar 20, 2015):
The MEMDBG_off_free() was added to 'mimick' MEM_FREE() behavior for times when free() was used vs MEM_FREE(). I know this was talked about a year ago. It would harm nothing to simply remove it, and let calls to free() be straight to free(), instead of being a macro wrapper checking for null and later setting pointer TO null.
@magnumripper commented on GitHub (Mar 20, 2015):
Hmm so what you are saying is the one that I see is not using MEM_FREE() but simply a free()? In that case it might be a good thing.
@jfoug commented on GitHub (Mar 21, 2015):
Yes, the simple free is a macro (in non memdbg mode). It behaves much like MEM_FREE. In that it is a macro that behaves the same . so I needed a function to use for free. That's the one you see
@magnumripper commented on GitHub (Mar 21, 2015):
Confirmed, it was gcc 4.8.2 (Ubuntu).
@magnumripper commented on GitHub (Mar 21, 2015):
But this was in dynamic_fmt.c line 861
...which is using MEM_FREE(), not free(). So why is our namespace clobbered by memdbg?
@jfoug commented on GitHub (Mar 21, 2015):
Likely the define for free is happening prior to the define of MEMFREE. I'm not where I can look at the code (out at my camp)
@magnumripper commented on GitHub (Mar 21, 2015):
That is what I'm worried about. Perhaps it ends up like
or something like that. That would likely be optimized to something sane though.
@magnumripper commented on GitHub (Mar 30, 2015):
This was fixed with
fc552453, right?@frank-dittrich commented on GitHub (Mar 30, 2015):
Yes, looks like it is fixed now. At least I am unable to reproduce the problem.