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

Đang mở
#47 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
backend, performance

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Go
Star
41
Fork
4
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của theory/jsonpath

Tất cả issue của theory/jsonpath

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.