mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2376] dmg formats, memory leak #1586
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#1586
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 @solardiz on GitHub (Jan 4, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2376
Originally assigned to: @solardiz on GitHub.
dmg-opencl leaks memory, e.g. at around 1 GB per hour when running on super's -dev=6 (Titan X), or accordingly slower on super's slower devices.
@magnumripper commented on GitHub (Jan 5, 2017):
After a super quick look at the code I'm willing to bet this is an OpenSSL problem. We shouldn't ever had let high-level crap into Jumbo.
@kholia commented on GitHub (Jan 5, 2017):
I tested dmg-opencl under Valgrind but no memory errors related to OpenSSL code were found. I am now wondering where the memory leak is.
valgrind-dmg-opencl-report.txt (test report)
@magnumripper commented on GitHub (Jan 5, 2017):
Our handling of OpenCL buffers looks correct to me. There could be a bug in the OpenCL runtime though. @solardiz did you see this with AMD too?
@solardiz commented on GitHub (Jan 5, 2017):
On Thu, Jan 05, 2017 at 10:02:18AM -0800, magnum wrote:
Yes, the memory leak occurs with AMD too.
@magnumripper commented on GitHub (Jan 6, 2017):
Strange. We should have the same problem (but slower) in the CPU format.
@solardiz commented on GitHub (Jan 6, 2017):
On Thu, Jan 05, 2017 at 04:52:44PM -0800, magnum wrote:
Oh, and we do. On super, memory usage of the "dmg" format grows in ~250 KB steps every minute of real time or so (or once per half an hour of CPU time). Or maybe at a different or changing pace, as I just saw it grow by 4 MB in 3 minutes while typing this message. That's for:
Loaded 4 password hashes with 4 different salts (dmg, Apple DMG [PBKDF2-SHA1 128/128 AVX 4x 3DES/AES])
Loaded hashes with cost 1 (iteration count) varying from 117647 to 161290
Will run 32 OpenMP threads
@jfoug commented on GitHub (Jan 6, 2017):
The way this sounds, it is almost certainly some high level oSSL object not properly being cleaned up. Unfortunately, I have no time at all to dig into coding at this time (real work gets in the way this time of year).
@magnumripper commented on GitHub (Jan 9, 2017):
@solardiz's iteration counts indicate they are version 2 hashes (
$dmg$2). While debugging this it's a good idea to change the iteration count of test hashes to 1 (last field in ciphertext) for much faster leaks even with the CPU format.I can't reproduce any leak at all under Ubuntu 16.04 w/ OpenSSL 1.0.2g. I'll try debugging a little on super but it may boil down to some bug in OpenSSL, fixed in later versions. However, I saw now that we actually don't use any "high level" code in this format (other than the single function to perform a triple DES). There really shouldn't be any alloc in those functions and there doesn't seem to be any cleanup function we're missing.
@magnumripper commented on GitHub (Jan 9, 2017):
Super's OpenSSL is "1.0.1e-fips 11 Feb 2013"
@magnumripper commented on GitHub (Jan 9, 2017):
Hmm I can't see any leaks on Super either?
I'm using test hashes derived like this:
I ran them on 24 threads for several wall-clock minutes. Stayed at 301m virt, 20m res [SIC - I despise the lower-case "m" notation].
@magnumripper commented on GitHub (Jan 26, 2017):
@solardiz could I get access to those hashes (right on super)? If that's not possible, could you try something like this for me?
@solardiz commented on GitHub (Jan 26, 2017):
These leak memory for me:
@magnumripper commented on GitHub (Mar 17, 2017):
Here's a file with random data matching yours
Iterations are set to just 8 so this should leak much faster. In fact this makes the CPU format as fast as the GPU format - the PBKDF2 speed gets insignificant compared to the rest.
@magnumripper commented on GitHub (Mar 17, 2017):
Using that file on super, I still can't reproduce. I consistently see a single increase in resident size (eg. from 19 to 21 MB for CPU format) after a minute or so, then nothing more.
@magnumripper commented on GitHub (Mar 17, 2017):
I tried building with and without
scl enable devtoolset-3 bash. I didn't use any OMP tweaks with environment variables. I watched resident size using top. Why do you see a leak where I do not?@magnumripper commented on GitHub (May 9, 2018):
Someone should re-test this with latest code. While the CPU formats still may show the problem, I'm pretty damn sure the GPU format doesn't. It's completely rewritten and has no CPU post-processing.
@solardiz commented on GitHub (Nov 16, 2025):
This isn't detected during all-formats
--test(including CPU and OpenCL) by gcc's LeakSanitizer on Debian 13 as tested in #5893. So I'm closing this issue for now.