From: Nikodemus Siivola Date: Tue, 31 Aug 2010 15:23:50 +0000 (+0000) Subject: 1.0.42.10: guard against time travel by getrusage() X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=9d66a077cc98384aa6c1be0d1178b3c82f66e5e8;p=sbcl.git 1.0.42.10: guard against time travel by getrusage() * Fixes lp#544421, we hope. * Apparently sometimes getrusage() returns a smaller value on second call -- this seems to happen under pretty extreme loads, mostly -- which we want to guard against. --- diff --git a/NEWS b/NEWS index e8dd9e7..b7fb281 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ changes relative to sbcl-1.0.42 Josh Elsasser) * bug fix: using aliases for builtin classes as defmethod specializers without adding DEFTYPEs for them works. (lp#618387) + * bug fix: timetravel by getrusage() no longer causes type-errors during GC. + (lp#544421) changes in sbcl-1.0.42 relative to sbcl-1.0.41 * build changes diff --git a/src/code/gc.lisp b/src/code/gc.lisp index eb7f13d..042ab05 100644 --- a/src/code/gc.lisp +++ b/src/code/gc.lisp @@ -224,8 +224,13 @@ run in any thread.") (let ((start-time (get-internal-run-time))) (collect-garbage gen) (setf *gc-epoch* (cons nil nil)) - (incf *gc-run-time* - (- (get-internal-run-time) start-time))) + (let ((run-time (- (get-internal-run-time) start-time))) + ;; KLUDGE: Sometimes we see the second getrusage() call + ;; return a smaller value than the first, which can + ;; lead to *GC-RUN-TIME* to going negative, which in + ;; turn is a type-error. + (when (plusp run-time) + (incf *gc-run-time* run-time)))) (setf *gc-pending* nil new-usage (dynamic-usage)) #!+sb-thread diff --git a/version.lisp-expr b/version.lisp-expr index f49a576..133d606 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.42.9" +"1.0.42.10"