mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #739] Unable to run a john -test=0 (on bull) #377
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#377
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 @ghost on GitHub (Sep 12, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/739
Local worksize (LWS) 7, global worksize (GWS) 49
Testing: o5logon-opencl, Oracle O5LOGON protocol [SHA1 OpenCL AES 32/64]... OpenCL error (CL_INVALID_COMMAND_QUEUE) in file (opencl_o5logon_fmt_plug.c) at line (350) - (failed in clFinish)
@magnumripper commented on GitHub (Sep 12, 2014):
I can't reproduce. This is
906b38eb:@magnumripper commented on GitHub (Sep 12, 2014):
Hmm but my test above was with
--format=o5logon-opencl. How did you run it and what device did you use?@ghost commented on GitHub (Sep 12, 2014):
I'm trying to reproduce now. But I'm not able too. I guess I run one of these:
Maybe I was not alone during my test and someone bugged my run.
Sorry.
Posting what I'm seeing (just to keep a full log). o5logon-opencl is Ok.
On a clean build:
../run/john -te=0 -form=opencl -dev=0
[...]
Local worksize (LWS) 7, global worksize (GWS) 49
Testing: PBKDF2-HMAC-SHA256-opencl [PBKDF2-SHA256 OpenCL]... PASS
Segmentation fault
@magnumripper commented on GitHub (Sep 12, 2014):
Yeah I saw that segfault too, regardless of device used. That's weird.
@magnumripper commented on GitHub (Sep 12, 2014):
That segfault is #726
@ghost commented on GitHub (Sep 12, 2014):
I see. I tried everything, o5logon-opencl seems to be ok now.
I might missed some recent commit while testing (now I tested using 'bleeding-jumbo master').
@ghost commented on GitHub (Sep 27, 2014):
Better to keep this open.
Also, it seems to be intermitend, but (if I remove the raw4, I see the same error for raw5:

@magnumripper commented on GitHub (Oct 2, 2014):
I tested bleeding as of
0ad08c6on Super and it still hung the driver and eventually rebooted. I regard that a driver bug though.@ghost commented on GitHub (Oct 2, 2014):
I will wait for a driver update to look closer. (I am not able to reproduce it here and on bull).
In
0ad08c6, GCN is running legacy code (I mean, what is good on bull: because that was tested). Your real test shows it works with poor performance on real hardware. But bull insists: legacy is what is good.Meanwhile, I have to trust bull. I have no choice (I mean hardware).
BTW: this bug #739 was seen in http://www.openwall.com/lists/john-dev/2014/09/29/2
@ghost commented on GitHub (Oct 2, 2014):
My feeling is that #739 is related to OpenCL memory management. Why portability?
-It seems random: happened once with o5logon, happens with raw-md*.
@magnumripper commented on GitHub (Oct 2, 2014):
I changed from 'bug' to 'portability' because I believe these are just driver bugs that we can work around or opt to ignore.
@ghost commented on GitHub (Oct 2, 2014):
If I run
john -te:0 -form:opencland evaluate it using top, I can see that memory usage increases. Up to the moment I see the crash.But if I apply any of these patches, JtR works (and memory usage does not increase). My conclusion, there are formats ignoring their homework.
@ghost commented on GitHub (Oct 2, 2014):
MEM_DBG could be used to show which formats are failing to free their resources (?).
@magnumripper commented on GitHub (Oct 2, 2014):
Maybe. Valgrind might be a safer bet, as memdbg is not guaranteed to have control over OpenCL allocations.
@jfoug commented on GitHub (Oct 2, 2014):
I use memdbg quite often. There should be few memory leaks left. It will NOT show what I deem as improper usage, which is many alloc_memory_tiny on transient data. That IS a leak since alloc_mem_tiny holds the memory until program exit.
However, I HAVE NOT done much memory leak testing on GPU formats. So they are likely ripe with problems.
@magnumripper commented on GitHub (Oct 2, 2014):
Hmm not sure what happened here. This on my OSX, using CPU device for OpenCL
Why did it stop there?! There are plenty more formats.
@magnumripper commented on GitHub (Oct 2, 2014):
Besides, line 145 of rar5 is
But we do have this in done()
@ghost commented on GitHub (Oct 2, 2014):
I can say that there are formats in the beginning of the run that are nightmares.
I'm not sure if my test is really good, but you can use it to check only rar5. The leak could be in previous format, detectd in rar5. How knows?
@ghost commented on GitHub (Oct 2, 2014):
BTW, please, review 0eba7dbb8fc2fc2e4968cbe34856cef465ab19e5
@magnumripper commented on GitHub (Oct 2, 2014):
I think 0eba7db is incorrect. We put
libc_freethere for a reason. IIRC that memory was not allocated by us (sometimes by an OpenCL driver), so we can't use MEM_FREE()@magnumripper commented on GitHub (Oct 2, 2014):
OK, rar5-opencl actually had a problem and memdbg caught it. crypt_key was indeed freed in done() but it SHOULD be freed in release_clobj().
@magnumripper commented on GitHub (Oct 2, 2014):
Some missing memdbg headers added. Now a "-test=0 -form:opencl" passes on my laptop with no problems. The only real problem found was that rar5 one (but that was a good find).
@magnumripper commented on GitHub (Oct 2, 2014):
Still fails at raw-md4 on Bull (GTX570). The weird thing is that even a format that does not free its memory should not cause much trouble at a GWS of 49.
@magnumripper commented on GitHub (Oct 2, 2014):
BTW, apparently memdbg stopped by design right after seeing the RAR5 problem. I have no objections to that at all, I just did not know it! That was not the case earlier.
@magnumripper commented on GitHub (Oct 2, 2014):
Using the Tahiti (still on Bull), no problem is seen. Changing to "Portability" again 👯
@ghost commented on GitHub (Oct 2, 2014):
Just for the record, this was only seen/reported on NVIDIA hardware.
@magnumripper commented on GitHub (Oct 3, 2014):
I have looked at these patches several times now but I do not really understand what they do. Can you describe what significant change they introduce, and some theory about why that changes the scene?
@ghost commented on GitHub (Oct 4, 2014):
The regular work done by john is:
. JtR calls each format one time to get its bench numbers/test result.
The patch attached above does not "increment" the format. I mean, the same format is called 46 times (N is from my memory, could be 48, 56, I'm not sure.).
My assumption:
The next step is find one of this 'bad' formats, test them as I did for sha256, check if they (in fact) behaves badly using this kind of patch. If so, my assumption is correct and the test is valid.
@ghost commented on GitHub (Oct 4, 2014):
[edit]
on a regular run, there are formats that seems to be increasing memory usage A LOT over time.
@magnumripper commented on GitHub (Oct 4, 2014):
Well it's not any normal alloc that lacks a free() because memdbg would have told us. And I just grep'ed for mem_alloc_tiny() in all OpenCL formats and I can't see it being used for anything inappropriate. And the problem is only seen with the GTX570. On the Tahiti, size grows and shrinks again for each format.
But it could be that we have some format(s) missing some details.
Maybe nvidia takes a larger hit from that than the AMD. Or maybe this is not it at all.
@ghost commented on GitHub (Oct 4, 2014):
For example, I get two different formats and tested them. Below, the situation just before john finishes. The first one goes up to 1GB in RES memory. The other, the increasing process does not occur.
@ghost commented on GitHub (Oct 4, 2014):
Lets see if we can find a 'bug' in the first format.
@ghost commented on GitHub (Oct 4, 2014):
Please, commit your fix/findings now (if possible).
@magnumripper commented on GitHub (Oct 4, 2014):
All three of Sayantan's formats listed above seem to actually release their kernels, but in other files. bcrypt and mscash2 don't seem to release their "program" though. I hate formats that are split in several files, they call for the use of an IDE and I don't want to use one.
@magnumripper commented on GitHub (Oct 4, 2014):
Not even descrypt-opencl releases its program in done(). It calls clReleaseProgram() before building !? I do not dare touching that code.
@ghost commented on GitHub (Oct 4, 2014):
I tested a few formats (not all), only three of them failed (in memory management aspect).
@magnumripper commented on GitHub (Oct 4, 2014):
a85fa9efixes Sayantan's formats@magnumripper commented on GitHub (Oct 4, 2014):
...and this did not change a thing. Still crashes at raw-md4
@ghost commented on GitHub (Oct 4, 2014):
I'm looking on bf. There is something else.
@ghost commented on GitHub (Oct 4, 2014):
And now, bf behaves:

@ghost commented on GitHub (Oct 4, 2014):
This is a bug (or a result of Ctrl+C, Ctrl+V). You should assign it to @Sayantan2048
See:
dabfc46be8.BTW: at least in bf, I see no reason to have an event.
@ghost commented on GitHub (Oct 4, 2014):
I liked the 'self-test' created above. Can be useful to stress a format. A good integration test to have around.
Hint: will you guys put this as a new functionality?.
@magnumripper commented on GitHub (Oct 4, 2014):
We could have something like
--format=bcrypt-opencl --loop-testthat loops selected format(s) test and benchmark until ctrl-c.@magnumripper commented on GitHub (Oct 4, 2014):
Added
--stress-test[=TIME]in7ec88f8. Note that it can be used with a single format or classes, wildcards etc. Also note that you give this option instead of-test, not along with it. So TIME is the usual meaning as opposed to some kind of total loop time (it will loop until killed).@magnumripper commented on GitHub (Oct 4, 2014):
I agree. I see no need for it in descrypt either. Perhaps it's needed in mscash2 for multi-device, but I doubt that. What if you just drop that event stuff, does the problem go away?
@magnumripper commented on GitHub (Oct 4, 2014):
Three formats fixed in
635bbda@magnumripper commented on GitHub (Oct 4, 2014):
But it still crashes at raw-md4 😆
@magnumripper commented on GitHub (Oct 4, 2014):
BTW the event release bugs would be better seen in a standard
--test=60@magnumripper commented on GitHub (Oct 5, 2014):
The raw-md4-crash is now seen on Super too. And it happens even when running only that format, so that very format (and raw-md5 which is identical) is buggy.
@magnumripper commented on GitHub (Oct 5, 2014):
The pinned_partial_hashes vs. buffer_out is fishy. Two different buffers are used for the same thing. I need some rest now.
@ghost commented on GitHub (Oct 5, 2014):
This seems to do the trick for md4 (md5 still fails). Need to be really tested (tomorrow).
@magnumripper commented on GitHub (Oct 5, 2014):
The destination should be offset with
sizeof(cl_uint) * global_work_size(in bytes). Is that what we get from the above, due to pointer arithmetics? Are we guaranteed that is the case (ie. are we sure sizeof(cl_mem) is same as sizeof(cl_uint))? I have a feeling it's safer to use something like((void*)partial_hashes) + sizeof(cl_uint) * global_work_sizebut I may be wrong.@magnumripper commented on GitHub (Oct 5, 2014):
Or
((cl_uint*)partial_hashes) + global_work_size@ghost commented on GitHub (Oct 5, 2014):
I agree. But notice that it is
static cl_uint *partial_hashes;(not cl_mem)@magnumripper commented on GitHub (Oct 5, 2014):
Oh, you are right. Never mind then, I thought it was cl_mem.
@magnumripper commented on GitHub (Oct 13, 2014):
As of
bac35332