Skip to content

Assertion failure in uv__io_stop #311

Closed
@PromyLOPh

Description

@PromyLOPh
  • uvloop version: uvloop==0.14.0
  • Python version: Python 3.7.5 (3.7.5-2~19.10)
  • Platform: Ubuntu 19.10
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: Yes.
  • Does uvloop behave differently from vanilla asyncio? How?: Vanilla asyncio works fine.

The attached testcase test.zip crashes uvloop with the following message:

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

This looks similar to #88. Here is a stacktrace using gdb: stacktrace.txt

The real-world application tries to read kadmin’s stdout and write to its stdin. The included mock.py replaces kadmin, but – for this issue – behaves the same. Vanilla asyncio works exactly as expected.

edit: Upon further investigation replacing the two lines

proc.stdin.write (password.encode ('utf-8'))
proc.stdin.write (b'\n')

with a single write

proc.stdin.write (password.encode ('utf-8') + b'\n')

solves the issue, which indicates a race condition somewhere inside uvloop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions