mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #980] memdbg reports mem leaks for rar format #581
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#581
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 (Dec 31, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/980
I used
on a 64bit linux system.
@jfoug commented on GitHub (Dec 31, 2014):
(bleeding-jumbo)run $ ./john --test=0 --format=zip
Will run 8 OpenMP threads
Testing: ZIP, WinZip [PBKDF2-SHA1 8x SSE2]... (8xOMP) PASS
Mem leak: 576 bytes, alloc_num 340, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 330, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 320, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 310, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 300, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 290, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 280, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 270, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 260, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 250, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 240, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 230, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 220, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 210, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 200, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 190, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 180, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 170, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 160, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 150, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 140, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 130, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 120, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 110, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 100, file zip_fmt_plug.c, line 359
Mem leak: 576 bytes, alloc_num 90, file zip_fmt_plug.c, line 359
@jfoug commented on GitHub (Dec 31, 2014):
Dyna salt, allocated type not cleaning up. I thought we had this working. I guess something happened.
@jfoug commented on GitHub (Dec 31, 2014):
After a couple changes to the dump_stuff messages used (for DYNA_SALT_DEBUG builds), to trim down some extra long lines of output, I get this for a -form=zip run
Run inside of VC. To me, it 'appears' that things should be working, BUT something is not being freed. At least the functions are being called. Now I can step and see why this is not freeing. But if you see in the end, that final free brings the allocated block count down to #0, so it 'should' have removed all objects. Obviously something is not actually freeing the memory properly, however.
@jfoug commented on GitHub (Dec 31, 2014):
Found the leak (I think). It is in new code @magnumripper just did for salt dupe check failure detection. He allocates a temp buffer large enough to hold the first salt. He then memcpy the salt into that buffer. Then he calls salt() again, and a compare is done. He then frees the memory buffer.
Well, it works, until you get to a dyna_salt item, where the salt itself is allocated. In that case, the free to the underlying object needs to be done. All the salt value JtR gets is a memory buffer that contains a pointer.
I will have to see how to fix this, but @frank-dittrich, good catch. I told ppl, that memdbg was useful. I will be adding some enhancements to memdbg, and dynasalt shortly also. It may all wrap up on one patch.
@jfoug commented on GitHub (Dec 31, 2014):
There was a dyna_salt_create() missing and a dyna_salt_remove() missing within the new code. Thus, we still 'appeared' to have a correct matching number of salt allocs, to match the salt frees, BUT there was a whole new salt() called, that was untracked. Actually, one was being freed, that did not match the one allocated, which is where I found the bug.
@jfoug commented on GitHub (Dec 31, 2014):
Fixed with
576888c@frank-dittrich please test.I have a larger enhancement coming shortly for memdbg and dyna_salt, but will hold off until I hear good or bad about this patch.
@frank-dittrich commented on GitHub (Jan 1, 2015):
Works for me, thanks.