Segfault during schema parsing
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- backend-api-design
Research direction
Start with the reported stack frames in graphql/language/ast.py and graphql/language/parser.py, then inspect gql/client.py where schema parsing begins. Reproduce parsing a large schema string with faulthandler and compare the parser and AST behavior. Done means identifying a reproducible cause and documenting or testing the fix.
Written by the indexing model from the issue text.
Description
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
gqllibrary, but the issue seems to be insidegraphql-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.
- Dominant language
- Python
- Stars
- 531
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from graphql-python/graphql-core
-
Difficulty 4/5 3-5 days Newbie friendliness 50/100
graphql-python/graphql-core#272 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
graphql-python/graphql-core#269 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
graphql-python/graphql-core#267 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
graphql-python/graphql-core#257 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
graphql-python/graphql-core#247 · 8 comments ·
All issues in graphql-python/graphql-core
Similar issues
-
essnmx good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
[Feature] 奇物选择添加优先级 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Giskard-AI/giskard-oss#2840 · 1 comment ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Openarea: repo bug perceived difficulty: 2
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
yeti-platform/yeti#1380 ·