A deeply nested query crashes the whole process with `fatal error: stack overflow`

オープン
#47 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go

調査の方向性

Start at the query evaluation path and reproduce the issue with a descendant filter repeated about 200 times against a document nested roughly 7,500 arrays deep; parsing succeeds, and evaluation crashes with a stack overflow. Trace the recursive evaluation involved and compare how the project reports errors for invalid queries. Done means deeply nested input returns a catchable error instead of aborting the process.

索引モデルが issue の本文から書いたものです。

説明

Evaluating a very deeply nested descendant-filter query against a deeply nested document overflows the goroutine stack,
and the Go runtime aborts the entire process with fatal error: stack overflow. It's a fatal runtime error, not a
panic, so recover() can't catch it — anything evaluating user-supplied queries can be taken down by one query.

The query is a descendant filter repeated a few hundred times — roughly $..[?@.*&&[email protected]||@.b|| ... ] about 200 times
over — run against a document that's a few thousand nested empty arrays ([[[ ... ]]]). Parsing succeeds; the crash
happens during evaluation. It aborts consistently at around 200 filter levels over a document about 7500 deep.

For comparison, jsonpath-rust stops at a nesting depth of 128 and jsonpath-rfc9535 raises an error you can catch,
rather than crashing.

主要言語
Go
スター
41
フォーク
4
平均マージ
2日 8時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

theory/jsonpath のほかの issue

theory/jsonpath の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。