-
Notifications
You must be signed in to change notification settings - Fork 147
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
WebApplication in c# with V8ScriptEngine crashes on Mac x64 #483
Comments
I am attaching an example project with a non-working Web Application and a working Console Application |
Hello @Morpheus121, We can't reproduce your issue on macOS 13.0 x64: Does your issue produce a crash report in the Console app? Thanks! |
Please share the exact steps that reproduce the crash. Thanks! |
Steps to reproduce: |
Just to be clear, are you talking about Visual Studio Code or Visual Studio for Mac? |
Yes, it is Visual Studio for Mac |
Hi @Morpheus121, We've reproduced this with Visual Studio for Mac. Oddly, it only happens on macOS x64; Apple Silicon is unaffected. It looks like V8 is crashing the process here. We're investigating. Thanks! |
Hi @Morpheus121, It turns out that we've seen this issue before, but only on Apple Silicon. Maybe something has changed in macOS, .NET, or Visual Studio since then, but now we can only reproduce it on x64. Anyway, what's happening is that V8's call to Our understanding is that JIT compilation is blocked by default but can be enabled via entitlements. Such policies are enforced at the application level, so ClearScript and other libraries can't work around them. However, we've found that libraries carrying a developer signature can bypass some enforcement. That appears intended to streamline developer workflows. Given all that, we're aware of two ways to work around this issue. First, if your application can detect that it's being debugged – via command-line flag, configuration setting, or some other means – it can use Second, you can use the following procedure to apply a developer signature to your copy of ClearScript's V8 dynamic library:
Please let us know if either workaround works for you. Good luck! |
Thanks for the workaround! |
Please reopen this issue if you have additional thoughts or findings related to this topic. Thank you! |
Hello,
I have a problem with V8 Script engine. Application crashes when I use WebApplication project type in C#.
I work on a Mac with Intel processor.
OS 12.6 Monterey.
IDE Rider 2022.3.1.
.NET 7.0.2
Used nuget packages:
Microsoft.ClearScript.V8 7.3.7
Microsoft.ClearScript.Core 7.3.7
Microsoft.ClearScript.V8.ICUData 7.3.7
Microsoft.ClearScript.V8.Native.osx-x64 7.3.7
When I create WebApplication from template in Rider and paste this example from your examples
using var engine = new V8ScriptEngine(); // expose a host type engine.AddHostType("Console", typeof(Console)); engine.Execute("Console.WriteLine('{0} is an interesting number.', Math.PI)");
The application crashes when a new object V8ScriptEngine is created with this error message in console:
Fatal error in , line 0
Check failed: 12 == (*__error()).
FailureMessage Object: 0x7ff7bb170820
When I create ConsoleApplication project type and paste example code, everything works.
The text was updated successfully, but these errors were encountered: