panda icon indicating copy to clipboard operation
panda copied to clipboard

SEGFAULT in some plugin deletion contexts

Open lacraig2 opened this issue 5 months ago • 0 comments

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()

lacraig2 avatar Sep 02 '24 17:09 lacraig2