A UDN reported various crashes at exit in the embedded Python library. I was able to repro the issue in Release-5.1 and trace it back at the point where python runs its garbage collection in Py_Finalize(). The bug is also random, sometimes it crashed, sometimes it didn't. I used a small  for QAGame (E:\UE_5.1\QAGame\Content\Python\ that I attached with this bug.

[Link Removed]

Because the bug is random, I suspect a memory stomp or a race condition. It seems to happen when we alias unreal object in class members. 


  • Run the engine with a memory stomp detector
  • Build Python 3.9.7 locally and link the library to the Editor to debug Python library itself
  • Update to a newer Python version to check if this was a bug fixed in Python.

 Crash group: [Link Removed]


Steps to Reproduce
  • Copy the file attached in QAGame Python content folder (QAGame\Content\Python)
  • Launch QAGame in the Editor and wait for it to load.
  • Close the Editor, notice the crash at exit.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-168225 in the post.

Login to Vote

ComponentUE - Editor - Workflow Systems
Affects Versions5.1
CreatedOct 25, 2022
UpdatedJan 20, 2024