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
Global static initializers have problems under FEX. They have a couple of problems, mostly centered around memory allocation
They can allocate untracked memory upfront that FEX can't control.
This means it has memory originally allocated through jemalloc before the allocation hooks are setup
They can register atexit handlers that can crash on application close
This is used to cleanup the memory allocated before FEX can track it
FEX currently works around these previous problems by leaking all memory allocated on process shutdown and letting the kernel clean it up.
A major issue that occurs is when the static initializer allocates memory pre-hook, then once the hooks are installed, it allocates new memory through the FEX hooks, having a mix of pre-hook and post-hook memory allocations. On munmap this tracking will get confused and leak memory.
In the case of mixed-allocation and /not/ leaking, it can result in a crash but it's been a couple years since we enabled the leaking, so I don't quite remember why the crashes come.
From the on and off work over the past few years, we have removed most static initializers but there are still a handful sprinkled throughout the FEX codebase.
Global static initializers have problems under FEX. They have a couple of problems, mostly centered around memory allocation
atexit
handlers that can crash on application closeFEX currently works around these previous problems by leaking all memory allocated on process shutdown and letting the kernel clean it up.
A major issue that occurs is when the static initializer allocates memory pre-hook, then once the hooks are installed, it allocates new memory through the FEX hooks, having a mix of pre-hook and post-hook memory allocations. On munmap this tracking will get confused and leak memory.
In the case of mixed-allocation and /not/ leaking, it can result in a crash but it's been a couple years since we enabled the leaking, so I don't quite remember why the crashes come.
From the on and off work over the past few years, we have removed most static initializers but there are still a handful sprinkled throughout the FEX codebase.
A bunch from vixl. With the disassembler disabled we should be able to remove most of these HostFeatures: Removes vixl usage #3962One from Thunks.cpp Thunks: Removes global static initializer #4021The text was updated successfully, but these errors were encountered: