P403n1x87 / echion

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

fix: CPU clock ID retrieval on Linux #44

Closed P403n1x87 closed 1 year ago

P403n1x87 commented 1 year ago

Trying to retrieve the CPU clock ID using an invalid pthread_t can cause a SIGSEGV. We try to protect against this by first trying to copy a chunk of memory from the address pointed by the thread ID (effectively a pthread_t). If that fails we give up constructing the ThreadInfo object.