Rust threads don't get their correct "stack top" during thread registration
Categories
(Core :: Gecko Profiler, defect, P2)
Tracking
()
People
(Reporter: canova, Unassigned)
Details
We do the thread registration with register_thread
and unregister_thread
APIs in the rust side. But it looks like we don't really get the correct stackTop while registering it because this is a normal function instead of a macro, and inside of that function we have a C++ macro call here. That macro gets the stack of that function instead of the initial place where we call register_thread
. So stackTop will always point to an incorrect location. This probably means that will fail to find the stackTop and collect the whole stack during the stack sampling instead. But I'm not so sure, sometimes it could early return as well.
We should make sure that we collect this information in the correct place. To be able to do that, we need to convert register_thread into a macro and make sure to get the stackTop
inside that macro and pass it over with the FFI.
Reporter | ||
Updated•3 months ago
|
Description
•