From: Nikodemus Siivola Date: Wed, 7 Dec 2011 13:41:45 +0000 (+0200) Subject: darwin: dladdr can deadlock the GC X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=7143001bbe7d50c62a6b9f2538a95954740fe01f;p=sbcl.git darwin: dladdr can deadlock the GC Needs to be always called inside WITHOUT-GCING since it grabs locks, and is /sometimes/ called inside WITHOUT-GCING. --- diff --git a/src/code/foreign.lisp b/src/code/foreign.lisp index 8c32729..a735e76 100644 --- a/src/code/foreign.lisp +++ b/src/code/foreign.lisp @@ -139,7 +139,10 @@ if the symbol isn't found." (symbol-address unsigned))) (dladdr (function unsigned unsigned (* (struct dl-info))) :extern "dladdr")) - (let ((err (alien-funcall dladdr addr (addr info)))) + (let ((err (without-gcing + ;; On eg. Darwin GC can could otherwise interrupt + ;; the call while dladdr is holding a lock. + (alien-funcall dladdr addr (addr info))))) (if (zerop err) nil (slot info 'symbol))))