Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Segfault during schema parsing

未关闭
#208 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
python

调研方向

先从 graphql/language/ast.py 和 graphql/language/parser.py 中报告的堆栈帧开始,然后检查 gql/client.py,即 schema 解析开始的位置。使用 faulthandler 复现解析大型 schema 字符串,并比较 parser 和 AST 的行为。确定一个可复现的原因,并记录或测试修复方案,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Hey there,

The package is great and has been super reliable for us so far. However, we're running into an intermittent issue where the python exits with code 139 (segfault).

The relevant part of the stack trace, obtained with Python's builtin faulthandler:

main Fatal Python error: Segmentation fault
│ main
│ main Current thread 0x00007f9672f54740 (most recent call first):
│ main   Garbage-collecting
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/ast.py", line 361 in __setattr__
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/ast.py", line 332 in __init__
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 730 in parse_field_definition
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 1134 in optional_many
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 717 in parse_fields_definition
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 697 in parse_object_type_definition
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 288 in parse_definition
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 1153 in many
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 241 in parse_document
│ main   File "/usr/local/lib/python3.11/site-packages/graphql/language/parser.py", line 113 in parse
│ main   File "/usr/local/lib/python3.11/site-packages/gql/client.py", line 105 in __init__               
  • This happens when trying to parse a GraphQL schema as a string, loaded from a network request.
  • The schema is around 2800 lines, which I presume is considered fairly large.
  • The entry point is through the gql library, but the issue seems to be inside graphql-core
  • I couldn't find what could go wrong based on some digging through the stack trace.
  • The package version we're using is 3.2.3.

Could this be a mislabeled OOM error? I don't think so, but worth considering. Is there anything I could do to profile this better? It's a bit hard as it's running inside a Kubernetes pod and we can't reproduce locally, but I can try.

主要语言
Python
星标
531
派生
147
PR 合并指标
30 天内没有已合并 PR

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

graphql-python/graphql-core 的其他 Issue

查看 graphql-python/graphql-core 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。