profiling: flamegraph export fails with RecursionError on a deeply recursive program
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
profiling/sampling/stack_collector.py の FlamegraphCollector.export と、その convert_children ウォークから始めます。キャプチャされたスタック深度を再帰制限が超える、深く再帰するプログラムを使い、--flamegraph と --diff-flamegraph の両方で再現します。両方のエクスポートパスが RecursionError なしで flamegraph を生成すれば完了です。すでに進行中の作業については、リンクされた PR gh-156546 を確認してください。
索引モデルが issue の本文から書いたものです。
説明
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
- gh-156546
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 558
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/cpython のほかの issue
-
docs pending
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
stdlib type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
build type-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
stdlib topic-email type-feature
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
🐛 Bug 🔔 Pending processing
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
jumpserver/jumpserver#17584 ·