]> granicus.if.org Git - python/commitdiff
Retract the claim that this is always safe if PyMem_{Del, DEL, Free, FREE}
authorTim Peters <tim.peters@gmail.com>
Sat, 30 Mar 2002 06:20:23 +0000 (06:20 +0000)
committerTim Peters <tim.peters@gmail.com>
Sat, 30 Mar 2002 06:20:23 +0000 (06:20 +0000)
are called without the GIL.  It's incredibly unlikely to fail, but I can't
make this bulletproof without either adding a lock for exclusion, or
giving up on growing the arena base-address vector (it would be safe if
this were a static array).

Objects/obmalloc.c

index 5ac5c35f630d3548555204a39fa875e883d75d9c..500afba469772f1ec76132b4f39fb95aa3e46ed7 100644 (file)
@@ -403,6 +403,10 @@ new_arena(void)
                 * only make a supposed-to-succeed case fail by mistake).
                 * Read the above 50 times before changing anything in this
                 * block.
+                * XXX Fudge.  This is still vulnerable:  there's nothing
+                * XXX to stop the bad-guy thread from picking up the
+                * XXX current value of arenas, but not indexing off of it
+                * XXX until after the PyMem_FREE(oldarenas) below completes.
                 */
                uptr *oldarenas;
                int newmax = maxarenas + (maxarenas >> 1);