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

Can not handle server-created objects in loaded file/WAYLAND_DEUBG mode #35

Open
wmww opened this issue Feb 20, 2021 · 1 comment
Open
Labels
bug Something isn't working

Comments

@wmww
Copy link
Owner

wmww commented Feb 20, 2021

It seems #27 may not have been solved for this case, failing test on the way.

@wmww wmww added the bug Something isn't working label Feb 20, 2021
@wmww
Copy link
Owner Author

wmww commented Feb 20, 2021

All right so the problem seems to be that in specifically the case of receiving an event as a client, new_id arguments inside libwayland hold a pointer (the o aka object union member) rather than an int (the n aka new_id union member).

I'm sure this made somebodies code a little simpler, but it causes all manor of problems. We are already doing some shenanigans to account for it in the GDB plugin, but the same can not be said for libwayland's internal WAYLAND_DEBUG code.

It seems to be interpreting the pointer as an int, which means when it prints the object ID it's actually printing an address inside it's own memory. Since we don't have access to it's address space (in the case of a saved log, the process may not even be running anymore), and when the object is used later we only have access to the object ID (not the memory address), there's no way to perfectly match the two.

However, usually objects are created and immediately used. We also have the type, so in most cases we should be able to match up the objects. Actually implementing that within our architecture is challenging. Left for another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant