-
Notifications
You must be signed in to change notification settings - Fork 2
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
Python 3.11 segmentation fault in grpc test; seg. fault in task.get_stack(limit=1) accessing frame.f_back #96
Comments
See grpc/grpc#31441 |
Here's a smaller reproducer. I think the problem is that GRPC has close code that calls task.get_stack(limit=1). This seg-faults with certain tasks, perhaps because they are created with cython? import asyncio
import finsy as fy
from finsy.test.gnmi_server import GNMIServer
def get_stack():
tasks = asyncio.all_tasks()
for task in tasks:
print(task)
task.get_stack(limit=1) # seg faults: _task_get_stack
async def main():
async with GNMIServer("127.0.0.1:19559").run():
async with fy.GNMIClient("127.0.0.1:19559") as client:
sub = client.subscribe()
sub.once(fy.GNMIPath("/"))
await sub._subscribe()
get_stack()
asyncio.run(main()) The output on my machine looks like this:
Note that the offending task's coroutine is cython...
|
There is a Python 3.11 bug that may be related: python/cpython#99110. The seg. fault happens on this line of code trying to access |
Still an invalid memory access on Python 3.11.1. Here's the same program with python 3.11.1 running under valgrind on ubuntu:
|
There's an assert fail in the debug build of python 3.11.1, when printing information about the cython task. Edit: The ResourceWarning is due to
|
Fixed in Python 3.11.2. (python/cpython#99110.) |
Using grpcio 1.50.0 and Python 3.11.0, the test
test_switch1
will fail with a segmentation fault.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.
The text was updated successfully, but these errors were encountered: