mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2062] Segfault in rar format (memdbg build) #1383
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#1383
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 (Feb 22, 2016).
Original GitHub issue: https://github.com/openwall/john/issues/2062
Originally assigned to: @jfoug on GitHub.
I get the same error on ARM NEON and on x86-64, but only with memdbg enabled.
Not every random seed seems to produce a segfault, but -seed=10999 "works for me".
@frank-dittrich commented on GitHub (Feb 22, 2016):
When running john repeatedly with --max-run-time=N added (to reduce the test case), I finally got
Same test within gdb end with
@frank-dittrich commented on GitHub (Feb 22, 2016):
On super with
scl enable devtoolset-3 bash(and --enable-memdbg --disable-cuda --disable-opencl):@magnumripper commented on GitHub (Feb 22, 2016):
Unless you can reproduce without memdbg and/or running single thread I'm very suspicious that memdbg is the actual culprit. This format makes very heavy use of alloc/free, in threads...
@frank-dittrich commented on GitHub (Feb 22, 2016):
Yes, I already noticed that non-memdbg builds didn't have that error. Also, with ASan, I couldn't reproduce this.
Now I try a non-omp memdbg build.
Most likely, you are right, and the problem is somewhere within memdbg.
Any idea which other format might be used to expose the same memdbg bug(s)?
Or could that be related to different threads cracking the same hash and trying to release the same memory?
@magnumripper commented on GitHub (Feb 24, 2016):
I think there is some old closed issue (or issues) for thread safety in memdbg.
They would not use the same memory. It's allocated and freed locally within each thread.
@magnumripper commented on GitHub (Feb 24, 2016):
Looks like #843 was about thread safety in memdbg
@jfoug commented on GitHub (Mar 18, 2016):
Made some changes to realloc, and free. I think the problem is simply that memdbg was finding a problem, trying to report it, BUT causing a crash. Now I am down to this:
@jfoug commented on GitHub (Mar 18, 2016):
I am following the path, that the bug is in rar format.
Under VC, once I removed the MEM_DBG stuff, I get this message in my crash:
So to me, it looks like there is some allocations happening somehow that are NOT done through memdbg. Within VC, all allocation has to be done with _alligned_malloc, etc el since _aligned_free does NOT work on memory allocated by free.
So I will continue forward, but in the end, it may simply be this is showing up on memdbg builds, simply because we are failing to include header files properly.
@jfoug commented on GitHub (Mar 19, 2016):
There is a bug in in MEMDBG_realloc. I changed it to this:
And things work fine. This is not 100% 'exactly' realloc, BUT it does do exactly what realloc is supposed to do. So I am making this 'simple' function the current one.