You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Crash on shutdown when embedding Python in C# #1831
Using the Python for Unity package with at a commit hash later or equal to the one above, pythonnet causes a crash on Shutdown. I've traced the issue to this PR: #1780 which is cause by checking a Python internal without holding the GIL; which the shutdown process isn't doing (or at least not at this point).
Just adding to this: we are seeing a similar segmentation fault while shutting down, only while debugging for same reason. Manually shutting down seems to avoid the seg fault QuantConnect/Lean#6439
Activity
[-]Crash on when embedding Python in C#[/-][+]Crash on shutdown when embedding Python in C#[/+]filmor commentedon Jun 23, 2022
Is the
Exceptions.ErrorOccurred()the culprit? Does it work if that whole section is put in ausing (Py.GIL)scope?BadSingleton commentedon Jun 23, 2022
It is the culprit. I'm unsure if it is totally advisable; PR incoming; grabbing the GIL only when embedded.
Martin-Molinero commentedon Jun 24, 2022
Just adding to this: we are seeing a similar segmentation fault while shutting down, only while debugging for same reason. Manually shutting down seems to avoid the seg fault QuantConnect/Lean#6439