Cannot create a gRPC server with PyPy

Issue #2637 on hold
Omer Katz
created an issue

This issue is present in PyPy2/3 5.8.0 and possibly previous versions which I haven't checked. When creating a gRPC server we get an RPython fatal error because CPyListStrategy_getstorage_copy is not implemented.

You can reproduce this problem by installing grpc:

pip install grpcio

and running the following script:

import grpc
from concurrent import futures
server = grpc.server(futures.ThreadPoolExecutor(max_workers=1))

The code snippet above returns the following error:

RPython traceback:
  File "pypy_interpreter.c", line 38711, in BuiltinCode4_fastcall_4
  File "implement_2.c", line 12927, in fastfunc_descr_setslice_4
  File "pypy_objspace_std_1.c", line 22711, in EmptyListStrategy_setslice
  File "pypy_module_cpyext_2.c", line 16832, in CPyListStrategy_getstorage_copy
Fatal RPython error: NotImplementedError
Aborted (core dumped)

Comments (9)

  1. Armin Rigo

    A failing test:

    diff -r 2a268685e180 -r 4c231c335a3c pypy/module/cpyext/test/
    --- a/pypy/module/cpyext/test/  Sat Aug 19 14:03:49 2017 +0200
    +++ b/pypy/module/cpyext/test/  Sun Aug 20 11:30:04 2017 +0200
    @@ -226,6 +226,15 @@
             assert space.int_w(space.len(w_l)) == 10
    +    def test_getstorage_copy(self, space, api):
    +        w = space.wrap
    +        w_l = w([1, 2, 3, 4])
    +        api.PySequence_Fast(w_l, "foo") # converts
    +        w_l1 = w([])
    +        space.setitem(w_l1, space.newslice(w(0), w(0), w(1)), w_l)
    +        assert map(space.unwrap, space.unpackiterable(w_l1)) == [1, 2, 3, 4]
     class AppTestSequenceObject(AppTestCpythonExtensionBase):
         def test_fast(self):
  2. Carl Friedrich Bolz-Tereick

    I hopefully fixed this the original problem in 06465478f8df (but forgot to comment). Now I get this error when trying to import grpcio (after building it myself). I think it is related to something @mattip saw recently?

    ImportError: unable to load extension module '/home/cfbolz/bin/pypyenv-latest/site-packages/grpc/_cython/': /home/cfbolz/bin/pypyenv-latest/site-packages/grpc/_cython/ undefined symbol: PyPyObject_GC_UnTrack
  3. mattip

    ImportError: unable to load extension module ... undefined symbol: PyPyObject_GC_UnTrack

    Strange, I wonder who is converting PyObject_GC_UnTrack to PyPyObject_GC_UnTrack. The first is a C macro defined in our object.h and not mangled AFAICT, where is the second one coming from? Cython?

  4. Omer Katz reporter

    I finally managed to run the tests. We have some segfaults while creating servers. I'm investigating and will return with the conclusions.

  5. Log in to comment