1.0.8.19: :dont-safe finalizers and fd-stream thread safety issues
commitafb56ab2865fdb72102a9bb6b2c846b7b5a6ad7e
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 9 Aug 2007 16:52:03 +0000 (9 16:52 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 9 Aug 2007 16:52:03 +0000 (9 16:52 +0000)
treea4e45869a4143f10b40a7c2e4bd859874d6c7d2e
parent624fbec2a9e9eca373be1cd3351b2c8533b4579d
1.0.8.19: :dont-safe finalizers and fd-stream thread safety issues

 * Add :DONT-SAVE keyword argument to FINALIZE, which causes the finalizer
   to be removed when core is saved: it is not amusing to have a finalizer
   that deallocates system memory to fire in a fresh image which happens
   to have freshly allocated memory in the same address. Also good for finalizers
   closing FDs.

   Use where appropiate.

 * Stream buffing should not use (INCF (BUFFER-FOO BUFFER) N), since if another
   thread has written to the buffer since we last looked at it this might take
   eg. the TAIL index beyond the end of the allocated memory area: by doing
   (let ((foo (buffer-foo buffer))) ... (setf (buffer-foo buffer) (+ foo n)) we might
   overwrite the data from another thread, but at least we won't trash memory.

 * Small graces: check that ALLOCATE-SYSTEM-MEMORY actually succeeds, don't accept
   finalizers for NIL (they would just run immediately on next GC, which is almost
   certainly not intended), take an extra mile to ensure old buffers from before
   SAVE-LISP-AND-DIE don't survive to the new image.
NEWS
src/code/cold-init.lisp
src/code/fd-stream.lisp
src/code/final.lisp
src/code/save.lisp
src/code/target-alieneval.lisp
src/runtime/gencgc.c
version.lisp-expr