Bug 106463 - PluginPackage::freeLibraryTimerFired asserts if plugin got loaded again meanwhile
Summary: PluginPackage::freeLibraryTimerFired asserts if plugin got loaded again meanw...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 106140
  Show dependency treegraph
 
Reported: 2013-01-09 09:26 PST by David Faure
Modified: 2013-01-10 07:32 PST (History)
3 users (show)

See Also:


Attachments
patch (1.33 KB, patch)
2013-01-09 09:30 PST, David Faure
ap: review+
ap: commit-queue-
Details | Formatted Diff | Diff
patch with style fix (1.33 KB, patch)
2013-01-10 01:31 PST, David Faure
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Faure 2013-01-09 09:26:56 PST
When debugging why the patch in bug 106140 asserts in PluginPackage::freeLibraryTimerFired, it turns out that this is happening:

PluginPackage::load  libTestNetscapePlugIn.so m_loadCount=1
PluginPackage::unload libTestNetscapePlugIn.so m_loadCount now 0
PluginPackage::unloadWithoutShutdown libTestNetscapePlugIn.so m_loadCount=0
PluginPackage::freeLibrarySoon libTestNetscapePlugIn.so m_loadCount=0 (should be 0)
PluginPackage::load libTestNetscapePlugIn.so m_loadCount=1
PluginPackage::freeLibraryTimerFired: unloading libTestNetscapePlugIn.so m_loadCount=1 (should be 0)

If another webpage is loaded after the "scheduled unloading of the plugin via the timer", then we need to skip unloading the plugin.
Comment 1 David Faure 2013-01-09 09:30:02 PST
Created attachment 181936 [details]
patch
Comment 2 WebKit Review Bot 2013-01-09 09:32:37 PST
Attachment 181936 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1
Source/WebCore/plugins/PluginPackage.cpp:71:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 1 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alexey Proskuryakov 2013-01-09 16:57:22 PST
Comment on attachment 181936 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=181936&action=review

Looks reasonable.

>> Source/WebCore/plugins/PluginPackage.cpp:71
>> +    if (m_loadCount == 0) {
> 
> Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]

This is correct, please fix.
Comment 4 David Faure 2013-01-10 01:31:20 PST
Created attachment 182085 [details]
patch with style fix
Comment 5 WebKit Review Bot 2013-01-10 07:32:36 PST
Comment on attachment 182085 [details]
patch with style fix

Clearing flags on attachment: 182085

Committed r139318: <http://trac.webkit.org/changeset/139318>
Comment 6 WebKit Review Bot 2013-01-10 07:32:39 PST
All reviewed patches have been landed.  Closing bug.