Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pmu_x86: Fix bug where machine code gets GC'd
Keep the arrays containing machine code alive by storing references to them in a Lua table. Otherwise they will be garbage collected. dynasm uses a GC callback to unmap memory that was used for generated code and so the most likely consequence is a segfault. Here is how it looks in dmesg: segfault at 7fe0d50de000 ip 00007fe0d50de000 sp 00007ffcd2c89cb8 error 14 where "error 14" means an error during instruction fetch. This problem triggered immediately when using the pmu library with non-trivial code under test (running an app network).
- Loading branch information