Thanks for the heads up. It's true that i worked around this issue by guaranteeing that it only gets called once. Later I will try to build v8 in Debug and see what happens.
On Wednesday, 17 April 2019 04:09:33 UTC-4, Jakob Kummerow wrote: > > "InitializeOncePerProcess" means it only *needs* to be called once. I > have no idea whether calling it repeatedly is supposed to work. Maybe it > would be easy to make it work -- that's why it would be interesting to know > what exactly is causing the crash. If it's easier for you to work around > it, then I suppose you might as well just do that. > > On Tue, Apr 16, 2019 at 10:38 PM <[email protected] <javascript:>> wrote: > >> Thanks for the reply! >> >> I'm currently pulling down the v8 binaries from Nuget, so building V8 in >> Debug mode would take some effort (I'll have to figure it out! - hopefully >> https://github.com/pmed/v8-nuget is all i need). >> >> I guess my main question is whether or not Initialize can be called more >> than once (ie. what does InitializeOncePerProcess means). If it can only be >> called once by design, then that's that. If not, then this is worth >> investigating further. >> >> Andrei >> >> On Tuesday, 16 April 2019 05:00:32 UTC-4, Jakob Kummerow wrote: >>> >>> From the stack trace, it looks like you ran into a CHECK or DCHECK. If >>> you compile in Debug mode and run in a debugger, you should be able to find >>> out which (D)CHECK it was, which should shed some light onto what's going >>> on. >>> >>> On Tue, Apr 16, 2019 at 12:13 AM <[email protected]> wrote: >>> >>>> Hi all! >>>> >>>> I've embedded V8 (7.4.288.11 from NuGet) into an C# ASP.NET >>>> application. There is some glue code that initializes V8 (As per the >>>> hello-world sample): >>>> >>>> bool result = v8::V8::InitializeICUDefaultLocation(path); >>>> v8::V8::InitializeExternalStartupData(path); >>>> platform = v8::platform::NewDefaultPlatform(); >>>> v8::V8::InitializePlatform(platform.get()); >>>> v8::V8::Initialize(); >>>> >>>> >>>> This works just fine when called just once. Sometimes, the Initialize >>>> code ends up being called a second time in the same process. (In this case >>>> because the AppDomain recycles but the process stays the same). >>>> >>>> When executing this code the second time, a crash occurs when >>>> v8::V8::InitializePlatform(platform.get()); is called the second time: >>>> >>>> Exception #: 0X80000003 >>>> Stack: >>>> v8_libbase!v8::base::OS::Abort+0x10 >>>> v8_libbase!V8_Fatal+0xf0 >>>> v8!v8::internal::wasm::WasmEngine::InitializeOncePerProcess+0x14a >>>> 0x7fe`99bca45e >>>> 0x7fe`99bc8648 >>>> clr!LogHelp_LogAssert+0x1f93 >>>> {redacted} >>>> >>>> >>>> My understanding is that calling Initialize the second time should >>>> effectively be a no-op. Am I wrong? Shutdown is very well documented re: >>>> you can't re initialize after shutting down, but there isn't much about >>>> calling Initialize multiple time. The name InitializeOncePerProcess to >>>> me implies that my assumption is correct. >>>> >>>> My workaround solution is to create a singleton in my glue code that >>>> keeps track of the state and causes Initialize to be a no-op in my code. >>>> >>>> >>>> Some background: This was a safe operation on a (very old) version of >>>> V8 (3.16.14) I'm working on upgrading it. Running in ASP.NET on IIS >>>> 10. On an AppDomain recycle (not app pool), The managed assemblies are >>>> unloaded and reloaded (but not the unmanaged ones, thus calling >>>> myV8::Initialize). >>>> >>>> Thanks! >>>> >>>> -- >>> >>> -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
