https://bugs.freedesktop.org/show_bug.cgi?id=100947
Bug ID: 100947
Summary: The xxxx_set_user_data() API cause client data
corrupted in listener callbacks
Product: Wayland
Version: unspecified
Hardware: All
OS: Linux (All)
Status: NEW
Severity: trivial
Priority: medium
Component: wayland
Assignee: [email protected]
Reporter: [email protected]
Hello everyone.
I'm developing a simple C++ GUI toolkit based on wayland, and get stuck with a
weird problem recently.
I created a simple project with minimal code to reproduce this issue for
demonstration: https://github.com/zhanggyb/set-user-data
It's a CMake C++ project and use simple C++ structures to wrap wayland client
objects.
My test environment:
Fedora 25
Gnome 3.22.2
wayland-devel-1.12.0-1.fc25.x86_64
libwayland-client-1.12.0-1.fc25.x86_64
Checkout, build and run:
$ git clone https://github.com/zhanggyb/set-user-data
$ mkdir build
$ cd build/
$ cmake ..
$ ./demo
Expected result:
display a rectangle surface on desktop
Actual result:
assert error will be raised, and the const member variables around wayland
object will be changed in the wl_output or wl_surface listener callbacks, see
https://github.com/zhanggyb/set-user-data/blob/master/surface.cpp and
https://github.com/zhanggyb/set-user-data/blob/master/output.cpp
Uncomment these 2 lines can avoid assert error:
https://github.com/zhanggyb/set-user-data/blob/master/main.cpp:163:
output.SetUserData(this);
https://github.com/zhanggyb/set-user-data/blob/master/main.cpp:164:
surface.SetUserData(this);
I don't know why this happens, it seems the compositor changes the data in
client, or did I use the xxxx_set_user_data() API in the wrong way?
Thanks in advance.
--
You are receiving this mail because:
You are the assignee for the bug._______________________________________________
wayland-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs