On Tue, Nov 29, 2022 at 15:37:51 -0500, Aaron Lindsay wrote: (snip) > > Does this hint that there are cases where reset cpu->plugin_mem_cbs to NULL > > is > > getting optimized away, but not the code to set it in the first place? > > Is there anyone who could help take a look at this from the code gen > perspective?
Thanks for the report. Just adding assertions was enough to uncover several bugs. I did not reproduce the use-after-free, but by calling reset from a callback it's easy to see how it can occur. I have fixes in https://github.com/cota/qemu/tree/plugins Can you please give those a try? BTW I created an issue on gitlab to track this https://gitlab.com/qemu-project/qemu/-/issues/1381 Thanks, Emilio