Sitelet https://web.archive.org/web/20250824224735/https://github.com/byllyfish/finsy/issues/96
Skip to content

Python 3.11 segmentation fault in grpc test; seg. fault in task.get_stack(limit=1) accessing frame.f_back #96

@byllyfish

Description

@byllyfish

Using grpcio 1.50.0 and Python 3.11.0, the test test_switch1 will fail with a segmentation fault.

Current thread 0x000000011678b600 (most recent call first):
  File "/usr/local/Cellar/python@3.11/3.11.0/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_tasks.py", line 53 in _task_get_stack
  File "/Users/bfish/code/finsy/.venv_311/lib/python3.11/site-packages/grpc/aio/_channel.py", line 315 in _close
  File "/Users/bfish/code/finsy/.venv_311/lib/python3.11/site-packages/grpc/aio/_channel.py", line 374 in close
  File "/Users/bfish/code/finsy/finsy/p4client.py", line 308 in close
  File "/Users/bfish/code/finsy/finsy/switch.py", line 393 in _run

If I disable the test P4RuntimeServer with an environment variable, the test succeeds.

It seems like there is a memory misbehavior bug in the grpc async server implementation, but client code is tripping over it in _task_get_stack. If I run client code without running any of the server test code, there is no segmentation fault.

For now, the CI tests for Python 3.11 are running with FINSY_TEST_P4RUNTIME_SERVER=skip and FINSY_TEST_GNMI_SERVER=skip.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions