Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 14 Mar 2013 17:40:53 +0100
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: clock err in timers (alarm, status ...) and fix

On 14 Mar, 2013, at 15:36 , Solar Designer <solar@...nwall.com> wrote:

> On Thu, Mar 14, 2013 at 03:08:39PM +0100, Costin Enache wrote:
>> 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 :)
> 
> OK, this confirms my initial guess that the issue is jumbo's misuse of
> the signal handler invocations for the time limit feature.  This has
> nothing to do with sysconf(_SC_CLK_TCK).
> 
> magnum - please fix this by reimplementing the time limit feature.

I applied Costin's changes almost verbatim. Is that not good enough?

> There's not much, if anything, to fix in core as it relates to this.
> The status line, benchmarks, etc. are not affected.  "Save = ..." is
> affected in OS_TIMER=0 builds, but do we care?

It seemed simple enough to do the same, so I did:

--- a/src/signals.c
+++ b/src/signals.c
@@ -281,8 +281,8 @@ static void sig_handle_timer(int signum)
        unsigned int time = status_get_time();
        int saved_errno = errno;
 
-       if (!--timer_save_value) {
-               timer_save_value = timer_save_interval;
+       if (time >= timer_save_value) {
+               timer_save_value += timer_save_interval;
 
                event_save = event_pending = 1;
        }


magnum

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