This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ivank
Recipients ivank
Date 2011-05-06.12:25:55
SpamBayes Score 0.017311292
Marked as misclassified No
Message-id <1304684757.27.0.182455462298.issue12017@psf.upfronthosting.co.za>
In-reply-to
Content
Decoding a highly-nested object with json (_speedups enabled) can cause a segfault due to a stack overflow:

# python -c "import json; json.loads('[' * 100000 + '1' + ']' * 100000)"
zsh: segmentation fault  python -c "import json; json.loads('[' * 100000 + '1' + ']' * 100000)"

# python -c "import json; json.loads('{\"a\":' * 100000 + '1' + '}' * 100000)"
zsh: segmentation fault  python -c "import json; json.loads('{\"a\":' * 100000 + '1' + '}' * 100000)"

simplejson has the same problem:
https://github.com/simplejson/simplejson/pull/11

I've started on a fix (see patch at that URL), but it doesn't support customizing max_depth yet.
History
Date User Action Args
2011-05-06 12:25:57ivanksetrecipients: + ivank
2011-05-06 12:25:57ivanksetmessageid: <1304684757.27.0.182455462298.issue12017@psf.upfronthosting.co.za>
2011-05-06 12:25:56ivanklinkissue12017 messages
2011-05-06 12:25:55ivankcreate