From: Max M. <ma...@op...> - 2013-05-28 22:55:14
|
At Tue, 28 May 2013 18:23:54 -0400, Max Mikhanosha wrote: > > I have a test case, where by killing lots of threads, that use > %without-interrupts/with-interrupts to try to manage their cleanup, I > can somehow get SBCL into the state where > > 1. (decode-universal-time (get-universal-time)) > ;; hangs the calling thread, interrupting > ;; shows single "bogus frame" > > 2. (decode-universal-time (get-universal-time) 0) > ;; works fine > I have traced it to localtime_r() hanging.. My understanding of this is as follows: localtime_r() uses locking on some mutex, that checks if tzset() been called since last time it cached the timezone info If a Lisp thread gets killed while its doing localtime_r() in the foreign code, that mutex or whatever its using is stuck, and any farther localtime_r() from the same process hang.. This actually has very devastating consequences for SBCL, as it shuts down the compiler, because it uses decode-universal-time. The test case to reproduce it, would be to repeatedly start and stop many threads, that call (decode-universal-time) without time-zone argument. The fix would be to block signals around calls to localtime_r and gmtime_r Regards, Max |