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 ezio.melotti
Recipients alex, barry, benjamin.peterson, ezio.melotti, georg.brandl, ivank
Date 2011-05-06.16:10:59
SpamBayes Score 1.7763647e-09
Marked as misclassified No
Message-id <1304698262.37.0.537087217829.issue12017@psf.upfronthosting.co.za>
In-reply-to
Content
Attached patch fixes the issues. The patch includes 6 tests that caused a segfault and that now raise a "RuntimeError: maximum recursion depth exceeded" error, matching the behavior of the Python version.

The recursion happen because scan_once_str/unicode might call _parse_object_str/unicode (for objects/dicts) and _parse_array_str/unicode (for arrays/lists), and these functions might call scan_once_str again for their inner elements.
To fix the problem I added Py_Enter/LeaveRecursiveCall around the calls to _parse_object_str and _parse_array_str in scan_once_str/unicode.

For some reason the message raised with json.loads('{"a":' * 100000 + '1' + '}' * 100000), is a generic "maximum recursion depth exceeded while calling a Python object", but that's probably not too important.
The other messages work fine.
History
Date User Action Args
2011-05-06 16:11:02ezio.melottisetrecipients: + ezio.melotti, barry, georg.brandl, benjamin.peterson, alex, ivank
2011-05-06 16:11:02ezio.melottisetmessageid: <1304698262.37.0.537087217829.issue12017@psf.upfronthosting.co.za>
2011-05-06 16:11:00ezio.melottilinkissue12017 messages
2011-05-06 16:11:00ezio.melotticreate