How to ensure the consistency on the result of process_vm_readv #154
Replies: 1 comment 6 replies
-
Indeed this is a very real possibility, but I think there isn't much we can do about it to completely solve the problem. I don't think pausing would yield any substantial improvements here because there is no guarantee that we would halt a thread at a time when everything is consistent. Evidence seems to suggest that the data collected by Austin is sensible, despite this wild race condition. Besides, Austin tries to detect inconsistent stacks and report them. You would notice higher error rates if you are profiling very quick Python functions, but real-world applications generally have a mix of fast and slow functions. Recent versions of Austin have added a heap parameter that can be used to tell Austin to allocate a chunk of memory that is used to read as many frames as possible with a single system call to attempt to reduce the error rate. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
It looks like this tool leverages
process_vm_readvsystem call to get the running state of Python interpreter. I'm not sure whether the state we get is consistent.While interpreter is running,
PyInterpreterStateis changing frome time to time. How to keep the state unchanged during the process ofprocess_vm_readvwithout any program interrupt? I think it's possible thatprocess_vm_readvis invoked in the middle ofPyInterpreterStatechanging, which means the data we get is a mixture of old state and new state.Beta Was this translation helpful? Give feedback.
All reactions