System.ArgumentNullException when calling CEFBrowserProcess.V8.OverwoflApi.CreatePluginInstance

Hello,

I have shipped a new version of my app that integrates a new plugin (so a new C# dll), and I have seen several logs like this:

2019-10-24 19:58:48,404 (ERROR) </Files/vendor.js> (:1613) - Fail to create plugin [uknown type] instance: System.ArgumentNullException 

Looking in the BrowserError log, I can see this

24/10/2019 20:28:57.344 Fail to create plugin [uknown type] instance: System.ArgumentNullException  details: System.ArgumentNullException: Value cannot be null.
Parameter name: type
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at CEFBrowserProcess.V8.OverwoflApi.CreatePluginInstance(ServiceObjectData data, CefFrame frame)

Do you know what could be causing this?
And do you know what I could do to prevent this error from happening again?

Thanks!

192cffe7-828a-4790-8fea-0684cf48d6b2.zip (780.3 KB)

@sebastientromp I will forward it to our R&D and update. thanks

update: from looking at the current crash stats, I see that it’s happens on something like ~%3 of the game sessions. From the error in the ticket, it’s something on the plugin side. Without steps to reproduce, it will be tough to find it. We will take a look at your plugin source code and try to find any insights.

@sebastientromp,

  • Can you remove Newtonsoft.Json.dll (it’s 32 bit and old version) and use instead of our Newtonsoft.Json.dll (which is located inside the Overwolf install folder). This way you will not have to add it manually to your OPK.

  • Can you please print which plugin fails to load? It can be as a result of missing dependency, protection software, etc.

    • 2019-10-24 20:28:57,123 (INFO) </Files/vendor.js> (:1613) - “initializing loading window”
    • 2019-10-24 20:28:57,346 (ERROR) </Files/vendor.js> (:1613) - Fail to create plugin [uknown type] instance: System.ArgumentNullException
    • 2019-10-24 20:28:57,346 (ERROR) </Files/vendor.js> (:1613) - "Fail to create plugin [uknown type] instance: System.ArgumentNullException "
    • 2019-10-24 20:28:57,440 (INFO) </Files/vendor.js> (:1613) - “Plugin simple-io-plugin-zip was loaded!”
  • In addition, UnitySpy.dll & UnitySpy.HearthstoneLib.dll are 32 bit. They should be 64bit.

If I could I would, but this log is not written by Firestone. I was assuming it was handled by Overwolf.

  • In addition, UnitySpy.dll & UnitySpy.HearthstoneLib.dll are 32 bit. They should be 64bit.

Oh really? I have compiled them using the x64 profile in Visual Studio, so I guess my config must have an issue. How can you check that it’s properly compiled?

And do you think this could be a cause for crashknowing that it works for most of users like this?

update: we agreed that the next step is to implement Tom’s suggestion:

If you are experiencing many crashes - I’d suggest creating an isolated process for your plugin - he is one way of doing this:

  1. Create an exe program that uses your plugin/implements the plugin by itself
  2. Expose a communication channel (WebSockets/Http server) to this process so that your web app can easily communicate with it
  3. Use our https://github.com/overwolf/overwolf-plugins/tree/master/plugins/process_manager plugin to launch and monitor the process from within your app (if it crashes, you will know)

Please update us if that works for you.

Thanks.

I’m currently closing this ticket. If needed, ping me and I will reopen it.

Thanks.