The sampling profiler's flamegraph export (profiling.sampling.stack_collector.FlamegraphCollector.export) builds the flamegraph tree with a recursive walk (convert_children) and then serializes it with json.dumps — both recurse to the depth of the deepest sampled stack. The remote unwinder captures up to MAX_FRAMES (1536) frames, but export runs at the default recursion limit (1000), so profiling a program that recurses deeper than ~1000 makes export() raise RecursionError and write no flamegraph. Both --flamegraph and --diff-flamegraph are affected (the diff collector inherits export).
Reachable when profiling a program that raised its own recursion limit and recurses deeply (recursive-descent parsers, tree/graph walkers, deep serializers).
Activity
pythongh-156545: Fix flamegraph export RecursionError on deeply recur…
pythongh-156545: Verify recursion limit restoration during export
gh-156545: Fix flamegraph export RecursionError on deeply recursive p…
[3.15] gh-156545: Fix flamegraph export RecursionError on deeply recu…
Revert "[3.15] pythongh-156545: Fix flamegraph export RecursionError …
gh-156545, gh-158539: Fix deep flamegraph export on small C stacks an…
pythongh-156545, pythongh-158539: Fix deep flamegraph export on small…
[3.15] Restore deferred backports for 3.15.1, including GH-158874 (#1…