cefclient on os x and plugins

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

cefclient on os x and plugins

Postby theotherarf » Tue Mar 01, 2011 4:29 pm

Hi,

I have built cef at revision 186 on 10.6 using chromium at revision 74933.

When using cefclient all npapi plugins cause the program to crash at plugin.GetAcceleratedSurface(). Is it just my build or a known problem with the mac port?

Thanks
theotherarf
Newbie
 
Posts: 2
Joined: Tue Mar 01, 2011 4:22 pm

Re: cefclient on os x and plugins

Postby magreenblatt » Tue Mar 01, 2011 6:21 pm

What NPAPI plugin(s) are you loading? What's the call stack for the crash?

You could try disabling accelerated compositing by setting CefBrowserSettings.accelerated_compositing_disabled to true and see if that makes a difference.

It would also be helpful to create a Mac OS X version of the cefclient plugin tests so that this has better test coverage for the future. If you find yourself debugging NPAPI problems please consider doing this.

Thanks,
Marshall
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: cefclient on os x and plugins

Postby theotherarf » Wed Mar 02, 2011 2:47 am

The crash occurs with all plugins I've tried, even flash player.

I have tried disabling accelerated compositing as you suggested, and also i have tried disabling accelerated layers. Neither had an effect.

The error is at line 386 of webplugin_delegate_impl_mac.mm, where plugin_->GetAcceleratedSurface() has returned a null pointer and we then try to dereference it.

Code: Select all
surface_ = plugin_->GetAcceleratedSurface();

       // If surface initialization fails for some reason, just continue
       // without any drawing; returning false would be a more confusing user
       // experience (since it triggers a missing plugin placeholder).
        if (surface_->context()) {
          renderer_ = [[CARenderer rendererWithCGLContext:surface_->context()
                                                  options:NULL] retain];
         
 }


I can stop the crash by simply checking the state of surface_ before use, but then plugins do nothing.

Here it the backtrace for the crash.

