https://bugzilla.wikimedia.org/show_bug.cgi?id=71486

--- Comment #6 from Tim Starling <[email protected]> ---
The issue is that the peculiar structure of a PPNode_Hash_Tree has references
nested very deeply, potentially hundreds of thousands of levels. In the case of

https://de.wikipedia.org/w/index.php?curid=5622355

the resulting PPNode_Hash_Tree for the article itself has nesting at least
13500 levels deep. serialize() was observed to crash after 8584 levels, and
unserialize() was observed to crash after about 12500 levels, in both cases due
to exhaustion of the 8MB thread stack.

The solution options that occur to me are:

a) Increase the thread stack size with ulimit -Ss. This is tested and works for
the above test case, but to work for any conceivable test case would require a
very large stack, perhaps 2GB.
b) Introduce a depth limit to serialize() and unserialize(). Probably sensible
in any case, but potentially tricky to sell the PR to upstream, and would still
leave us with an error message delivered to the user.
c) Rewrite serialize() and unserialize() to be non-recursive. That would be
quite a lot of work.
d) Use a different data structure in PPNode_Hash_Tree, for example using
integer keys to break references, perhaps in an HHVM-specific subclass.
e) Use a custom serializer in PPNode_Hash_Tree, which can traverse the tree
without recursion.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to