panda
panda copied to clipboard
SEGFAULT in some plugin deletion contexts
When deleting a callback under very specific conditions we can get ugly errors.
In particular, when deleting a callback that is the last of its kind from within that callback we see a segfault in the following code:
https://github.com/panda-re/panda/blob/d0618d33c0a577f7e7281b29d3f04b31517dfc34/panda/include/panda/callbacks/cb-macros.h#L126-L138
A minimal example of this behavior for reproducing:
#!/usr/bin/env python3
from pandare import Panda
panda = Panda(generic="i386")
@panda.queue_blocking
def run_cmd():
panda.revert_sync("root")
print(panda.run_serial_cmd("uname -a"))
print(panda.run_serial_cmd("uname -a"))
print(panda.run_serial_cmd("uname -a"))
panda.end_analysis()
@panda.cb_main_loop_wait
def asidchange():
panda.delete_callbacks()
panda.run()