Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <007301ce20bd$6dedeca0$49c9c5e0$@yahoo.com>
Date: Thu, 14 Mar 2013 15:08:39 +0100
From: "Costin Enache" <e_costin@...oo.com>
To: <john-dev@...ts.openwall.com>
Subject: RE: clock err in timers (alarm, status ...) and fix

Err, a timer set at 10 sec will abort after approx. 15 sec. See below:


uname -a
Linux ea1 3.2.0-4-amd64 #1 SMP Debian 3.2.35-2 x86_64 GNU/Linux
ldd --version
ldd (Debian EGLIBC 2.13-37) 2.13
git clone git://github.com/magnumripper/JohnTheRipper -b bleeding-jumbo
JohnTheRipper-x

If I build with "make linux-x86-64-native", then I get this:
./john x --format=des --max-run-time=20 --progress-every=5         
Loaded 1 password hash (Traditional DES [128/128 BS SSE2-16])
guesses: 0  time: 0:00:00:04 0.00% (3)  c/s: 2228K  trying: 0563849 -
0563207
guesses: 0  time: 0:00:00:09 0.00% (3)  c/s: 2524K  trying: ml9948 - ml91es
guesses: 0  time: 0:00:00:14 0.00% (3)  c/s: 2633K  trying: scrrann1 -
scrrarth
guesses: 0  time: 0:00:00:19 0.00% (3)  c/s: 2697K  trying: kodgme - kodn19
guesses: 0  time: 0:00:00:21 0.00% (3)  c/s: 2704K  trying: 26749553 -
26749605
Session stopped (max run-time reached)

With "make linux-x86-64-opencl" I get this:
./john x --format=des --max-run-time=20 --progress-every=5
Loaded 1 password hash (Traditional DES [128/128 BS SSE2-16])
guesses: 0  time: 0:00:00:06 0.00% (3)  c/s: 2292K  trying: ggotiN - ggot33
guesses: 0  time: 0:00:00:14 0.00% (3)  c/s: 2566K  trying: mecyg - mew!i
guesses: 0  time: 0:00:00:21 0.00% (3)  c/s: 2671K  trying: 29637545 -
29637357
guesses: 0  time: 0:00:00:28 0.00% (3)  c/s: 2720K  trying: Sod47 - Soa9s
guesses: 0  time: 0:00:00:30 0.00% (3)  c/s: 2727K  trying: koty89 - kotyg5
Session stopped (max run-time reached)

In the first case, OS_TIMER=1,in the second one OS_TIMER=0 (as per arch.h,
disabled for OpenCL). I guess we should have some more precise timers for
OpenCL builds too :)

Cheers,
Costin

-----Original Message-----
From: Solar Designer [mailto:solar@...nwall.com] 
Sent: 14 March 2013 10:50
To: john-dev@...ts.openwall.com
Subject: Re: [john-dev] clock err in timers (alarm, status ...) and fix

On Thu, Mar 14, 2013 at 09:15:27AM +0100, Costin Enache wrote:
> John uses for the alarm, status, save and probably other timers the
> sysconf(_SC_CLK_TCK) value, which, at least on Linux, is hard coded to 
> a value of 100.

Actually, it varies by arch, and glibc obtains the value from the AT_CLKTCK
element in the auxiliary vector passed by the kernel on the stack of the
newly started program.  (This avoids having to make a syscall to find this
value out from the kernel.)  The hard-coded value of 100 in glibc is only a
fallback for the case that AT_CLKTCK is somehow not present.  On recent
kernels, this fallback should not be occurring.

Then, this value is not used by JtR as extensively as you seem to imply.
It is used to convert the values returned by times(2) to seconds.
I think this is correct.  It is also used in a few other places (relatively
unimportant), but it is not used for setting up timer intervals with the
kernel.  Instead, TIMER_INTERVAL (normally 1) is passed directly into
setitimer() via the tv_sec field.

> This means that the timers do not really work. On my system, an abort 
> timer set at 10 sec will abort after approx. 8 seconds.

Hmm.  Does your system somehow use HZ=125?  What arch?  What kernel build? -
a distro's or your custom (is the config custom too)?  What glibc version
and build?

Does your build of JtR have OS_TIMER enabled?

Thanks,

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.