From f9b0f51a03824319cb45388c5a9fdb813c04f2d1 Mon Sep 17 00:00:00 2001 From: Gabor Melis Date: Mon, 2 Nov 2009 10:56:13 +0000 Subject: [PATCH] 1.0.32.10: fix timer starvation caused by setting the system clock back Reported by Leslie P. Polzer. https://bugs.launchpad.net/sbcl/+bug/460283 --- NEWS | 7 ++++--- src/code/timer.lisp | 5 +++++ version.lisp-expr | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 4ab65d9..2ff282e 100644 --- a/NEWS +++ b/NEWS @@ -2,14 +2,15 @@ changes relative to sbcl-1.0.32: * improvement: support O_LARGEFILE access to files larger than 2GB on x86-64/linux. (thanks to Daniel Janus) - * bug fix: restore buildability on the MIPS platform. (regression from - 1.0.30.38, reported by Samium Gromoff) - * bug fix: inspecting closures is less likely to fail with a type error. * new feature: SB-INTROSPECT:WHO-SPECIALIZES-DIRECTLY to get a list of definitions for methods specializing on the passed class itself. * new feature: SB-INTROSPECT:WHO-SPECIALIZES-GENERALLY to get a list of definitions for methods specializing on the passed class itself, or on subclasses of it. + * bug fix: restore buildability on the MIPS platform. (regression from + 1.0.30.38, reported by Samium Gromoff) + * bug fix: inspecting closures is less likely to fail with a type error. + * bug fix: no timer starvation when setting the system clock back changes in sbcl-1.0.32 relative to sbcl-1.0.31: * optimization: faster FIND and POSITION on strings of unknown element type diff --git a/src/code/timer.lisp b/src/code/timer.lisp index b84168a..065b4c2 100644 --- a/src/code/timer.lisp +++ b/src/code/timer.lisp @@ -363,6 +363,11 @@ triggers." (when (or (null timer) (< (get-internal-real-time) (%timer-expire-time timer))) + ;; Seemingly this is a spurious SIGALRM, but play it safe and + ;; reset the system timer because if the system clock was set + ;; back after the SIGALRM had been delivered then we won't get + ;; another chance. + (set-system-timer) (return-from run-expired-timers nil)) (assert (eq timer (priority-queue-extract-maximum *schedule*))) (set-system-timer)) diff --git a/version.lisp-expr b/version.lisp-expr index f235319..eb64e02 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.32.9" +"1.0.32.10" -- 1.7.10.4