Firefox plugin crash in Chrome

From what I collect, Google Chrome can run browser plugins written with NPAPI .

I wrote one that works fine in Firefox but does a Crash Crash and is recorded as soon as you insert it into the page. I don't even need to call any of my methods, the nesting is enough to cause a crash.

How do I debug this? I tried tying the debugger to chrome, but the stack traces I get are deep in Chrome itself, and as I said, none of "my" actual code gets run, but presumably it's only NPAPI init code.

Some pointers would be appreciated.

+1


source to share


3 answers


As it turned out, some of the initialization code from the old NPAPI plugin example I was using was causing the crash. I wish I had resolved this for quite some time and cannot find the specific changes I made to fix this in the source control history. Anyway, my problem was fixed and was caused by me being stupid and blindly trusting the example code.



+2


source


The Chromium dev docs describe some techniques for attaching Visual Studio processes to Chrome: Chromium Developer Documentation> Chromium Debugging .

Some issues you may have encountered with the NPAPI plugin in Chrome:



  • Your plugin will be launched in a separate process from the Chrome UI. (You probably already know this :)
  • If multiple instances of your plugin are loaded (on the same HTML page or in different Chrome tabs), your plugin instances will run in the same process together. If you have global variables, your plugin instances can stomp on top of each other.
  • Chrome uses DEP (Data Execution Protection), but Firefox doesn't. If you are using ATL or other JIT code tricks, DEP can cause your plugin to crash.
+4


source


Chrome is open source ... have you tried downloading the source and building it? This way you can at least point your IDE to the source tree and automatically plug it in when it crashes, which might give you a little more information about what happened.

It won't solve your mistake, of course, but it might help you communicate this to the Chrome team. As you well know, the plugin API is pretty unusual for Chrome, and it's possible that the bug belongs to them and not yours.

+2


source







All Articles