-
Notifications
You must be signed in to change notification settings - Fork 41
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
Assert in pending_errors #947
Comments
What version of XOrg are you using? |
Could you tell a bit more about the situation / program / anything where this happens? TL;DR: The error that you are seeing is a failure of something like this: fn foo(heap: &mut BinaryHeap<u32>) {
if let Some(num) = heap.peek() {
// Do something else; this might do a "return" so that a later call tries the same thing again.
assert_eq!(Some(num), heap.pop());
}
} As far as I can tell... it should be impossible for this assertion to fail. And not because of any X11-related reason. That's just Rust. The usual reaction to that is to call "memory corruption!"
Okay, so... You can send requests to the X11 server. Like Sequence numbers are used to match requests to their replies. A reply for request number 5 will contain the number 5. If request number 5 caused an error, there will be an error packet containing the number 5. I guess you know about https://docs.rs/x11rb/latest/x11rb/cookie/index.html#handling-x11-errors : There are options to just ignore errors, to return them on the cookie, or to have them returned as an event to the main loop ( With that out of the way... The code in Now, what does // Check if any of the still in-flight responses got a reply/error
while let Some(&Reverse(seqno)) = inner.in_flight.peek() {
let result = match conn.poll_for_reply(seqno) {
Err(()) => {
// This request was not answered/errored yet, so later request will not
// have answers as well.
return None;
}
Ok(reply) => reply,
};
let seqno2 = inner.in_flight.pop();
assert_eq!(Some(Reverse(seqno)), seqno2); It looks at the first entry of If it got a reply, it now has to change the state and remove the dealt-with entry, so it calls |
Thanks for the info! My computer has version 1:7.7+23ubuntu2 of the xserver-xorg package. The situation where this occurs is a bit complex as I'm building a CLAP audio plugin and this happens when I open the user interface for the plugin.
For some reason it's not showing the full call stack, and the only reason I realized it's the assert mentioned above is that I have Sentry integration which was able to return information for the assert. plinth-plugin is my code which through a couple of function ends up calling I'll continue digging but this is the information I have at the moment. |
This assert is triggering in pending_errors, line 56:
assert_eq!(Some(Reverse(seqno)), seqno2);
This results from calling
poll_for_event()
.I'm a bit stumped as to how to debug what's going wrong, and my knowledge of X11 is quite limited so that doesn't help.
The text was updated successfully, but these errors were encountered: