From: Stas B. <sta...@gm...> - 2018-01-15 18:42:46
|
I used it to fix sb-introspect/allocation-information.6. On Mon, Jan 15, 2018 at 9:32 PM Alastair Bridgewater < ala...@gm...> wrote: > Good call, and more reliable as well. I'd somehow gotten the impression > that we'd deleted the lisp side of that at some point. Commit forthcoming. > > On Mon, Jan 15, 2018 at 11:13 AM, Stas Boukarev <sta...@gm...> > wrote: > >> Would SB-SYS:SCRUB-CONTROL-STACK do the same job? >> >> On Mon, Jan 15, 2018 at 6:11 PM Alastair Bridgewater via Sbcl-commits < >> sbc...@li...> wrote: >> >>> The branch "master" has been updated in SBCL: >>> via c2f1dc83e5e9d72a0ab06238d562d1e0194933ef (commit) >>> from 5fecdf33a2dfc9c19f498ef351691c5f290d6b73 (commit) >>> >>> - Log ----------------------------------------------------------------- >>> commit c2f1dc83e5e9d72a0ab06238d562d1e0194933ef >>> Author: Alastair Bridgewater <ala...@gm...> >>> Date: Mon Jan 15 08:48:23 2018 -0500 >>> >>> tests/hash.impure.lisp: Improve non-thread behavior for >>> weak-hash-table tests >>> >>> * Actually arrange to erase parts of the control stack, so that >>> even "precise-GC" systems can't accidentally hold a root due to >>> poor stack slot management. >>> >>> * Also fix a clear thinko in a NOTINLINE declaimation. >>> >>> * This fixes (:HASH-TABLE :WEAKNESS :REMOVAL) on -sb-thread PPC. >>> --- >>> tests/hash.impure.lisp | 26 +++++++++++++++++++++----- >>> 1 file changed, 21 insertions(+), 5 deletions(-) >>> >>> diff --git a/tests/hash.impure.lisp b/tests/hash.impure.lisp >>> index 2cc9847..61767a2 100644 >>> --- a/tests/hash.impure.lisp >>> +++ b/tests/hash.impure.lisp >>> @@ -267,7 +267,7 @@ >>> >>> (defvar *cons-here*) >>> >>> -(declaim (notinline args)) >>> +(declaim (notinline take)) >>> (defun take (&rest args) >>> (declare (ignore args))) >>> >>> @@ -275,10 +275,26 @@ >>> "Execute BODY and try to reduce the chance of leaking a conservative >>> root." >>> #-sb-thread >>> `(multiple-value-prog1 >>> - (progn ,@body) >>> - (loop repeat 20000 do (setq *cons-here* (cons nil nil))) >>> - ;; KLUDGE: Clean the argument passing regs. >>> - (apply #'take (loop repeat 36 collect #'cons))) >>> + (let ((*s* (make-array 25))) >>> + (declare (special *s*) >>> + (dynamic-extent *s*)) >>> + ;; We can't "just" arrange to run the allocation on a separate >>> + ;; thread stack, then deallocate the thread before doing >>> + ;; whatever, so start by giving ourselves some headroom via a >>> + ;; DX allocation around the actual allocation... >>> + (multiple-value-prog1 >>> + (progn ,@body) >>> + (loop repeat 20000 do (setq *cons-here* (cons nil nil))) >>> + ;; KLUDGE: Clean the argument passing regs. >>> + (apply #'take (loop repeat 36 collect #'cons)))) >>> + (let ((*s* (make-array 300))) >>> + (declare (special *s*) >>> + (dynamic-extent *s*)) >>> + ;; ... and use a larger DX allocation to try to clear the stack >>> + ;; (thus, roots, conservative or otherwise) where we executed >>> + ;; the BODY (this definitely clears stack space, the >>> + ;; uncertainty is if it covers all of the space used by BODY). >>> + (take *s*))) >>> #+sb-thread >>> (let ((values (gensym)) >>> (sem (gensym))) >>> >>> ----------------------------------------------------------------------- >>> >>> >>> hooks/post-receive >>> -- >>> SBCL >>> >>> >>> ------------------------------------------------------------------------------ >>> Check out the vibrant tech community on one of the world's most >>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >>> _______________________________________________ >>> Sbcl-commits mailing list >>> Sbc...@li... >>> https://lists.sourceforge.net/lists/listinfo/sbcl-commits >>> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> _______________________________________________ >> > Sbcl-devel mailing list >> Sbc...@li... >> https://lists.sourceforge.net/lists/listinfo/sbcl-devel >> >> > |