[issue43351] `RecursionError` during deallocation

2021-04-12 Thread Andrew V. Jones


Andrew V. Jones  added the comment:

For us, this issue was resolved with moving to 3.9.2.

I have closed it as it seems it was an "accidentally fixed" bug.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43351] `RecursionError` during deallocation

2021-03-01 Thread Andrew V. Jones


Andrew V. Jones  added the comment:

Same logic, but this crashes:

```
def loop():
a_node = boost_python_library.get_linked_list()
temp = []
while True:
assert a_node is not None
temp.append(a_node)
prev = a_node   # <-- comment this out to make the crash go away
a_node = a_node.next
if not a_node:
break
```

--

___
Python tracker 

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



[issue43351] `RecursionError` during deallocation

2021-03-01 Thread Andrew V. Jones


Andrew V. Jones  added the comment:

Here's some representative code that triggers the issue:

```
def loop():
a_node = boost_python_library.get_linked_list()
all_elems = []
while a_node is not None:
#
# Uncomment the below to make the crash disappear
#
# all_elems.append(a_node)
#
a_node = a_node.next
```

The *really* interesting bit is that if we save what comes off the Boost.Python 
linked list into a Python-proper list (`all_elems` as above), then the crash 
goes away.

--

___
Python tracker 

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



[issue43351] `RecursionError` during deallocation

2021-03-01 Thread Andrew V. Jones


New submission from Andrew V. Jones :

I am currently working with "porting" some code from Python 2.7.14 to Python 
3.7.5, but the process running the Python code seems to terminate in the 
following way:

```
#0  0x2ef63337 in raise () from /lib64/libc.so.6
#1  0x2ef64a28 in abort () from /lib64/libc.so.6
#2  0x2e726e18 in fatal_error (prefix=0x0, msg=0x2e8091f0 "Cannot 
recover from stack overflow.", status=-1) at Python/pylifecycle.c:2187
#3  0x2e727603 in Py_FatalError (msg=0x9bf0 ) at Python/pylifecycle.c:2197
#4  0x2e6ede2b in _Py_CheckRecursiveCall (where=) at 
Python/ceval.c:489
#5  0x2e62b61d in _PyMethodDef_RawFastCallDict (method=0x2eae2740 
, self=0x2aaabb1d4d70, args=0x0, nargs=0, 
kwargs=0x0) at Objects/call.c:464
#6  0x2e62b6a9 in _PyCFunction_FastCallDict (func=0x2aaabeaa5690, 
args=0x6, nargs=0, kwargs=0x0) at Objects/call.c:586
#7  0x2e62c56c in _PyObject_CallFunctionVa (callable=0x9bf0, 
format=, va=, is_size_t=) at 
Objects/call.c:935
#8  0x2e62cc80 in callmethod (is_size_t=, va=, format=, callable=) at Objects/call.c:1031
#9  _PyObject_CallMethodId (obj=, name=, 
format=0x0) at Objects/call.c:1100
#10 0x2e724c51 in flush_std_files () at Python/pylifecycle.c:1083
#11 0x2e72704f in fatal_error (prefix=0x0, msg=, 
status=-1) at Python/pylifecycle.c:2175
#12 0x2e727603 in Py_FatalError (msg=0x9bf0 ) at Python/pylifecycle.c:2197
#13 0x2e6ede2b in _Py_CheckRecursiveCall (where=) at 
Python/ceval.c:489
#14 0x2e62ba3d in _PyObject_FastCallDict (callable=0x2aaabeab8790, 
args=, nargs=, kwargs=0x0) at Objects/call.c:120
#15 0x2e62c2f0 in object_vacall (callable=0x2aaabeab8790, 
vargs=0x7ff54d40) at Objects/call.c:1202
#16 0x2e62c3fd in PyObject_CallFunctionObjArgs (callable=0x9bf0) at 
Objects/call.c:1267
#17 0x2e6c1bf0 in PyObject_ClearWeakRefs (object=) at 
Objects/weakrefobject.c:872
#18 0x2e4b26f6 in instance_dealloc () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
#19 0x2e67c3e0 in subtype_dealloc (self=0x2aaabeab9e40) at 
Objects/typeobject.c:1176
#20 0x2e4ba63f in life_support_call () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
#21 0x2e62b9c4 in _PyObject_FastCallDict (callable=0x2aaabeab87b0, 
args=, nargs=, kwargs=0x0) at Objects/call.c:125
#22 0x2e62c2f0 in object_vacall (callable=0x2aaabeab87b0, 
vargs=0x7ff54fd0) at Objects/call.c:1202
#23 0x2e62c3fd in PyObject_CallFunctionObjArgs (callable=0x9bf0) at 
Objects/call.c:1267
#24 0x2e6c1bf0 in PyObject_ClearWeakRefs (object=) at 
Objects/weakrefobject.c:872
#25 0x2e4b26f6 in instance_dealloc () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
#26 0x2e67c3e0 in subtype_dealloc (self=0x2aaabeab9e90) at 
Objects/typeobject.c:1176
#27 0x2e4ba63f in life_support_call () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
#28 0x2e62b9c4 in _PyObject_FastCallDict (callable=0x2aaabeab87d0, 
args=, nargs=, kwargs=0x0) at Objects/call.c:125
#29 0x2e62c2f0 in object_vacall (callable=0x2aaabeab87d0, 
vargs=0x7ff55260) at Objects/call.c:1202
#30 0x2e62c3fd in PyObject_CallFunctionObjArgs (callable=0x9bf0) at 
Objects/call.c:1267
#31 0x2e6c1bf0 in PyObject_ClearWeakRefs (object=) at 
Objects/weakrefobject.c:872
#32 0x2e4b26f6 in instance_dealloc () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
#33 0x2e67c3e0 in subtype_dealloc (self=0x2aaabeab9ee0) at 
Objects/typeobject.c:1176
#34 0x2e4ba63f in life_support_call () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
```

This is only the inner most 35 frames -- the actual back-trace is 7375 frames 
deep, and ends with:

```
#7358 0x2e4b26f6 in instance_dealloc () from 
/home/LOCAL/avj/build/vc21__90601_pyedg_improvements/vc/lib64/libboost_python37.so.1.69.0
#7359 0x2e67c3e0 in subtype_dealloc (self=0x2aaabeaefdf0) at 
Objects/typeobject.c:1176
#7360 0x2e6f2f46 in _PyEval_EvalFrameDefault (f=0x2aaabce48b30, 
throwflag=39920) at Python/ceval.c:1098
#7361 0x2e62a959 in function_code_fastcall (co=, 
args=0x7fffd088, nargs=1, globals=) at Objects/call.c:283
#7362 0x2e62ae44 in _PyFunction_FastCallDict (func=0x2aaabda07950, 
args=0x7fffd080, nargs=1, kwargs=0x0) at Objects/call.c:322
#7363 0x2e62bbea in _PyObject_Call_Prepend (callable=0x2aaabda07950, 
obj=0x2aaabea92590, args=0x2aaabb193050, kwargs=0x0) at Objects/call.c:908
#7364 0x2e62b9c4 in _PyObject_FastCallDict (callable=0x2aaabb253a50, 
args=, nargs=, kwargs=0x0) at Objects/call.c:125
#7365 0x2e62c677 in