Change 18593 by sky@sky-tibook on 2003/01/26 22:37:21
When we copy things out of a hash and increment the
refcount of the shared scalar, we really must protect
that refcount increase with a lock, or else it might not
happen. Fixes segfault when objects would prematurely
be killed.
Affected files ...
... //depot/perl/ext/threads/shared/shared.xs#31 edit
Differences ...
==== //depot/perl/ext/threads/shared/shared.xs#31 (text) ====
Index: perl/ext/threads/shared/shared.xs
--- perl/ext/threads/shared/shared.xs#30~18421~ Fri Jan 3 17:27:55 2003
+++ perl/ext/threads/shared/shared.xs Sun Jan 26 14:37:21 2003
@@ -672,7 +672,9 @@
MAGIC *nmg = sv_magicext(nsv,mg->mg_obj,
toLOWER(mg->mg_type),&sharedsv_elem_vtbl,
name, namlen);
+ ENTER_LOCK;
SvREFCNT_inc(SHAREDSvPTR(shared));
+ LEAVE_LOCK;
nmg->mg_flags |= MGf_DUP;
return 1;
}
End of Patch.