lifting-bits / remill

Library for lifting machine code to LLVM bitcode
Apache License 2.0
1.22k stars 142 forks source link

Cache invalidated might fail on Mac M1/M2 #640

Open pgarba opened 1 year ago

pgarba commented 1 year ago

The cache invalidation might fail if a new function is allocated at the same address as the cached one. This happens to me on the M2 after I delete a function and then allocate a new one which leads to return a nullptr for cached values and results in a crash.

https://github.com/lifting-bits/remill/blob/829ee4acf58742d941be5f77c941e1a98546fc2f/lib/BC/InstructionLifter.cpp#L96

pgoodman commented 1 year ago

Perhaps the cache invalidation should hold a weak value handle on the llvm function.