mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #758] LM problem w/ -fork #393
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#393
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 (Sep 25, 2014).
Original GitHub issue: https://github.com/openwall/john/issues/758
This is with latest jtrts commit (19ca304106ebebb5d0d9b717adc2cb4626cc9808) and latest bleeding-jumbo commit (
4454406210)@frank-dittrich commented on GitHub (Sep 25, 2014):
I get
with a GCC build (OMP enabled) when I pass --fork=3.
@jfoug commented on GitHub (Sep 25, 2014):
I get lm fails on GCC build, OMP -fork=3
JtR/bleed/test$ ./jtrts.pl -noprelims -passthru '--fork=3' -q
.......
form=lm guesses: 1493 -show=2992 0:00:00:00 DONE : Expected count(s) (1500)(-show3000) [!!!FAILED!!!]
.pot CHK:lm guesses: 1487 -show=2987 0:00:00:00 DONE : Expected count(s) (1500) [!!!FAILED!!!]
NOTE, if I just run against lm, I get LM failures, then LM working, then lm_pwdump working sometimes and failing others.
The runs are inconsistant. I do not think this is a problem with TS, it is something between LM and fork mode.
@magnumripper commented on GitHub (Sep 25, 2014):
I can't reproduce (on x86-64 OSX). Note that the exact number for "guesses" is supposed to vary "randomly" depending on how many dupe cracks you happened to get, but the -show figure should not vary at all.
In general, issues like this "can't" really be due to -fork. Basically a forked process is no different than a -node process - there is virtually no fork specific code anywhere in john after the cracking has started. But -fork may reveal a bug that happened to hide without it.
@jfoug commented on GitHub (Sep 25, 2014):
Run this over and over again, and see if you get failures at times:
./jtrts.pl -noprelims -passthru '--fork=3' lm
On my ubuntu-64 (OMP build), sometimes it works properly, sometimes not. Yes, I understand that guesses will vary, but show should not, but I am seeing that at times jtr is NOT cracking all the hashes. I have not looked any deeper than showing that I see the exact same thing Frank is seeing.
@magnumripper commented on GitHub (Sep 25, 2014):
Nope, but I made a for loop with increasing fork count and found I can trigger it with sufficiently high number of forks.
Indeed, three hashes are not cracked. So this is some problem in JtR.
I can't seem to trigger the problem when using
-node=1/9instead of-fork=9... and I did try 2/9 and so on too.@magnumripper commented on GitHub (Sep 25, 2014):
I have verified that this problem exist in versions prior to our recently added self-tests. So they are not causing it.
@magnumripper commented on GitHub (Sep 25, 2014):
What scares me the most is that this is not likely a problem with LM at all. It might be wordlist mode vs. node/fork, or perhaps pot sync.
@frank-dittrich commented on GitHub (Sep 25, 2014):
Yes, I also get a varying number of guesses when I repeatedly run
1st run:
2nd run:
@magnumripper commented on GitHub (Sep 25, 2014):
This is too hard to debug using gdb or the like. We should probably use git-bisect.
@magnumripper commented on GitHub (Sep 25, 2014):
Core John does not seem to have the issue (but TS has an issue https://github.com/magnumripper/jtrTestSuite/issues/17 when trying)
@magnumripper commented on GitHub (Sep 25, 2014):
git-bisect is a piece of work. Here's the offending commit:
1f827c7aOuch! This doesn't make it easy.
@magnumripper commented on GitHub (Sep 25, 2014):
OK so it happens during -fork with a shared memory mapped buffer but per-node indexes (of each node's words in that shared buffer). But how can it be intermittent!?
@frank-dittrich commented on GitHub (Sep 25, 2014):
And what causes only LM tests to fail? For --fork=2 ... --fork=14, I only see lm and pwdump_lm tests fail.
@magnumripper commented on GitHub (Sep 25, 2014):
Not sure if that's worth contemplating yet.
I tried disabling mmap() and the bug is still there. So it's not about the shared memory map but the per-node index buffer. That's a relief.
@magnumripper commented on GitHub (Sep 25, 2014):
I was wrong - we don't use any index buffer unless rules are involved. So what we have is a shared memory buffer, and mgetl() instead of fgetl(). But I tried disabling mmap() and bug still shows, which means we are just using fgetl() and no magic. We practically do not use anything that was touched in that commit. So what the heck is wrong!? And how come it was introduced with that patch?
@magnumripper commented on GitHub (Sep 25, 2014):
OK, it's not that commit! If I check out the commit before it, and add -mem=1 to disable memory buffering, the bug shows up!
Back to bisecting. But this was a relief!!
@magnumripper commented on GitHub (Sep 25, 2014):
0b870fais bad. The problem is I do not have any good commit because0b870fais the very merge from core that implemented -fork. So we can't bisect this. I need to re-test core.@magnumripper commented on GitHub (Sep 25, 2014):
I really can't trigger the bug in core.
@magnumripper commented on GitHub (Sep 25, 2014):
OK I'm puzzled. I now tested bleeding-jumbo but with a wordlist.c from core John, just modified a tad for autoconf so it builds.
Whatever the bug is, it's not in wordlist.c
@magnumripper commented on GitHub (Sep 25, 2014):
bd10920is the latest merge from core. That's the version to focus on - what differences do we have that can have this result?@magnumripper commented on GitHub (Sep 25, 2014):
Not true! If I use wordlist.c from core, in a bleeding-jumbo of
bd10920, bug goes away. To use it I had to insert this line:Weirdest thing, the same operation does not make the bug go away in HEAD of bleeding-jumbo.
@magnumripper commented on GitHub (Sep 25, 2014):
I officially give up here, for now.
@magnumripper commented on GitHub (Sep 26, 2014):
Heureka, I found a way to trigger it without using fork.No, that just showed I'm too tired. I will give up now.
@frank-dittrich commented on GitHub (Sep 26, 2014):
IMHO its not an issue with locking the pot file.
I ran
and
Let's see what has not been cracked in the --fork=11 run:
@frank-dittrich commented on GitHub (Sep 26, 2014):
I can reproduce the bug with Markov mode.
Then I created a Markov mode that should crack 1498 out of those 1500 passwords:
I verified that this Markov mode works as expected:
Then I tried --fork:
As with wordlist mode, the number of cracked passwords varies when I run the same command repeatedly.
@jfoug commented on GitHub (Sep 26, 2014):
Should we focus on the obvious? LM built with OMP has some issues (somehow) with -fork
@frank-dittrich commented on GitHub (Sep 26, 2014):
With --single=none and user name = password,
I am not able to reproduce the error.
I guess that's due to the fact that in this case it's not the list of password candidates that gets split across "nodes".
When I change 1499 user names into AB and use this as single mode
I can reproduce the error using single mode:
@frank-dittrich commented on GitHub (Sep 26, 2014):
On 09/26/2014 04:07 PM, JimF wrote:
Since I reproduced this with clang (which doesn't support OMP), it is
not related to OMP.
And so far we couldn't reproduce it in core.
So, LM triggers it either because it is extremely fast (which helps to
trigger race conditions) or may be because hashes are split into 2 halves.
If it is because hashes are split, we should be able do reproduce this
with bigcrypt (descrypt) hashes. But I doubt that is the issue.
@frank-dittrich commented on GitHub (Sep 26, 2014):
BTW:
I can reproduce the issue not just with the pw.dic from jtrts, but also with this file (containing almost 10 million password candidates of length up to 7 and converted to upper case:
I created it like this:
So the error does not depend on the high frequency of valid password candidates in the worlist file.
@magnumripper commented on GitHub (Sep 26, 2014):
Hmm so we have indications we only miss right-side hash halves? That is very interesting. We could make a file with all the same hashes but in raw single-hash-per-line format instead of pwdump and see what happens.
@magnumripper commented on GitHub (Sep 26, 2014):
Nope, that was not it. Same problem. Also, using an infile completely lacking dupe halves does not help.
@magnumripper commented on GitHub (Sep 26, 2014):
Maybe we should make a much bigger input file, and run it with lots of threads many times with core John so we really rule it out.
@magnumripper commented on GitHub (Sep 26, 2014):
I ran core with 500,000 hashes and 2-30 forks, it didn't miss a beat.
@magnumripper commented on GitHub (Oct 3, 2014):
Right now I have this without even using fork
This is with JtR
0ffc0c68dand TS magnumripper/jtrTestSuite@beadda6f. I'm probably just being dumbforked now? Better not even try to do anything.EDIT: The above problem was due to a john.local.conf enabling UTF-8 and other things. Another footgun!
@frank-dittrich commented on GitHub (Oct 5, 2014):
Tests with non-OMP-builds (as well as with OMP_NUM_THREADS=1) suggest that the number of forked processes must be greater than the number of physical CPUs (or at least some of the CPUs must be busy with some other work) to cause failed tests.
@frank-dittrich commented on GitHub (Oct 10, 2014):
Funny enough, the change that "fixes" issue #798 helps to avoid this bug as well.
@magnumripper commented on GitHub (Oct 10, 2014):
Yeah but the bug can be seen long before pot reload was implemented at all. So this only changes the playground a little.
@frank-dittrich commented on GitHub (Oct 10, 2014):
Could other bugs that meanwhile have been fixed have caused this problem before pot reload has been implemented?
@magnumripper commented on GitHub (Oct 11, 2014):
I think not. I'm pretty sure I already tested the very commit before pot reload was introduced (because it is a "usual suspect") and the bug was there.
@frank-dittrich commented on GitHub (Oct 11, 2014):
Then may be you did something wrong.
Even with ReloadAtCrack = Y, your latest commit
3b4c29f471fixes that problem for me.But when I checkout
479a6ea7b2, the bug still exists.@frank-dittrich commented on GitHub (Oct 11, 2014):
This bug seems to be related to #798.
With latest bleeding-jumbo, I (rarely) get the problem with the number of forked processes close to the number when bug #798 occurs:
In this case, --fork=663 cracked just 1499 hashes.
@frank-dittrich commented on GitHub (Oct 11, 2014):
At least, john now behaves in a consistent way:
Which reminds me of http://www.despair.com/consistency.html
@frank-dittrich commented on GitHub (Oct 12, 2014):
With this john.local.conf
I manage to get less than 1500 unique john.pot lines only if I hit the ulimit of (in my case currently 1024) processes per user.
That looks like this:
So I guess I'll kep that john.local.conf ans issue a
Whenever I want a pot file sync.
@magnumripper commented on GitHub (Oct 12, 2014):
I think we should fix (or at least consider) https://github.com/magnumripper/jtrTestSuite/issues/20 before going on with this.
@magnumripper commented on GitHub (Oct 12, 2014):
Anyway, I can not reproduce this bug on OSX anymore, even with default john.conf. Except when I go past ulimits.
@magnumripper commented on GitHub (Oct 12, 2014):
However, I can reproduce it using
9d9c271(and -mem=1) which was before there was any pot reload or USR2 signalling at all.@magnumripper commented on GitHub (Nov 7, 2014):
Can you reproduce this with current code?
@frank-dittrich commented on GitHub (Nov 8, 2014):
Before Monday I'll not have access to the system where I want to do the re-test.
@frank-dittrich commented on GitHub (Nov 9, 2014):
So, I need a much higher number of forked processes to reproduce this.
But the number of forked processes (> 300, but < 400 on an otherwise idle system)is still way lower than the
ulimit -u(1024).I get no indication of errors in log files, in stderr or stdout output or exit code.
@magnumripper commented on GitHub (Nov 9, 2014):
Trying the same on OSX, it works fine up to 572, and from that point the problem can be seen in the stderr file: "fork: Resource temporarily unavailable". So I can't reproduce any problem with John. That's with an ulimit of 709 max user processes.
@frank-dittrich commented on GitHub (Nov 9, 2014):
When I change
Save = 60toSave = 62in john.conf, the error occurs much later:Still no indication of an error in
*.log stderr-*.txt stdout-*.txt.Can you try
schedtool -a 0x1 -e ./john ...instead of./john?@magnumripper commented on GitHub (Nov 9, 2014):
I do not have anything named schedtool.
@magnumripper commented on GitHub (Nov 9, 2014):
I can't see why the Save timer would affect this. No session runs for that long anyway, right?
@magnumripper commented on GitHub (Nov 9, 2014):
OK, it's because OS_TIMER counts backwards.
@frank-dittrich commented on GitHub (Nov 10, 2014):
With
Save = 2I get@frank-dittrich commented on GitHub (Nov 10, 2014):
On 11/09/2014 11:38 PM, magnum wrote:
I bet with less than 572 forks, john finishes in less than 1 second on
you OSX system, so you don't get the signals when 59 seconds of the 60
are left.
@frank-dittrich commented on GitHub (Nov 10, 2014):
On my 64bit Linux system with an Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (quad core, no hyperthreading) I manage to get the john killed with SUGUSR2 at 761 forked processes (with Idle=Y in john.conf, when I run 4 other john processes (with Idle = N in john.conf) trying (not) to crack the rar test hashes:
./john --incremental --min-length=6 hashes.rar --session=rar4...And some tests with a smaller number of forked processes exited with $? = 0, but less than 1500 unique hashes cracked.
@frank-dittrich commented on GitHub (Nov 10, 2014):
As
root, withulimits -u= 7794 (compared to 1024 as a regular user), nothing changes.With some more changes in ulimits
I get
So, this is most likely not related to ulimit.
@magnumripper commented on GitHub (Nov 10, 2014):
I bet https://github.com/magnumripper/JohnTheRipper/issues/798#issuecomment-62325144 would make it much better, (at least provided you don't use a Save interval that is a multiple of 3).
@frank-dittrich commented on GitHub (Nov 10, 2014):
I tested with the default Save interval of 60, which is a multiple of 3. Why do you think that matters here? All these test runs are much faster than 60 seconds, even on my old 32bit system.
No indication of problems in log file, stderr or stdout output.
So, the improvement is similar to what I got when I use
Save = 60without that patch.@frank-dittrich commented on GitHub (Nov 10, 2014):
BTW, the
--fork=717test that got killed produced a john.pot file with 1500 unique hashes.@magnumripper commented on GitHub (Nov 10, 2014):
Because, like you found out, without that patch and with OS_TIMER, some things would happen after 0 seconds instead of after three seconds. Maybe that is unrelated.
@frank-dittrich commented on GitHub (Nov 10, 2014):
Yes, but that was without the patch.
With
Save =60, after one second, you'd get the SIGUSR2 signals, because59 & 3 == 3.With your patch, you'd get the SIGUSR2 signals 2 seconds later, no matter if you have
Save = 60orSave = 62.(60 - 57) & 3 == 3and(62 - 59) & 3 == 3.@magnumripper commented on GitHub (Nov 11, 2014):
I had the vague idea that under this crazy over-booking of resources there could be a difference. But now that I think about it, we should already be "protected" against USR2 anyway: The real key is calling sig_init() and sig_init_child() early enough and this doesn't change that. I can't think of any way to do those earlier than we do now iirc.
@magnumripper commented on GitHub (Nov 11, 2014):
On the other hand, if we indeed introduce yet another counter instead of using
((timer_save_interval - timer_save_value) & 3) == 3), we could also opt to never ever send a USR2 during the first minute, or whatever we choose.@magnumripper commented on GitHub (Nov 11, 2014):
Anyway we put it, I think this issue and #798 are purely academical. If we can find solutions for them, fine. If we can't, I will not lose any sleep over it.
@magnumripper commented on GitHub (Mar 19, 2015):
I'm closing this. If some similar problem can still be triggered, please open a brand new issue. This issue is too clobbered anyway.