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

Unexpected panic: assertion 'left= right failed: cannot change database mid-query #536

Closed
Chronostasys opened this issue Jul 26, 2024 · 0 comments · Fixed by #532
Closed

Comments

@Chronostasys
Copy link
Contributor

Hi, I recently updated my project's salsa to the newest version, and everything works well in debug mode. But as
soon as I switched to the release build, a weird panic occurred:
5fdfa4e06b2fa8fd121d20b940e58245

You can see in the pic above that Rust is saying that two pointers with the address 0×14660cbb0 are not equal.

After some digging around, I found this issue: rust-lang/rust#107975

And this: rust-lang/rust#107975

I believe there's a mistake in the mid-query check, instead of checking the equivalent of two fat pointers, we shall check only the address.

salsa/src/local_state.rs

Lines 87 to 91 in e4ce917

assert_eq!(
current_db,
NonNull::from(db),
"cannot change database mid-query",
);

Chronostasys added a commit to Pivot-Studio/pivot-lang that referenced this issue Jul 28, 2024
See salsa-rs/salsa#536

There's a fix in the main stream, but that fix is using an unstable api
`std::ptr::addr_eq` which will cause compile failure in our ci.

Anyway, I decided to swicth salsa to my custom fork before it went
stable to avoid possible similar issues.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant