You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In part of my miri testing of Rhai, I've discovered that the smartstring crate is unsound in general. After spending many hours tracking down the cause of the UB, I finally narrowed it down and found an issue report for the exact UB. The example I posted also introduces the same UB in Rhai when using the ImmutableString type. (Though it's not limited to my example)
I don't know what the exact unsound conditions for the UB are, but I'm sure someone has accidentally triggered it in Rhai (as I have as well).
The same UB mentioned in the issue below can also be triggered with a var.into() for ImmutableString in Rhai.
Since the last update for this crate was ~2 years ago, I have some doubts on whether the UB will ever be fixed. bodil/smartstring#49
Note, there IS a PR with the fix as far as I can tell, but the author seems to have been unresponsive to issues/PRs. This could be quickly patched by cloning the repo and using that one instead however
For any people who see this and want to fix the potential UB, see this PR for the fix, clone the repo and commit the fix, then place the following lines in your Cargo.toml:
[patch.crates-io]
smartstring = { git = "URL to your patched git repo" }
The text was updated successfully, but these errors were encountered:
In part of my miri testing of Rhai, I've discovered that the smartstring crate is unsound in general. After spending many hours tracking down the cause of the UB, I finally narrowed it down and found an issue report for the exact UB. The example I posted also introduces the same UB in Rhai when using the
ImmutableString
type. (Though it's not limited to my example)I don't know what the exact unsound conditions for the UB are, but I'm sure someone has accidentally triggered it in Rhai (as I have as well).
The same UB mentioned in the issue below can also be triggered with a
var.into()
forImmutableString
in Rhai.Since the last update for this crate was ~2 years ago, I have some doubts on whether the UB will ever be fixed.
bodil/smartstring#49
Note, there IS a PR with the fix as far as I can tell, but the author seems to have been unresponsive to issues/PRs. This could be quickly patched by cloning the repo and using that one instead however
For any people who see this and want to fix the potential UB, see this PR for the fix, clone the repo and commit the fix, then place the following lines in your Cargo.toml:
The text was updated successfully, but these errors were encountered: