Skip to content
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

Grabbing screen concurrently crashes with Linux. #169

Closed
mihaiparvu opened this issue May 21, 2020 · 2 comments · Fixed by #172
Closed

Grabbing screen concurrently crashes with Linux. #169

mihaiparvu opened this issue May 21, 2020 · 2 comments · Fixed by #172
Assignees

Comments

@mihaiparvu
Copy link

General information:

  • OS name: Debian GNU/Linux (VirtualBox)
  • OS version: 10
  • OS architecture: 64 bits
  • Resolutions:
    • Monitor 1: 800x600
  • Python version: 3.7.3
  • MSS version: 5.1.0

For GNU/Linux users:

  • Display server protocol and version, if known: X server
  • Desktop Environment: XFCE 4
  • Composite Window Manager name and version: Cairo v1.14.6

Description of the warning/error

Grabbing screen concurrently by using threads crashes mss when running with Linux.

Code to reproduce:

import time
import threading

from mss import mss


# record for one second
def record():
    start_time = time.time()
    while time.time() - start_time < 1:
        with mss() as sct:
            sct.grab(sct.monitors[1])


t1 = threading.Thread(target=record)
t2 = threading.Thread(target=record)

t1.start()
time.sleep(0.5)
t2.start()

Full message

[xcb] Unknown sequence number while processing reply
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
python3: ../../src/xcb_io.c:643: _XReply: Assertion `!xcb_xlib_threads_sequence_lost' failed.
Aborted

Other details

This is working fine under Windows (5.1.0) and when running with Linux and using and older mss version (4.0.3).

@BoboTiG
Copy link
Owner

BoboTiG commented Jun 28, 2020

Hey,

Sorry for the long delay. Thank you for the report, it will be fixed ASAP :)

@mihaiparvu
Copy link
Author

No worries. Thanks for the fix and your great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants