ChakraCore
ChakraCore copied to clipboard
can't use chakra and chakracore in one app
I embed chakra and chkracore in one app, but when call two APIs, app crashes. I test in VB6: eg: .... LoadLibrary("Chakra.dll") LoadLibrary("ChakraCore.dll") ... wheather static dll mode or dynamic load dll both crashes. If invoke only one set of APIs,it can run any times.
There is overlap in API and exported symbols, this two DLLs would have trouble coexisting in one address space. I doubt you need to load them both, Chakra.dll
is a superset of ChakraCore.dll
.
I write a vb program, want to use both engines in one app, I use static declare to import two dlls, then when I write some code like Chakra.JsCreateRuntime(..) (1) ... ChakrCore.JsCreateRuntime(..) (2) ...
the statement (1) succeed, the statement (2) crashed, exchange the order of (1) and (2), the later statment crashed. And I found Chakra Engine can't coexist with Ms ScriptControl too.
They are not compatible, both in binary sense and in terms of supported APIs. The reason for load crash is that the same functions defined are defined in both (some potentially with different contents to make things worse), this leads to name clashes when you load the second runtime, as conflicting symbols have been already loaded from the first. On a deeper level they are not functionally equivalent either, Chakra.dll has proprietary Windows API support in it, which is absent from ChakraCore.dll.
You will need to isolate them in the app. Do you need to run them literally at the same time? If it would pick one at a time, you can load them one at at time, and unload if you are going to use the other one after.
For running two simultaneously, you would have to put them in separate processes, which would need communicate with the main process, though I am not sure how to do that in VB.