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

panic: this shouldn't be possible. please open an issue with Tauri. error code: -1 #996

Open
dceddia opened this issue Oct 24, 2024 · 1 comment

Comments

@dceddia
Copy link

dceddia commented Oct 24, 2024

Describe the bug
Sentry reported a crash in a user's instance of the Recut app.

panic: assertion `left == right` failed: this shouldn't be possible. please open an issue with Tauri. error code: -1
  left: 0
 right: 49862
  ?, in <unknown>
  ?, in <unknown>
  ?, in <unknown>
  ?, in <unknown>
  ?, in <unknown>
...
(14 additional frame(s) were not displayed)

Unfortunately there's no stack trace info here, but I traced the error message to this function in tao:

fn get_wait_thread_id() -> u32 {
unsafe {
let mut msg = MSG::default();
let result = GetMessageW(
&mut msg,
HWND::default(),
*SEND_WAIT_THREAD_ID_MSG_ID,
*SEND_WAIT_THREAD_ID_MSG_ID,
);
assert_eq!(
msg.message, *SEND_WAIT_THREAD_ID_MSG_ID,
"this shouldn't be possible. please open an issue with Tauri. error code: {}",
result.0
);
msg.lParam.0 as u32
}
}

Steps To Reproduce
I don't know how to reproduce this unfortunately. This one user has hit the error a few times, their machine ID is the only one I've seen it from.

Expected behavior
Looking at the code, I think the error might be that it doesn't check the return value before checking that the thread IDs always match. It looks like in my user's case the GetMessageW returned -1 and a zeroed-out msg, so msg.message was 0. Maybe it should have returned early? (I'm not sure about the downstream effects of that though)

The docs for GetMessageW say that it could return an error if the hwnd is invalid or the message pointer is invalid (maybe other reasons too).

Screenshots
No screenshots

Platform and Versions (please complete the following information):
OS: Windows (unsure which version unfortunately; Sentry only says "windows" without a version number)
Rustc: 1.77.1

Additional context
Add any other context about the problem here.

@amrbashir
Copy link
Member

The information is not enough for me to investigate, please let me know if you gather any more info

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

No branches or pull requests

2 participants