summary refs log tree commit diff stats
path: root/results/scraper/fex/3943
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-17 09:10:43 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-17 09:10:43 +0200
commitf2ec263023649e596c5076df32c2d328bc9393d2 (patch)
tree5dd86caab46e552bd2e62bf9c4fb1a7504a44db4 /results/scraper/fex/3943
parent63d2e9d409831aa8582787234cae4741847504b7 (diff)
downloadqemu-analysis-main.tar.gz
qemu-analysis-main.zip
add downloaded fex bug-reports HEAD main
Diffstat (limited to 'results/scraper/fex/3943')
-rw-r--r--results/scraper/fex/394321
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