Last Comment Bug 661260 - don't unregister plugins as content handlers just because they are unloaded
: don't unregister plugins as content handlers just because they are unloaded
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: unspecified
: x86 Linux
: -- normal (vote)
: mozilla13
Assigned To: Josh Aas
:
Mentors:
Depends on:
Blocks: 501485
  Show dependency treegraph
 
Reported: 2011-06-01 09:09 PDT by Rodd Zurcher
Modified: 2012-02-14 02:23 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
fix v1.0 (2.57 KB, patch)
2012-02-12 19:29 PST, Josh Aas
benjamin: review+
Details | Diff | Splinter Review

Description Rodd Zurcher 2011-06-01 09:09:53 PDT
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0
Build Identifier: Firefox-4.0.1

There appears to be a race conditions in marking a plugin for unloading and un-registering the mime-types supported by the plugin

Reproducible: Always

Steps to Reproduce:
1. Ensure preference plugins.unloadASAP is true and the citrix plugin and ICA client is installed.
2. Login to a Citrix webserver session
3. Start a citrix app

I realize this a difficult to reproduce use case, but see below for more details.

Actual Results:  
Presented with a save file dialog

Expected Results:  
Citrix plugin should have intercepted the wica file processed it and launched the Citrix client.

This only occurs when plugins.unloadASAP is true. When it's false the plugin intercepts and the client is launched.

After running a --enable-debug build and logging NSPR_LOG_MODULES=Plugin:5,PluginNPP:5,PluginNPN:5 we saw that the citrix plugin was being unloaded and timed very closely to the desired launching...

After looking at Bug 501485 and Bug 500925. I focused on:

http://hg.mozilla.org/releases/mozilla-2.0/file/fca718600ca0/modules/plugin/base/src/nsPluginTags.cpp#l583

Removing

  // Remove mime types added to the category manager
  // only if we were made 'active' by setting the host
  if (mPluginHost) {
    RegisterWithCategoryManager(PR_FALSE, nsPluginTag::ePluginUnregister);
  }

Fixes the problem entirely and we've not found any other regressions. Plugin-container is still being properly shutdown (reclaiming memory) for other plugins etc.
Comment 1 dindog 2012-02-03 00:49:44 PST
I notice a similar condition in Flash plugin:

1. enabled plugins.unloadASAP,

2. When there is no Flash plugin instance in other tab( in other word, the flash plugins is unloaded)

3. Openning a page with only a swf player, like below link:
http://cache.tv.qq.com/qqplayerout.swf?vid=9EoGcKmKIBY&auto=1

Firefox prompts save dialog, not playing the video.

Test with Window 7. FF nightly.
Comment 2 Josh Aas 2012-02-12 19:29:34 PST
Created attachment 596551 [details] [diff] [review]
fix v1.0

Rodd - thanks for the report, your proposed solution looks good to me.
Comment 3 Josh Aas 2012-02-13 06:36:54 PST
try server run:

https://tbpl.mozilla.org/?tree=Try&rev=7566bd5b71ac
Comment 4 Josh Aas 2012-02-13 08:54:45 PST
pushed to mozilla-inbound

http://hg.mozilla.org/integration/mozilla-inbound/rev/d834ff0f66c1
Comment 5 Marco Bonardo [::mak] 2012-02-14 02:23:25 PST
https://hg.mozilla.org/mozilla-central/rev/d834ff0f66c1

Note You need to log in before you can comment on or make changes to this bug.