Replies: 1 comment
-
The abort went away when using the nanobind-wrapper from WrapDB (we had our own that seems to have been bad). Still leakage though, but it may be related to using static variables on the C++-side. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
cocotb shuts down the Python interpreter as:
https://github.com/cocotb/cocotb/blob/279e6bc055bc01f394d519b10ac00880521edc9a/src/cocotb/share/lib/embed/gpi_embed.cpp#L191-L204
However, this triggers the leakage code as not everything seems to be cleaned up at this stage, so the question is if there is a more correct way to do this? (It is sort of a cocotb problem, but I am pretty sure that more is known about the shutdown procedure and the leakage test here...)
See apytypes/apytypes#533 for a bit more context. However, we created a minimal nanobind module based on #69 (comment) (but without the
dummy
part, so no reference cycle(?)) and just importingColor
as part of the the cocotb testbench triggers the leakage leading to abort which is not well handled by the rest of the code...A stack trace is found in apytypes/apytypes#530 (comment) and it is clearly the call to
Py_Finalize
that triggers the leakage check. Is there something else that should be done before callingPy_Finalize
to avoid this?(We can of course disable the leakage check in our module, but it would be nice to solve it properly as cocotb will have this problem for any module using nanobind...)
Beta Was this translation helpful? Give feedback.
All reactions