Message101520
General policy is that ordinary code (not using, for instance, ctypes) should not crash or segfault the interpreter. I believe there is a 'crashers' subdirectory somewhere in the tree for examples that do so that people so inclined can work on them.
The OP reported a crash on 2.3/2.4a on Linux, but not 1.5. I could not reproduce it on 2.2 on Windows. Instead, I (properly) got an exception. Trying again with 3.1, I get a similar exception: RuntimeError: maximum recursion depth exceeded while getting the repr of a tuple. List instead of tuple does similar.
If
>>> t=None,
>>> for i in range(50000): t = t,None
>>> print(t)
still crashes on 2.6/2.7, at least with Linux, then there is still a bug to be fixed and the issue should be left open. If it now raises an exception as above, then this should be closed as fixed.
I am pretty sure this issue has nothing to do with None and Ellipsis but only with the structure (not necessarily a sequence) being deeply, deeply nested. So I think the title should be: "Segfault on printing deeply nested structures."
I think the deeper issue is the use of recursion on the C stack to print. If the print routine instead usee iteration with an auxiliary Python stack (list), then there should be no stack overflow to worry about. [When in increase the recursion limit to 100000 and try to print the 50000 nested tuples, I get "MemoryError: stack overflow" instead of the RuntimeError above. So there might be more than one fix needed.] |
|
Date |
User |
Action |
Args |
2010-03-22 16:57:25 | terry.reedy | set | recipients:
+ terry.reedy, georg.brandl, vstinner, jonaskoelker |
2010-03-22 16:57:25 | terry.reedy | set | messageid: <1269277045.17.0.743405625582.issue1069092@psf.upfronthosting.co.za> |
2010-03-22 16:57:23 | terry.reedy | link | issue1069092 messages |
2010-03-22 16:57:22 | terry.reedy | create | |
|