segfault during mark-and-sweep GC
- From: Aubrey Jaffer <agj@xxxxxxxxxxxx>
- Date: Thu, 27 Aug 2009 13:27:42 -0400
The STRESS-GC-MARK procedure constructs a list where the CAR of each
pair is the same as its CDR. This causes the mark phase of some
mark-and-sweep garbage collectors to exceed the CPU stack limit in their
depth-first traversal of pairs.
;;; (stress-gc-mark 999999) causes a segfault in SCM and MIT-Scheme
;;; running on an Intel CPU.
(define (stress-gc-mark len)
(do ((cnt (+ -1 len) (+ -1 cnt))
(lst '() (cons lst lst)))
((negative? cnt) lst)))
(define foo (stress-gc-mark 999999))
How do other implementations avoid or solve this vulnerability?
.
- Follow-Ups:
- Re: segfault during mark-and-sweep GC
- From: Radey Shouman
- Re: segfault during mark-and-sweep GC
- From: Felix Klock
- Re: segfault during mark-and-sweep GC
- From: Eduardo Cavazos
- Re: segfault during mark-and-sweep GC
- From: Nils M Holm
- Re: segfault during mark-and-sweep GC
- From: Eduardo Cavazos
- Re: segfault during mark-and-sweep GC
- Prev by Date: Re: Syntactic Abstraction under the New Model
- Next by Date: Re: segfault during mark-and-sweep GC
- Previous by thread: The Latest String Craze
- Next by thread: Re: segfault during mark-and-sweep GC
- Index(es):