#0 0x0083c7b0 in webkit::npapi::WebPluginDelegateImpl::PlatformInitialize (this=0x24b49380) at Users/adam/chromium/home/chrome/svn/chromium/chromium/src/webkit/support/../plugins/npapi/webplugin_delegate_impl_mac.mm:386
#1 0x00838921 in webkit::npapi::WebPluginDelegateImpl::Initialize (this=0x24b49380, url=@0x2a79d4f4, arg_names=@0x2a79d580, arg_values=@0x2a79d58c, plugin=0x2a79d4a0, load_manually=false) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/webkit/support/../plugins/npapi/webplugin_delegate_impl.cc:107
#2 0x008402be in webkit::npapi::WebPluginImpl::initialize (this=0x2a79d4a0, container=0x2a79d868) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/webkit/support/../plugins/npapi/webplugin_impl.cc:241
#3 0x006f64d7 in WebKit::FrameLoaderClientImpl::createPlugin (this=0x621656c, size=@0xbfffc470, element=0x2a758c90, url=@0xbfffc520, paramNames=@0xbfffc5cc, paramValues=@0xbfffc5c0, mimeType=@0x2a758cf4, loadManually=false) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/third_party/WebKit/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp:1445
#4 0x01701492 in WebCore::SubframeLoader::loadPlugin (this=0x6890634, pluginElement=0x2a758c90, url=@0xbfffc520, mimeType=@0x2a758cf4, paramNames=@0xbfffc5cc, paramValues=@0xbfffc5c0, useFallback=false) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../loader/SubframeLoader.cpp:340
#5 0x017023e6 in WebCore::SubframeLoader::requestObject (this=0x6890634, ownerElement=0x2a758c90, url=@0x2a758cf8, frameName=@0x2d758c4, mimeType=@0x2a758cf4, paramNames=@0xbfffc5cc, paramValues=@0xbfffc5c0) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../loader/SubframeLoader.cpp:132
#6 0x00e9fb88 in WebCore::HTMLEmbedElement::updateWidget (this=0x2a758c90, pluginCreationOption=WebCore::CreateAnyWidgetType) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../html/HTMLEmbedElement.cpp:184
#7 0x0176ab5e in WebCore::FrameView::updateWidget (this=0x6abe400, object=0x2a75910c) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../page/FrameView.cpp:1807
#8 0x0176ad1d in WebCore::FrameView::updateWidgets (this=0x6abe400) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../page/FrameView.cpp:1839
#9 0x0176b075 in WebCore::FrameView::performPostLayoutTasks (this=0x6abe400) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../page/FrameView.cpp:1881
#10 0x0176f0f3 in WebCore::FrameView::layout (this=0x6abe400, allowSubtree=true) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../page/FrameView.cpp:953
#11 0x0176f99f in WebCore::FrameView::layoutTimerFired (this=0x6abe400) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../page/FrameView.cpp:1546
#12 0x01772da1 in WebCore::Timer<WebCore::FrameView>::fired (this=0x6abe50c) at Timer.h:99
#13 0x01314b28 in WebCore::ThreadTimers::sharedTimerFiredInternal (this=0x623cd50) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../platform/ThreadTimers.cpp:112
#14 0x01314c6b in WebCore::ThreadTimers::sharedTimerFired () at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/third_party/WebKit/Source/WebCore/WebCore.gyp/../platform/ThreadTimers.cpp:90
#15 0x0086af54 in webkit_glue::WebKitClientImpl::DoTimeout (this=0x6213100) at webkitclient_impl.h:82
#16 0x0086b134 in DispatchToMethod<webkit_glue::WebKitClientImpl, void (webkit_glue::WebKitClientImpl::*)()> (obj=0x6213100, method={__pfn = 0x86af32 <webkit_glue::WebKitClientImpl::DoTimeout()>, __delta = 0}, arg=@0xbfffc91f) at tuple.h:541
#17 0x0086b177 in base::BaseTimer<webkit_glue::WebKitClientImpl, false>::TimerTask::Run (this=0x24bc3a90) at timer.h:160
#18 0x000fbb4f in MessageLoop::RunTask (this=0x620bb10, task=0x24bc3a90) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_loop.cc:362
#19 0x000fbcd9 in MessageLoop::DeferOrRunPendingTask (this=0x620bb10, pending_task=@0xbfffca9c) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_loop.cc:371
#20 0x000fc551 in MessageLoop::DoWork (this=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_loop.cc:564
#21 0x000c9a34 in base::MessagePumpCFRunLoopBase::RunWork (this=0x620bcb0) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_pump_mac.mm:296
#22 0x000c9a79 in base::MessagePumpCFRunLoopBase::RunWorkSource (info=0x620bcb0) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_pump_mac.mm:274
#23 0x90982361 in __CFRunLoopDoSources0 ()
#24 0x9097ff8f in __CFRunLoopRun ()
#25 0x9097f464 in CFRunLoopRunSpecific ()
#26 0x9097f291 in CFRunLoopRunInMode ()
#27 0x97c66004 in RunCurrentEventLoopInMode ()
#28 0x97c65dbb in ReceiveNextEventCommon ()
#29 0x97c65c40 in BlockUntilNextEventMatchingListInMode ()
#30 0x90b5e78d in _DPSNextEvent ()
#31 0x90b5dfce in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#32 0x000c9617 in base::MessagePumpNSApplication::DoRun (this=0x620bcb0, delegate=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_pump_mac.mm:687
#33 0x000c9b65 in base::MessagePumpCFRunLoopBase::Run (this=0x620bcb0, delegate=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_pump_mac.mm:212
#34 0x000fc83c in MessageLoop::RunInternal (this=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_loop.cc:337
#35 0x000fc857 in MessageLoop::RunHandler (this=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_loop.cc:310
#36 0x000fc8bb in MessageLoop::Run (this=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/base/message_loop.cc:234
#37 0x008bd179 in CefMessageLoopForUI::DoMessageLoopIteration (this=0x620bb10) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/cef/libcef/cef_process.cc:41
#38 0x008bc6f1 in CefProcess::DoMessageLoopIteration (this=0x620ba80) at /Users/adam/chromium/home/chrome-svn/tarball/chromium/src/cef/libcef/cef_process.cc:82
#39 0x008ba733 in CefDoMessageLoopWork () at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/cef/libcef/cef_context.cc:76
#40 0x008e56f3 in (anonymous namespace)::RunLoopObserver (observer=0x6212040, activity=2, info=0x0) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/cef/libcef/cef_process_ui_thread_mac.mm:41
#41 0x909c3e02 in __CFRunLoopDoObservers ()
#42 0x9097fd8d in __CFRunLoopRun ()
#43 0x9097f464 in CFRunLoopRunSpecific ()
#44 0x9097f291 in CFRunLoopRunInMode ()
#45 0x97c66004 in RunCurrentEventLoopInMode ()
#46 0x97c65dbb in ReceiveNextEventCommon ()
#47 0x97c65c40 in BlockUntilNextEventMatchingListInMode ()
#48 0x90b5e78d in _DPSNextEvent ()
#49 0x90b5dfce in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#50 0x90b20247 in -[NSApplication run] ()
#51 0x0000d977 in main (argc=1, argv=0xbffff538) at /Users/adam/chromium/home/chrome-svn/chromium/chromium/src/cef/tests/cefclient/cefclient_mac.mm:441
#52 0x0000217e in start () at new:93
theotherarf
Newbie
 
Posts: 2
Joined: Tue Mar 01, 2011 4:22 pm

Re: cefclient on os x and plugins

Postby magreenblatt » Wed Mar 02, 2011 9:27 am

Try with the Chromium test_shell application and see if plugins work there. If so, then you should be able to compare code to identify what isn't working for CEF.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Devyre and 97 guests