Closed Bug 661260 Opened 10 years ago Closed 10 years ago

don't unregister plugins as content handlers just because they are unloaded

Categories

(Core :: Plug-ins, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: rodd.zurcher, Assigned: jaas)

References

Details

Attachments

(1 file)

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.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → joshmoz
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.
Hardware: Other → x86
Blocks: 501485
Attached patch fix v1.0Splinter Review
Rodd - thanks for the report, your proposed solution looks good to me.
Attachment #596551 - Flags: review?(benjamin)
Summary: Enabling plugins.unloadASAP (true) breaks Citrix Plugin → don't unregister plugins as content handlers just because they are unloaded
Attachment #596551 - Flags: review?(benjamin) → review+
https://hg.mozilla.org/mozilla-central/rev/d834ff0f66c1
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.