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
Product: Core
Classification: Components
Component: Plug-ins (show other bugs)
: unspecified
: x86 Linux
-- normal (vote)
: mozilla13
Assigned To: Josh Aas
: Benjamin Smedberg [:bsmedberg]
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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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:


  // 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 User image 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:

Firefox prompts save dialog, not playing the video.

Test with Window 7. FF nightly.
Comment 2 User image 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 User image Josh Aas 2012-02-13 06:36:54 PST
try server run:
Comment 4 User image Josh Aas 2012-02-13 08:54:45 PST
pushed to mozilla-inbound
Comment 5 User image Marco Bonardo [::mak] 2012-02-14 02:23:25 PST

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