Memory leak on darwin x86
Bug #326238 reported by
Upward Index
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Medium
|
Unassigned |
Bug Description
When executing the following code:
(defun foo (array x y) (aref array x y))
(let ((a (make-array '(128 128))))
(dotimes (i 1000000)
(handler-case
(foo a -1 -1)
(type-error () 0))))
Memory usage goes up quickly until exhausted. Follows a stream of mmap: Cannot allocate memory and sbcl finally crashes.
It repros on sbcl darwin x86 1.0.22.? 1.0.24.24 and 1.0.25.9. However the bug does not seem to affect linux builds.
description: | updated |
Changed in sbcl: | |
importance: | Undecided → High |
status: | New → Confirmed |
importance: | High → Medium |
Changed in sbcl: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The leak comes from signal_ emulation_ wrapper in x86-64- darwin- os.c:199. The (posix) handler function does not always return. Since our stuff isn't allocated on the stack, it doesn't get freed implicitly by unwinds. We don't allocate on the stack like on other platforms to avoid confusing the debugger's backtrace logic. It might be preferable to make the backtracer smarter, or track SP/IP around foreign stack frames.