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

RESOLVED FIXED in mozilla13

Status

()

Core
Plug-ins
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Rodd Zurcher, Assigned: Josh Aas)

Tracking

unspecified
mozilla13
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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)

Updated

5 years ago
Assignee: nobody → joshmoz

Comment 1

5 years ago
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
(Assignee)

Updated

5 years ago
Blocks: 501485
(Assignee)

Comment 2

5 years ago
Created attachment 596551 [details] [diff] [review]
fix v1.0

Rodd - thanks for the report, your proposed solution looks good to me.
Attachment #596551 - Flags: review?(benjamin)
(Assignee)

Comment 3

5 years ago
try server run:

https://tbpl.mozilla.org/?tree=Try&rev=7566bd5b71ac
(Assignee)

Updated

5 years ago
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+
(Assignee)

Comment 4

5 years ago
pushed to mozilla-inbound

http://hg.mozilla.org/integration/mozilla-inbound/rev/d834ff0f66c1
https://hg.mozilla.org/mozilla-central/rev/d834ff0f66c1
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.