|Subject:||Segfault when a variable is destroyed after using weaken a large number of times (between 23K and 24K)|
As per the descriptive title. I create a tree with a single root and thousands of children. The link from the root to the first child is strong, as is the link from each node to its next sibling. The link from each node to the root is weakened. The program crashes when the root goes out of scope. See the attached code which tries to find the esact number. Change the $NB_ELT_INIT and the $STEP values to find it. Note that the limit can vary (23790 and 23810 in my limited tests). I had the same problem with XML::Twig, which also builds a tree, at about the same number of nodes. Twig uses weaken several times for each node though, so that might be an element. Note that it is not the total number of weaken that counts, just the number in the block in which the variables are in scope. This behaviour happens in Scalar::Util 1.18 and 1.19 perl -v: This is perl, v5.8.8 built for i486-linux-gnu-thread-multi Note that I have had reports of bugs in XML::Twig that look suspiciously like they could come from this problem, on various machines (just today: Solaris in c.l.p.m, perl 5.8.5 and 5.8.8, and perl v5.8.7 built for i386-freebsd-64int by mail). I hope that helps __ mirod
Message body not shown because it is not plain text.