Git Product home page Git Product logo

Comments (6)

ripread avatar ripread commented on July 23, 2024
$rust-gdb compositor
(gdb) b  wayland_server::event_loop::global_bind::{{closure}}<wayland_server::generated::server::wl_compositor::WlCompositor,rwc::CompositorGlobal>
(gdb) run
Breakpoint 1 ...
let data = &*(data as ...);
(gdb) n
let handler = data.0;
(gdb) print data[0]
$1 = {0x1, 0x3}

So the self pointer is already invalid when global_bind is called

from wayland-rs.

ripread avatar ripread commented on July 23, 2024

The data = Box::new(...) in register_global has the same address as data in global_bind, some somewhere betwen the two something's overwriting that memory.

from wayland-rs.

elinorbgr avatar elinorbgr commented on July 23, 2024

Okay, this is very concerning.

Running your first code, I get this

Breakpoint 1, compositor::{{impl}}::bind (self=0xc000100000001, evqh=0x3, global=WlCompositor = {...})

Looks like I only get evqh to be corrupted, not self ? Are your running this on wayland-server 0.9.3 ?

The second one gives me the same thing: $1 = {0xc000100000001, 0x3}

from wayland-rs.

elinorbgr avatar elinorbgr commented on July 23, 2024

well no, looks like when the user data is set in register_global, the values are {0x7ffff6636000, 0x7ffff661f060}...

from wayland-rs.

elinorbgr avatar elinorbgr commented on July 23, 2024

Oh well...

Hardware watchpoint 2: *0x7ffff6636010

Old value = -161259520
New value = 0
0x00007ffff7bd3bdd in wl_map_insert_at () from /usr/lib/libwayland-server.so.0

from wayland-rs.

elinorbgr avatar elinorbgr commented on July 23, 2024

Alright, found. When the Global object returned by register_global is destroyed, it frees the backing storage of the user data...

This is plainly wrong, as it's documented that you can let it go out of scope. I'll correct this.

from wayland-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.