Skip to content

Importing rubicon.objs hangs on pypy #406

@almarklein

Description

@almarklein

Describe the bug

When I try to import rubicon.objc using Pypy, the process hangs while it allocates more and more memory. I traced this down to this line, and it seems to be related to the PyDictObject:

class StgDictObject(ctypes.Structure):
_fields_ = [
("dict", PyDictObject),
("size", ctypes.c_ssize_t),
("align", ctypes.c_ssize_t),
("length", ctypes.c_ssize_t),
("ffi_type_pointer", ffi_type),
("proto", ctypes.py_object),
("setfunc", SETFUNC),
("getfunc", GETFUNC),
# There are a few more fields, but we leave them out again because we don't need them.
]

With "traced it down" I mean that I put 1/0 in the code to make it raise an exception. If the it hung instead of raising the exception, then the hangup occurred bedore it. The code above is where it hangs. And if I comment the field with the PyDictObject, then it does not hang, so it looks like it's related to that.

I tried with pypy3.8-7.3.11 and pypy3.9-7.3.11, both installed via pyenv.

Steps to reproduce

Run import ubicon.objc in a pypy interpreter. The process hangs, does not respond to ctrl-c.

Expected behavior

I would expect the import to work :)

Screenshots

No response

Environment

MacOS M1 pro Sonoma 14.3

Logs


Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions