Skip to content

src/unix/core.c:896: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed. when opening a datagram endpoint #125

@matthiasblondeel

Description

@matthiasblondeel
  • uvloop version: 0.9
  • Python version: 3.6.1
  • Platform: Linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: YES

In uvloop 0.9 it looks like an issue was introduced when creating new udp endpoints.
The below code works fine with uvloop 0.8, but fails and crashes the process in uvloop 0.9

import asyncio
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

receive_addr = ('127.0.0.1', 1234)

async def crash_python():
    counter = 0
    while True:
        transport, _ = await asyncio.get_event_loop().create_datagram_endpoint(
             asyncio.Protocol, reuse_port=True, local_addr=receive_addr)
        print('started', counter)
        counter+=1
        await asyncio.sleep(0.1)
    
asyncio.get_event_loop().run_until_complete(crash_python())

On my system it takes somewhere between 10 and 90 iterations of the counter before a crash occurs.
I get the following assertion:

python: src/unix/core.c:896: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions