Closed Bug 595525 Opened 15 years ago Closed 15 years ago

Double data deletion in streamTest (nptest.cpp), test_streamNotify.html

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(blocking2.0 betaN+)

RESOLVED FIXED
Tracking Status
blocking2.0 --- betaN+

People

(Reporter: mayhemer, Assigned: mayhemer)

References

Details

Attachments

(1 file, 3 obsolete files)

After bug 537381 had been landed, test modules/plugin/test/test_streamNotify.html started to fail or timeout. Problem is that we try to delete ndata (URLNotifyData*) in nptest.cpp twice during the test: 1. in MakeNewNPAPIStreamInternal [1] listener (nsNPAPIPluginStreamListener), holding reference to notifyData, is released and deletes the notify data in its destructor because we early exit on nsnpapiplugin.cpp:586 as we fail to get URL ("http://localhost:-8/", failure is correct with bug 537381) 2. in streamTest [2], when we get an error from call to either NPN_PostURLNotify or NPN_GetURLNotify, we delete the data again (delete ndata) The timeout on windows is caused by assertion failure dialog box pop-up. I don't understand the test so well to say what should the result of the particular test be with this URL. But as I can see, before bug 537381 landed, this test was failing to load that invalid URL as expected, but later in the phase, not that early during creation of the URL. [1] http://mxr.mozilla.org/mozilla-central/source/modules/plugin/base/src/nsNPAPIPlugin.cpp#558 [2] http://mxr.mozilla.org/mozilla-central/source/modules/plugin/test/testplugin/nptest.cpp#2328
That stream stuff is not me, maybe bsmedberg?
The testplugin is correct, and this indicates a bug somewhere in the plugin host or networking code. * If NPN_GetURLNotify returns a failure code, it must *not* call NPP_URLNotify. * If NPN_GetURLNotify returns a success code, it *must* call NPP_URLNotify. We added this test because this was broken once before and we fixed it as part of the OOPP work. Please fix it again! I don't think you're supposed to call NPP_URLNotify at all until you've returned from NPN_GetURLNotify. Did you back out the original patch, or is the tree currently broken?
Any chance to get this fixed or can we disable the test for a time? This is blocking a final+ bug, so no immediate rush but the patch should bake in beta for a time as it might bring problems also in the outside world.
Who are you asking? I figured you would take it. Nobody else has time, I think.
And no, we cannot disable the test because it is testing something which actually happens in the wild and will cause that crash, which is a potential sg:crit.
(In reply to comment #4) > Who are you asking? I figured you would take it. Nobody else has time, I think. It really wasn't clear from your comment. I have absolutely no knowledge of that code and I don't have much time either, however I can try follow your suggestions. Can I ask you for review/feedback then?
Yes, and/or Josh who is the module owner.
(In reply to comment #5) > And no, we cannot disable the test because it is testing something which > actually happens in the wild and will cause that crash, which is a potential > sg:crit. We apparently can: 83 /* 84 * XXX/bsmedberg: disable this test as well, since the pluginhost is broken 85 * and the testplugin is double-deleting the urlnotify context. So, this bug is actually a known problem, as I can see... http://hg.mozilla.org/mozilla-central/rev/be2c775bddab I might have a fix for this, but the test gets stuck.
Attached patch wip1 (obsolete) — Splinter Review
For consideration
Assignee: nobody → honzab.moz
Status: NEW → ASSIGNED
Attachment #479922 - Flags: feedback?(benjamin)
Benjamin, for bug 537381 to get landed finally, would you be ok to disable the test for -8 port until we solve this?
No! The host:-8 version works currently, and I'm sure that I added that check to make sure that a security bug remained fixed.
Attachment #479922 - Flags: feedback?(benjamin) → feedback?(joshmoz)
Attached patch v1 (obsolete) — Splinter Review
For review. - changes to the host are self explanatory, also see the bug description - test has been changed to expect a sync-failure ; therefor drop in the number of pending tests
Attachment #479922 - Attachment is obsolete: true
Attachment #480095 - Flags: review?(joshmoz)
Attachment #479922 - Flags: feedback?(joshmoz)
Attached patch v1 (obsolete) — Splinter Review
qref...
Attachment #480095 - Attachment is obsolete: true
Attachment #480105 - Flags: review?(joshmoz)
Attachment #480095 - Flags: review?(joshmoz)
Comment on attachment 480105 [details] [diff] [review] v1 With patch for bug 537381 passed try server.
Comment on attachment 480105 [details] [diff] [review] v1 "npAPIPluginStreamListener" - I'm not a fan of this variable name. It looks too much like a misspelled class name. Otherwise this looks good, thanks.
Attachment #480105 - Flags: review?(joshmoz) → review+
Thanks for review. Renamed to PluginStreamListener.
Attachment #480105 - Attachment is obsolete: true
Attachment #482261 - Flags: review+
Comment on attachment 482261 [details] [diff] [review] v1.1 [Check in comment 18] This is blocking a blocking2.0:final+ bug. That bug should be landed in beta first as similar change already caused some trouble in the past.
Attachment #482261 - Flags: approval2.0?
blocking2.0: --- → betaN+
Attachment #482261 - Flags: approval2.0?
Attachment #482261 - Attachment description: v1.1 → v1.1 [Check in comment 18]
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: