[issue30297] Recursive starmap causes Segmentation fault

2017-05-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: Since this is duplicate, marking as closed. -- stage: -> resolved status: open -> closed ___ Python tracker ___

[issue30297] Recursive starmap causes Segmentation fault

2017-05-08 Thread Sebastian Noack
Sebastian Noack added the comment: Thanks for your response, both of you. All you said, make sense. Just for the record, I wouldn't necessarily expect 200k nested iterators to work. Even if it could be made work, I guess it would use way too much memory. But a RuntimeError would be much prefer

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Options like -fno-stack-limit and -fsplit-stack can help to avoid a crash, but they are compiler-specific and we should test how they affect the performance and memory consumption. How can we test that the available stack is too small? This is not a part of

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: Serhiy, do you have any ideas for a non-invasive global solution to running out of C-stack? The GCC options for -fno-stack-limit and -fsplit-stack are one avenue. Another is to put in a periodic check in the c-eval loop to test whether available stack is

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: What makes this report unique is that it is the first one occurring in the wild (i.e. wasn't an example contrived solely for the purpose of producing a crash). Otherwise, we're not ever seeing this happen in real code. -- _

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This looks as a duplicate of issue14010 (and many other issues). -- nosy: +serhiy.storchaka resolution: -> duplicate superseder: -> deeply nested filter segfaults ___ Python tracker

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Raymond Hettinger
Raymond Hettinger added the comment: I'm not sure this can be fixed reasonably. It would entail taking every possible iterator in all of Python and adding some sort of recursion depth check. That approach risks introducing bugs, risks breaking existing code that relies on heavy iteration dep

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Sebastian Noack
Sebastian Noack added the comment: I just noticed that the segfault can also be reproduced with Python 2 [1]. So please ignore what I said before that this wouldn't be the case. While it is debatable whether using a lazy evaluated object with so many recursions is a good idea in the first plac

[issue30297] Recursive starmap causes Segmentation fault

2017-05-07 Thread Sebastian Noack
New submission from Sebastian Noack: If I run following code (on Python 3.5.3, Linux) the interpreter crashes with a segfault: def pbkdf2_bin(data, salt, iterations=1000, keylen=24, hashfunc=None): hashfunc = hashfunc or hashlib.sha1 mac = hmac.new(data, None, hashfunc) def _pseudo