Commit f8fe5cf
committed
Recover python frames when BPF fails to read PyCodeObject
When bpf_probe_read_user fails to read a PyCodeObject (e.g. page
swapped out), push the frame with codeobject_id=0 instead of aborting
the unwind. This preserves the rest of the stack trace.
On the agent side, handle ebpfChecksum=0 in getCodeObject by skipping
the LRU cache (no checksum to validate against) and the staleness
check (no BPF reference to compare). The agent reads the code object
via process_vm_readv which supports page faults, so it can succeed
where BPF could not. Store the calculated checksum in the cache so
subsequent frames with a real BPF checksum can match.1 parent 7a56dbf commit f8fe5cf
4 files changed
Lines changed: 14 additions & 7 deletions
File tree
- interpreter/python
- support/ebpf
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
454 | 454 | | |
455 | 455 | | |
456 | 456 | | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
461 | 463 | | |
462 | 464 | | |
463 | 465 | | |
| |||
512 | 514 | | |
513 | 515 | | |
514 | 516 | | |
515 | | - | |
| 517 | + | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
| |||
533 | 535 | | |
534 | 536 | | |
535 | 537 | | |
536 | | - | |
| 538 | + | |
537 | 539 | | |
538 | 540 | | |
539 | 541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
Binary file not shown.
Binary file not shown.
0 commit comments