-
Notifications
You must be signed in to change notification settings - Fork 327
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
Exceptions thrown across boundaries behave differently on Win/Linux #1226
Comments
I can reliably repeat this on Mac. The problem is manifested only in debug build. On release build the second message is not printed. Feels like it might be related to denoland/deno#19021 |
This was referenced May 10, 2023
bartlomieju
added a commit
that referenced
this issue
May 12, 2023
…1227) Reproduces #1226 and denoland/deno#19021 ``` // Fails $ V8_FROM_SOURCE=1 cargo test exception // Passes $ V8_FROM_SOURCE=1 cargo test --release exception ``` We bisected this and this problem first appeared with V8 v11.2 upgrade. After further bisects we established that v8/v8@1f349da#diff-de75fc3e7b84373d94e18b4531827e8b749f9bbe05b59707e894e4e0ce2a1535 is the first V8 commit that causes this failure. However after more investigation we can't find any reason why that particular commit might cause this problem. It is only reproducible in debug build, but not release build. Current working theory is that it is a Rust compiler bug as changing the optimization level for this code makes the bug go away. This commit should be considered a band-aid that works around the problem, but doesn't fix it completely. We are gonna go with it as it unblocks un on day-to-day work, but ultimately we should track it down (or wait for another Rust upgrade which might fix it?). --------- Co-authored-by: Bert Belder <bertbelder@gmail.com>
Thanks for the report. This is now fixed in 6ac0fab and I'm cutting |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Consider this simple example of having a rust print function that calls a
repr
function on passed objects. Asrepr
can be arbitrary Js code, it could throw an exception. Since the exception occurs inside the Rust -> Js -> Rust -> Js chain, the only plausible course of action is to return control to the Js engine via normal means and hope that it escapes from there into the intendedTryCatch
handler.This happens as expected on my Windows machine. The script prints out
and exits. However, running on my Ubuntu desktop, returning control to Js results in continuation of execution and I get
The
TryCatch
is aware of the exception. Setting up anotherTryCatch
inside the printing function and rethrowing in case of errors works as expected.Unfortunately I don't have a working C++ v8 build on both of my machines to test whether this is an upstream issue or related to how the binding works. I'm aware that it's illegal to execute any Js operations while an exception is pending, but I don't see how you could avoid it here unless you are setting up another explicit
TryCatch
and rethrowing.The text was updated successfully, but these errors were encountered: