P403n1x87 / echion

Near-zero-overhead, in-process CPython frame stack sampler with async support
MIT License
14 stars 2 forks source link

fix: race condition on stop #23

Closed P403n1x87 closed 1 year ago

P403n1x87 commented 1 year ago

When running in synchronous mode (non-stealth), the Echion Python thread raced with the clean-up done on stop. In particular, the frame cache would be looked up while being torn down, because the Python thread could have taken some extra cycles to shut down. We ensure that the clean up of resources required for sampling are cleaned up after the sampling loop has terminated to avoid accessing data that might have been released from memory.

P403n1x87 commented 1 year ago

@sanchda FYI in case you've noticed any SIGSEGVs with LRUCache on the stack.