From d53a7a28a5b5bb16b200afa86f66cdb33fe12189 Mon Sep 17 00:00:00 2001 From: Gabor Melis Date: Fri, 7 Oct 2005 08:57:00 +0000 Subject: [PATCH] 0.9.5.30: * sb-sprof does not uninstall the sigprof handler anymore to avoid races * sb-sprof checks for 0 sample count --- NEWS | 2 ++ contrib/sb-sprof/sb-sprof.lisp | 12 +++++++----- version.lisp-expr | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index c666ace..a05e24f 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ changes in sbcl-0.9.6 relative to sbcl-0.9.5: on platforms supporting dynamic-extent allocation. * enhancement: saving cores with foreign code loaded is now supported on MIPS/Linux in addition to the previously supported platforms. + * bug fix: division by zero in sb-sprof when no samples were collected + * bug fix: a race when a slow to arrive sigprof signal killed sbcl * bug fix: threads stacks belonging to dead threads are freed by the next exiting thread, no need to gc to collect thread stacks anymore * minor incompatible change: INTERRUPT-THREAD-ERROR-ERRNO removed diff --git a/contrib/sb-sprof/sb-sprof.lisp b/contrib/sb-sprof/sb-sprof.lisp index eeca769..df8fe7d 100644 --- a/contrib/sb-sprof/sb-sprof.lisp +++ b/contrib/sb-sprof/sb-sprof.lisp @@ -647,8 +647,6 @@ (end (+ start (sb-kernel:%code-code-size code)))) (values start end))) -;;; Record the addresses of dynamic-space code objects in -;;; *DYNAMIC-SPACE-CODE-INFO*. Call this with GC disabled. (defun record-dyninfo () (setf *dynamic-space-code-info* nil) (flet ((record-address (code size) @@ -777,7 +775,7 @@ ;; (pushnew 'turn-off-sampling *before-gc-hooks*) (pushnew 'adjust-samples-for-address-changes *after-gc-hooks*) (record-dyninfo) - (sb-sys:enable-interrupt sb-unix::sigprof #'sigprof-handler) + (sb-sys:enable-interrupt sb-unix:sigprof #'sigprof-handler) (unix-setitimer :profile secs usecs secs usecs) (setq *profiling* t))) (values)) @@ -788,7 +786,9 @@ (setq *after-gc-hooks* (delete 'adjust-samples-for-address-changes *after-gc-hooks*)) (unix-setitimer :profile 0 0 0 0) - (sb-sys:enable-interrupt sb-unix::sigprof :default) + ;; Even with the timer shut down we cannot be sure that there is + ;; no undelivered sigprof. Besides, leaving the signal handler + ;; installed won't hurt. (setq *sampling* nil) (setq *profiling* nil)) (values)) @@ -1004,7 +1004,9 @@ (format t "~&~V,,,V<~>~%" length char)) (defun samples-percent (call-graph count) - (* 100.0 (/ count (call-graph-nsamples call-graph)))) + (if (> count 0) + (* 100.0 (/ count (call-graph-nsamples call-graph))) + 0)) (defun print-call-graph-header (call-graph) (let ((nsamples (call-graph-nsamples call-graph)) diff --git a/version.lisp-expr b/version.lisp-expr index 2541d65..6c7133a 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".) -"0.9.5.29" +"0.9.5.30" -- 1.7.10.4