8000 PyPy 3.11 incompatibility: TypeError: object.__new__(_CDataBase) is not safe, use _CDataBase.__new__() #5462 · Issue #5291 · pypy/pypy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PyPy 3.11 incompatibility: TypeError: object.__new__(_CDataBase) is not safe, use _CDataBase.__new__() #5462 #5291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
notxvilka opened this issue Jun 4, 2025 · 6 comments

Comments

@notxvilka
Copy link

I am not sure, if the bug is in Angr or in PyPy, but it happens only when calling Angr analysis concurrently. And the error happens in the PyPy's code, so I opened here as well.

/usr/lib/pypy3.11/concurrent/futures/_base.py:456: in result
    return self.__get_result()
/usr/lib/pypy3.11/concurrent/futures/_base.py:401: in __get_result
    raise self._exception
/usr/lib/pypy3.11/concurrent/futures/thread.py:58: in run
    result = self.fn(*self.args, **self.kwargs)
/home/user/.local/lib/pypy3.11/site-packages/angr/analyses/analysis.py:226: in __call__
    r = w(*args, **kwargs)
/home/user/.local/lib/pypy3.11/site-packages/angr/analyses/analysis.py:211: in wrapper
    oself.__init__(*args, **kwargs)
/home/user/.local/lib/pypy3.11/site-packages/angr/analyses/complete_calling_conventions.py:126: in __init__
    self.work()
/home/user/.local/lib/pypy3.11/site-packages/angr/analyses/complete_calling_conventions.py:275: in work
    func_addr, cc, proto, proto_libname, varman = self._results.get(True, timeout=0.01)
/usr/lib/pypy3.11/multiprocessing/queues.py:122: in get
    return _ForkingPickler.loads(res)
/usr/lib/pypy3.11/pickle.py:1785: in _loads
    return _Unpickler(file, fix_imports=fix_imports, buffers=buffers,
/usr/lib/pypy3.11/pickle.py:1226: in load
    dispatch[key[0]](self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <pickle._Unpickler object at 0x00007f2d600d7ec0>
    def load_newobj(self):
        args = self.stack.pop()
        cls = self.stack.pop()
>       obj = cls.__new__(cls, *args)
E       TypeError: object.__new__(_CDataBase) is not safe, use _CDataBase.__new__()
/usr/lib/pypy3.11/pickle.py:1527: TypeError

This looks similar to python/cpython#78465

@mattip
Copy link
Member
mattip commented Jun 5, 2025

What is _CDataBase, where does it come from?

@mattip
Copy link
Member
mattip commented Jun 5, 2025

Could you add a try: except: around the call to return _ForkingPickler.loads(res) and provide the contents of res?

@cfbolz
Copy link
Member
cfbolz commented Jun 5, 2025

it's a class from cffi, I'm not sure they are picklable

@mattip
Copy link
Member
mattip commented Jun 5, 2025

I think that should not be exposed in the pickled object, so it would be nice to see what actually is getting pickled.

@mattip
Copy link
Member
mattip commented Jun 14, 2025

it's a class from cffi, I'm not sure they are picklable

somehow it works on CPython, so @notxvilka it would be good to figure out how we can reproduce this.

@notxvilka
Copy link
Author

it's a class from cffi, I'm not sure they are picklable

somehow it works on CPython, so @notxvilka it would be good to figure out how we can reproduce this.

Ok, here is the pickle string (example_8) that caused this error, I retried the attached script individually, and it is triggered consistently. It requires installed Angr though:

pypy-bug-5291.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0