Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pypy pypy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 674
    • Issues 674
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PyPyPyPy
  • pypypypy
  • Issues
  • #3634
Closed
Open
Issue created Jan 06, 2022 by Joseph Bylund@jbylund

Segfault/RecursionError with psycopg2

I was interested in giving pypy a run, and the first speedbump I hit was with psycopg2. Interestingly I was getting a RecursionError from the RealDictCursor class, but after stripping it down to this minimal example I started getting a segfault instead. You'll need to spin up a postgres in order to test.

import psycopg2 as psycopg2
import psycopg2.extras as psycopg2_extras


def main():
    conn_args = {
        "host": "127.0.0.1",
        "password": "abc",
        "port": 15432,
        "user": "def",
    }
    with psycopg2.connect(**conn_args) as conn:
        conn.cursor_factory = psycopg2_extras.RealDictCursor
        cursor = conn.cursor()
        cursor.execute("select 1 as foo")
        print(list(cursor))


if "__main__" == __name__:
    main()

On my machine this gives:

> /home/josephbylund/.pyenv/versions/pypy3.7-7.3.5/bin/python --jit off test.py 

Fatal error in cpyext, CPython compatibility layer, calling PyObject_Call
Either report a bug or consider not using this particular extension
<StackOverflow object at 0x7f6f96a560c0>
RPython traceback:
  File "pypy_module_cpyext_1.c", line 227, in wrapper_second_level__star_3_31
  File "pypy_module_cpyext_1.c", line 37268, in from_ref
  File "rpython_rlib.c", line 13832, in stack_check_slowpath
Segmentation fault
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking