Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Segfault during schema parsing

Open
#208 0 comments 0 reactions 0 assignees View on GitHub

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

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 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.

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphql-python/graphql-core

All issues in graphql-python/graphql-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.