py3.10-prep: Fix a very old refcounting error in time_test.py
authorChristian Tismer <tismer@stackless.com>
Fri, 20 Aug 2021 16:18:57 +0000 (18:18 +0200)
committerPeter Michael Green <plugwash@raspbian.org>
Sat, 5 Feb 2022 15:09:17 +0000 (15:09 +0000)
commit750d2d26d00d97f519d32d2fe5f9c75f2de583f6
tree3db0bd1542122c9277b78a5bd2f906b3fce933bd
parent0dfde62ef3c1ffc5fe376954ca558d3d8e2e4ec3
py3.10-prep: Fix a very old refcounting error in time_test.py

Since 2012-03-08, there was a refcounting error in
the typesystem_sample.xml file at <value-type name="Time">.
The boolean function results were not refcounted.

(Commit 7b731d702c64d172e192aa1876e4a6fade6c38d7)

This bug was hard to find because nobody expects a failure in the
testing code, and the error shows up at the very end in the
finalization code, totally unrelated to the error location.

In order to find it, the setting `PYTHONMALLOC=malloc` was needed,
because otherwise we got a Python memory dump but no traceback.
Then, Python was modified and code was inserted in the various
involved `code_dealloc`, `tupledealloc` and `object_dealloc`
functions that printed the involved refcounts and types before
performing the actual deallocation.

This bug actually was of no harm since only the wrong test was
involved. It was very misleading because there were quite some
changes to the `datetime` module in Python 3.10. But the bug
was nothing but a dormant refcounting error.

(cherry picked from commit 2af6ac20de365116b52b65c6c34cfd6c536c23df)

Gbp-Pq: Name py3.10-prep-Fix-a-very-old-refcounting-error-in-time_test.patch
sources/shiboken2/tests/samplebinding/typesystem_sample.xml