qt - QtBrowserPlugin crash when I nest other plugin into it: is my fix correct? -


there qtbrowserplugin contains qwebview load page contains other plugin.

(opera      (some_page          (my_qtbrowser_plugin              (qwebview                  (some_other_page                      (some_other_plugin)))))) 

why after loading page loads or attempts load other plugin stops dispatching events qtbrowserplugin (crashes on js call outside: http://sprunge.us/heza)

in stacktrace see:

#3  <signal handler called> #4  0xb63ae1f2 in webcore::identifierrep::string() const () /usr/local/trolltech/qt-4.7.0/lib/libqtwebkit.so.4 #5  0xb63b339c in _npn_utf8fromidentifier () /usr/local/trolltech/qt-4.7.0/lib/libqtwebkit.so.4 #6  0xb76e3d51 in npn_utf8fromidentifier (identifier=0x7ffffffe) @ .../src/qtbrowserplugin.cpp:200 #7  0xb76e4aaf in npclass_hasmethod (npobj=0x80e5c80, name=0x7ffffffe) @ .../src/qtbrowserplugin.cpp:364 

why code in qtbrowserplugin calls things in qtwebkit? there other ideas how debug/fix it?

update i've found calls qtbrowserplugin.cpp:np_initialize twice ( http://sprunge.us/bdfq ):

*** gdb backtrace *** #2  0xb78ad817 in np_initialize (nfuncs=0x807599c, pfuncs=0x8074740) @ /mnt/sda8/src/p/qtbrowserplugin-2.4_1-opensource/src/qtbrowserplugin.cpp:1273 #3  0x080556ea in handle::open(char const*, _npnetscapefuncs*) () #4  0x08056692 in plugincontroller::open(char const*) () #5  0x08055ca8 in main () *** end of backtrace *** ** (operapluginwrapper:1281): debug: np_initialize ** (operapluginwrapper:1281): debug: np_initialize succeeded  *** gdb backtrace *** #2  0xb78ad817 in np_initialize (nfuncs=0xb4357094, pfuncs=0xb4357058) @ /mnt/sda8/src/p/qtbrowserplugin-2.4_1-opensource/src/qtbrowserplugin.cpp: #3  0xb6af7dae in webcore::pluginpackage::load() () /usr/local/trolltech/qt-4.7.0/lib/libqtwebkit.so.4 #4  0xb6af774d in webcore::pluginpackage::fetchinfo() () /usr/local/trolltech/qt-4.7.0/lib/libqtwebkit.so.4 #5  0xb69578ae in webcore::pluginpackage::createpackage(webcore::string const&, long const&) () /usr/local/trolltech/qt-4.7.0/lib/libqtwebkit.so.4 ... 

update 2 fix correct? http://vi-server.org/vi/bin/qtbrowserplugin-2.4_1-opensource-netsing-fix.patch :

diff --git a/qtbrowserplugin-2.4_1-opensource.orig/src/qtbrowserplugin.cpp b/qtbrowserplugin-2.4_1-opensource/src/qtbrowserplugin.cpp index e7c6f31..632d546 100644 --- a/qtbrowserplugin-2.4_1-opensource.orig/src/qtbrowserplugin.cpp +++ b/qtbrowserplugin-2.4_1-opensource/src/qtbrowserplugin.cpp @@ -1271,6 +1271,10 @@ extern "c" nperror winapi np_initialize(npnetscapefuncs* nfuncs, nppluginfuncs*  {      if(!nfuncs)          return nperr_invalid_functable_error; +     +    if(qnetscapefuncs) { +        return nperr_invalid_plugin_error; +    }       qnetscapefuncs = nfuncs;      int navmajorvers = qnetscapefuncs->version >> 8; 

for full-screen requirement it's bit tricky suggest sensible solutions without more details. layering plugins should windowless plugins (i don't know whether qtbrowserplugin supports them, firebreath should support them in next release).

i don't think can fix problem - both browser engines load plugin shared library , same instance due being in same process. both want call np_initialize() exchange function pointers, makes impossible talk both browsers:
store separate npnetspacefuncs, can't (without major hacks) detect browser calls npp_new() etc. , not determine browser should call plugin.

a hacky workaround might use 2 different plugins, 1 each browser engine. keep in mind can break other plugins if use them in both.
alternative fullscreen problem might invoke seperate process, gives full control on gui elements.


Comments