Ticket #569: close-shared-library.patch

File close-shared-library.patch, 953 bytes (added by sionescu, 9 years ago)

Add a limit for the dlclose() loop

  • linux-files.lisp

     
    908908        (#_LocalFree p)
    909909        q))))
    910910       
    911                      
     911(defparameter *max-dlclose-retries* 1000)
    912912
    913913;;; Kind of has something to do with files, and doesn't work in level-0.
    914914#+(or linux-target freebsd-target solaris-target)
     
    925925      (when handle
    926926        (let* ((found nil)
    927927               (base (shlib.base lib)))
    928           (do* ()
     928          (do* ((retries-remaining *max-dlclose-retries*
     929                                   (1- retries-remaining)))
    929930               ((progn           
    930931                  (#_dlclose handle)
    931932                  (or (not (setq found (shlib-containing-address base)))
    932                       (not completely)))))
     933                      (not completely)
     934                      (zerop retries-remaining)))))
    933935          (when (not found)
    934936            (setf (shlib.pathname lib) nil
    935937              (shlib.base lib) nil