Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 14 Mar 2013 17:40:53 +0100
From: magnum <>
Subject: Re: clock err in timers (alarm, status ...) and fix

On 14 Mar, 2013, at 15:36 , Solar Designer <> 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;


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.