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

Call to cairo_xcb_surface_create crashes on re-opening editor. #80

Closed
rehans opened this issue Dec 28, 2018 · 3 comments
Closed

Call to cairo_xcb_surface_create crashes on re-opening editor. #80

rehans opened this issue Dec 28, 2018 · 3 comments
Labels

Comments

@rehans
Copy link
Contributor

rehans commented Dec 28, 2018

Hey,

I stress-tested the AGain.vst3 editor on Linux with Reaper and Bitwig Studio and quickly ran into a crash after closing and re-opening the editor several times. The crash happens on calling cairo_xcb_surface_create (click here).

Before the crash I get an output:
reaper: ../../../../src/cairo-xcb-screen.c:219: _get_screen_index: Assertion `!"reached"' failed.

I searched that on google and found a post by @abique here:
https://lists.cairographics.org/archives/cairo/2017-December/028496.html

So I did what was suggested and extended the ctor of DrawHandler by

(device is a member of DrawHandler)
device = cairo_device_reference(cairo_surface_get_device(surface));

and created a dtor ~DrawHandler with

cairo_device_finish(device);
cairo_device_destroy(device);

Afterwards the crash is gone. Maybe @abique can share his experience. Is this still used in u-he plug-ins?

(I also found this which is doing something very similar: https://chromium.googlesource.com/chromiumos/third_party/cairo/+/f9344911250ea347fb0eb54d7ab1f97c8f685a20/boilerplate/cairo-boilerplate-xcb.c)

Any more ideas?

René

@rehans rehans added the bug label Dec 28, 2018
@abique
Copy link

abique commented Dec 28, 2018

Hi,

In u-he we use cairo image now plus xcb-shm to quickly upload the pixmap to the xserver.
I stopped using cairo-xcb because it has some global variables or caches that I wanted to avoid.
Yes you have to do the ref-counting right.

Regards,
Alex

@scheffle
Copy link
Collaborator

Fixed on the develop branch

@myrrc
Copy link

myrrc commented Apr 26, 2024

Related: sfztools/sfizz-ui#136

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

No branches or pull requests

4 participants