-
Notifications
You must be signed in to change notification settings - Fork 426
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
Profiling native applications employing embedded Python interpreter instances with native tracking enabled (--native
) yields disjoint Python stacks.
Reporters are unable to match native stack frames against Python frames, since the following check doesn't work as designed:
Line 230 in 80a3baa
if pidx >= 0 and "_PyEval_EvalFrameDefault" in symbol: |
At least with our libpython3.11.so frame _PyEval_EvalFrameDefault
is missing from the native stacks, instead only _PyEval_EvalFrame
is present
The check should actually look like this:
for nidx, native_frame in enumerate(native_stack):
symbol = native_frame[0]
if pidx >= 0 and ("_PyEval_EvalFrameDefault" in symbol
or ("_PyEval_EvalFrame" in symbol
and (nidx == len(native_stack) - 1
or "_PyEval_EvalFrameDefault" not in native_stack[nidx + 1][0]))):
it additionally tries to guard against a nested call to _PyEval_EvalFrameDefault.
Expected Behavior
Python stacks are shown embedded in native stacks.
Steps To Reproduce
Too complicated to provide a small repro.
Memray Version
1.17.2
Python Version
3.11
Operating System
Linux
Anything else?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working