diff options
Diffstat (limited to 'results/scraper/fex/3943')
| -rw-r--r-- | results/scraper/fex/3943 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/results/scraper/fex/3943 b/results/scraper/fex/3943 new file mode 100644 index 000000000..bef23b8cf --- /dev/null +++ b/results/scraper/fex/3943 @@ -0,0 +1,21 @@ +Work on removing global static initializers +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. + +- ~~A bunch from vixl. With the disassembler disabled we should be able to remove most of these #3962~~ +- ~~One from Thunks.cpp #4021~~ +- One from Config.cpp +- One from IoctlEmulation.cpp +- One from Allocator.cpp \ No newline at end of file |