Bug report
Bug description:
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).
CPython versions tested on:
CPython main
Operating systems tested on:
Linux, macOS
Linked PRs
Bug report
Bug description:
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 withjson.dumps— both recurse to the depth of the deepest sampled stack. The remote unwinder captures up toMAX_FRAMES(1536) frames, but export runs at the default recursion limit (1000), so profiling a program that recurses deeper than ~1000 makesexport()raiseRecursionErrorand write no flamegraph. Both--flamegraphand--diff-flamegraphare affected (the diff collector inheritsexport).Reachable when profiling a program that raised its own recursion limit and recurses deeply (recursive-descent parsers, tree/graph walkers, deep serializers).
CPython versions tested on:
CPython main
Operating systems tested on:
Linux, macOS
Linked PRs