ponty / PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
BSD 2-Clause "Simplified" License
697 stars 78 forks source link

XIO: fatal IO error 22 (Invalid argument) on X server ":0" after 143 requests (136 known processed) with 12 events remaining. #81

Open song-hl opened 1 year ago

song-hl commented 1 year ago

I use in a docker container with

from pyvirtualdisplay import Display
disp = Display().start()
#  my code
disp.stop()

after runing,I got the output as follow:

XIO:  fatal IO error 22 (Invalid argument) on X server ":0"
      after 143 requests (136 known processed) with 12 events remaining.

but when i use xvfb-run python code.py, the fatal IO error would not appear. How can I fix it?

ponty commented 10 months ago

I can't reproduce your use case. I did this based on the report:

$ cat Dockerfile 
FROM ubuntu:22.04

RUN apt-get update && apt-get install -y xvfb
RUN apt-get install -y python3 python3-pip
RUN pip3 install pyvirtualdisplay

$ docker build  .  -t xvfb-test
$ docker run --rm -it xvfb-test bash

#  python3 -c "from pyvirtualdisplay import Display;disp = Display().start();print(3);disp.stop()"
3