[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah


Stefan Krah  added the comment:

Whoops, I tested the wrong branch, getting a proper abort() now. :)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah


Stefan Krah  added the comment:

The tests pass here on Linux with 3.8 (cc60cdd9c4) and a very low 
sys.setrecursionlimit(150).

The fail properly with RecursionError at sys.setrecursionlimit(125).


So I guess we'd need a gdb stack trace from OS X in case there's a CPython 
issue that is OS X specific.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah


Stefan Krah  added the comment:

It can still be an issue in CPython, like in #14537.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Stefan Krah


Stefan Krah  added the comment:

This occurs when handling a recursion error uses more than 50 extra nested 
function calls:

if (tstate->overflowed) {
if (tstate->recursion_depth > recursion_limit + 50) {
/* Overflowing while handling an overflow. Give up. */
Py_FatalError("Cannot recover from stack overflow.");
}
return 0;
}



You can set the recursion limit with sys.setrecursionlimit(), but it is the 
extra stack depth that matters here.

--
nosy: +skrah

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-20 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

FWIW I just tried both f8e46e9e741f253803e9b8be03287e5dd16abd4d and 
f8e46e9e741f253803e9b8be03287e5dd16abd4d with the reproducer given and none of 
them segfault.

I don't think there is a bug in the Python interpreter, there is some ways to 
trigger this error when a RecursionError is not handled quickly enough. I 
suppose you just have a problem in Sympy. I also find suspicious that you 
reproducer change many lines in Sympy and would look at that first.

--
nosy: +remi.lapeyre

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-19 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

>From the stack trace it looks like some kind of recursion occurs on the tests 
>causing the crash. Sympy is not a part of stdlib. Can you please add a pure 
>Python reproducer or this is something that needs to be fixed by reporting to 
>sympy repo.

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36370] "Fatal Python error: Cannot recover from stack overflow" from SymPy tests

2019-03-19 Thread Aaron Meurer


New submission from Aaron Meurer :

I am getting a Fatal Python error: Cannot recover from stack overflow. running 
the SymPy tests on a branch of mine where the tests fail. I have reproduced 
this in Python 3.6.7, as well as CPython master 
(fc96e5474a7bda1c5dec66420e4467fc9f7ca968).

Here are the repro steps:

1. Check out my git branch https://github.com/asmeurer/sympy/tree/python-crash
2. Install or point PYTHONPATH to mpmath
3. Run python and type

from sympy import test
test('sets', subprocess=False)

The tests will run (with failures) until they reach a point where Python 
crashes with

Fatal Python error: Cannot recover from stack overflow.

Current thread 0x7fffa8e623c0 (most recent call first):
  File 
"/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/relational.py", 
line 385 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1594 in _contains
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 286 in contains
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1257 in 
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/logic.py", 
line 139 in fuzzy_and
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1257 in _handle_finite_sets
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1900 in simplify_intersection
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1200 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 109 in intersect
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 309 in is_subset
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1348 in reduce
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1338 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 551 in __sub__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1269 in _handle_finite_sets
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1900 in simplify_intersection
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1200 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 109 in intersect
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 309 in is_subset
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1348 in reduce
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1338 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 551 in __sub__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1269 in _handle_finite_sets
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1900 in simplify_intersection
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1200 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 109 in intersect
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 309 in is_subset
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1348 in reduce
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1338 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 551 in __sub__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1269 in _handle_finite_sets
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1900 in simplify_intersection
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1200 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 109 in intersect
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 309 in is_subset
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1348 in reduce
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1338 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 551 in __sub__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1269 in _handle_finite_sets
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1900 in simplify_intersection
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 1200 in __new__
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line 109 in intersect
  File "/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/sets/sets.py", 
line