diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2016-01-21 21:43:37 +0000 |
---|---|---|
committer | Sergei Trofimovich <siarheit@google.com> | 2016-01-21 21:43:37 +0000 |
commit | 4c11db6377aa4fba0c4d70a1e9508247fd053bce (patch) | |
tree | a00e7024222f2f4aa15ab3355d9be61db4193664 /docs/users_guide/conf.py | |
parent | 4c4a0a52d3ca5befd2a632544e9541703007e356 (diff) | |
download | haskell-4c11db6377aa4fba0c4d70a1e9508247fd053bce.tar.gz |
sphinx-build: fix python stack overflow (Trac #10950)
Summary:
commit a034031a102bc08c76a6cdb104b72922ae22c96b did not
fix problem completely. Stack overflows still occasionally
happen.
Easy to test by the following Torture Test:
while sphinx-build -T -N -E -a -b html \
-d docs/users_guide/.doctrees-html \
-D latex_paper_size=letter \
docs/users_guide docs/users_guide/build-html/users_guide
do
echo again
done
sphinx build large nested data structures when parses GHC manual
(docs/users_guide/glasgow_exts.rst is 455KB in size) which
can't be serialized useing default python call stack depth of 1000
calls.
The patch increases stack depth 10 times. Survived 2 hours of
Torture Test.
Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Test Plan: ran Torture Test to make sure it is stable
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1809
GHC Trac Issues: #10950
Diffstat (limited to 'docs/users_guide/conf.py')
-rw-r--r-- | docs/users_guide/conf.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/users_guide/conf.py b/docs/users_guide/conf.py index 119223af69..f9c326ef83 100644 --- a/docs/users_guide/conf.py +++ b/docs/users_guide/conf.py @@ -147,6 +147,8 @@ def parse_flag(env, sig, signode): def setup(app): from sphinx.util.docfields import Field, TypedField + increase_python_stack() + # the :ghci-cmd: directive used in ghci.rst app.add_object_type('ghci-cmd', 'ghci-cmd', parse_node=parse_ghci_cmd, @@ -171,3 +173,11 @@ def setup(app): Field('since', label='Introduced in GHC version', names=['since']), Field('static') ]) + +def increase_python_stack(): + # Workaround sphinx-build recursion limit overflow: + # pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL) + # RuntimeError: maximum recursion depth exceeded while pickling an object + # + # Default python allows recursion depth of 1000 calls. + sys.setrecursionlimit(10000) |