Memory leak on darwin x86

Bug #326238 reported by Upward Index on 2009-02-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone

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)
       (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.? and However the bug does not seem to affect linux builds.

Paul Khuong (pvk) on 2009-02-06
description: updated
Paul Khuong (pvk) wrote :

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.

description: updated
description: updated
Changed in sbcl:
importance: Undecided → High
status: New → Confirmed
importance: High → Medium
Stas Boukarev (stassats) wrote :

Fixed in f723f68aa847501d7f30e1403f79a678f7da2fe2

Changed in sbcl:
status: Confirmed → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers