Closed Bug 169753 Opened 22 years ago Closed 22 years ago

NPN_GetURL and friends fail if called before NPP_New returns

Categories

(Core Graveyard :: Plug-ins, defect, P3)

x86
Windows 2000
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.2beta

People

(Reporter: hjtoi-bugzilla, Assigned: peterl-bugs)

References

()

Details

(Keywords: testcase, Whiteboard: [PL2:NA])

Attachments

(1 file)

Warning: going to URL may break your profile!

Go to URL with a clean profile. You will see several assertions about
OnStopDecode (bug 78134). After those a popup window will come up that
apparently tries to display stuff in Windows media player plugin. Then you will
get assertion "Unable to get an nsIInterfaceRequestor from the channel" in
nsJSProtocolHandler.cpp line 136 (stack below). Hitting Retry (to debug) I get
another assertion saying "Plugin performed illegal operation" in file
nsPluginHostImpl.cpp line 6041. Hitting retry I get exception breakpoint dialog
at which point I got the stack below the first stack.

Ignoring the asserts everything seems to be ok until you try to access menus,
click links or do anything: menus appear empty and nothing happens when you try
to click links etc.

This happens with Netscape 7.0 as well.

Killing the process and starting again will get me gazillion asserts during startup.

Stack 1:

nsDebug::Assertion(const char * 0x05aab740, const char * 0x05aab720, const char
* 0x05aab6e8, int 136) line 280 + 13 bytes
nsJSThunk::EvaluateScript(nsIChannel * 0x04b82590) line 136 + 60 bytes
nsJSChannel::AsyncOpen(nsJSChannel * const 0x04b824e0, nsIStreamListener *
0x04b822e0, nsISupports * 0x00000000) line 595 + 23 bytes
nsPluginHostImpl::NewPluginURLStream(nsPluginHostImpl * const 0x0153c310, const
nsString & {"javascript:document.location;"}, nsIPluginInstance * 0x04c7d740,
nsIPluginStreamListener * 0x04b820f8, const char * 0x00000000, int 0, unsigned
int 0, const char * 0x00000000, unsigned int 0) line 5671 + 44 bytes
nsPluginHostImpl::GetURLWithHeaders(nsPluginHostImpl * const 0x0153c310,
nsISupports * 0x04c7d740, const char * 0x05afa434, const char * 0x00000000,
nsIPluginStreamListener * 0x04b820f8, const char * 0x00000000, const char *
0x00000000, int 0, unsigned int 0, const char * 0x00000000) line 3007 + 44 bytes
nsPluginHostImpl::GetURL(nsPluginHostImpl * const 0x0153c310, nsISupports *
0x04c7d740, const char * 0x05afa434, const char * 0x00000000,
nsIPluginStreamListener * 0x04b820f8, const char * 0x00000000, const char *
0x00000000, int 0) line 2956
MakeNew4xStreamInternal(_NPP * 0x04c7d758, const char * 0x05afa434, const char *
0x00000000, eNPPStreamTypeInternal eNPPStreamTypeInternal_Get, int 1, void *
0x00000000, unsigned long 0, const char * 0x00000000, unsigned char 0) line 785
+ 45 bytes
_geturlnotify(_NPP * 0x04c7d758, const char * 0x05afa434, const char *
0x00000000, void * 0x00000000) line 824 + 31 bytes
NPDSPLAY! 05ac06da()

Stack 2:
nsPluginHostImpl::HandleBadPlugin(nsPluginHostImpl * const 0x0109a1ec, PRLibrary
* 0x04963908, nsIPluginInstance * 0x03ecf0b0) line 6041 + 35 bytes
ns4xPluginInstance::InitializePlugin(nsIPluginInstancePeer * 0x03ecf170) line
817 + 276 bytes
ns4xPluginInstance::Initialize(ns4xPluginInstance * const 0x03ecf0b0,
nsIPluginInstancePeer * 0x03ecf170) line 635
nsPluginHostImpl::TrySetUpPluginInstance(nsPluginHostImpl * const 0x0109a1e8,
const char * 0x04963878, nsIURI * 0x03ecee50, nsIPluginInstanceOwner *
0x04963428) line 4000 + 21 bytes
nsPluginHostImpl::SetUpPluginInstance(nsPluginHostImpl * const 0x0109a1ec, const
char * 0x04963878, nsIURI * 0x03ecee50, nsIPluginInstanceOwner * 0x04963428)
line 3802 + 28 bytes
nsPluginHostImpl::InstantiateEmbededPlugin(nsPluginHostImpl * const 0x0109a1ec,
const char * 0x04963878, nsIURI * 0x03ecee50, nsIPluginInstanceOwner *
0x04963428) line 3483 + 24 bytes
nsObjectFrame::InstantiatePlugin(nsIPresContext * 0x04962c28,
nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, nsIPluginHost *
0x0109a1ec, const char * 0x04963878, nsIURI * 0x03ecee50) line 1306
nsObjectFrame::Reflow(nsObjectFrame * const 0x04a615dc, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 1157 + 51 bytes
nsLineLayout::ReflowFrame(nsIFrame * 0x04a615dc, unsigned int & 0,
nsHTMLReflowMetrics * 0x00000000, int & 0) line 1051 + 43 bytes
nsInlineFrame::ReflowInlineFrame(nsIPresContext * 0x04962c28, const
nsHTMLReflowState & {...}, nsInlineFrame::InlineReflowState & {...}, nsIFrame *
0x04a615dc, unsigned int & 0) line 715 + 22 bytes
nsInlineFrame::ReflowFrames(nsIPresContext * 0x04962c28, const nsHTMLReflowState
& {...}, nsInlineFrame::InlineReflowState & {...}, nsHTMLReflowMetrics & {...},
unsigned int & 0) line 527 + 28 bytes
nsInlineFrame::Reflow(nsInlineFrame * const 0x04a61050, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 437 + 28 bytes
nsLineLayout::ReflowFrame(nsIFrame * 0x04a61050, unsigned int & 0,
nsHTMLReflowMetrics * 0x00000000, int & 0) line 1051 + 43 bytes
nsBlockFrame::ReflowInlineFrame(nsBlockReflowState & {...}, nsLineLayout &
{...}, nsLineList_iterator {...}, nsIFrame * 0x04a61050, unsigned char *
0x0012bbb4) line 3839 + 22 bytes
nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState & {...}, nsLineLayout &
{...}, nsLineList_iterator {...}, int * 0x0012c308, unsigned char * 0x0012c0b4,
int 1, int 1) line 3706 + 32 bytes
nsBlockFrame::DoReflowInlineFramesAuto(nsBlockReflowState & {...},
nsLineList_iterator {...}, int * 0x0012c308, unsigned char * 0x0012c0b4, int 1,
int 1) line 3610 + 46 bytes
nsBlockFrame::ReflowInlineFrames(nsBlockReflowState & {...}, nsLineList_iterator
{...}, int * 0x0012c308, int 1, int 1) line 3554 + 36 bytes
nsBlockFrame::ReflowLine(nsBlockReflowState & {...}, nsLineList_iterator {...},
int * 0x0012c308, int 1) line 2592
nsBlockFrame::ReflowDirtyLines(nsBlockReflowState & {...}) line 2274 + 31 bytes
nsBlockFrame::Reflow(nsBlockFrame * const 0x04a5fbd4, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 949 + 15 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x04a5fbd4, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 0, unsigned int & 0) line 790 + 31 bytes
nsTableCellFrame::Reflow(nsTableCellFrame * const 0x04a5fb74, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 945
nsContainerFrame::ReflowChild(nsIFrame * 0x04a5fb74, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 0, unsigned int & 0) line 790 + 31 bytes
nsTableRowFrame::IR_TargetIsChild(nsTableRowFrame * const 0x04a5f9d4,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, nsTableFrame & {...}, unsigned int & 0, nsIFrame *
0x04a5fb74) line 1311 + 45 bytes
nsTableRowFrame::IncrementalReflow(nsTableRowFrame * const 0x04a5f9d4,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, nsTableFrame & {...}, unsigned int & 0) line 1195 +
46 bytes
nsTableRowFrame::Reflow(nsTableRowFrame * const 0x04a5f9d4, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 1464 + 35 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x04a5f9d4, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 0, unsigned int & 0) line 790 + 31 bytes
nsTableRowGroupFrame::IR_TargetIsChild(nsTableRowGroupFrame * const 0x04a5f848,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, nsRowGroupReflowState
& {...}, unsigned int & 0, nsIFrame * 0x04a5f9d4) line 1627 + 45 bytes
nsTableRowGroupFrame::IncrementalReflow(nsTableRowGroupFrame * const 0x04a5f848,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, nsRowGroupReflowState
& {...}, unsigned int & 0) line 1296 + 42 bytes
nsTableRowGroupFrame::Reflow(nsTableRowGroupFrame * const 0x04a5f848,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, unsigned int & 0) line 1205 + 31 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x04a5f848, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 0, unsigned int & 0) line 790 + 31 bytes
nsTableFrame::IR_TargetIsChild(nsTableFrame * const 0x04a5f660, nsIPresContext *
0x04962c28, nsTableReflowState & {...}, unsigned int & 0, nsIFrame * 0x04a5f848)
line 3029 + 50 bytes
nsTableFrame::IncrementalReflow(nsTableFrame * const 0x04a5f660, nsIPresContext
* 0x04962c28, const nsHTMLReflowState & {...}, unsigned int & 0) line 2757 + 38
bytes
nsTableFrame::Reflow(nsTableFrame * const 0x04a5f660, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 2017 + 27 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x04a5f660, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 3, unsigned int & 0) line 790 + 31 bytes
nsTableOuterFrame::OuterReflowChild(nsTableOuterFrame * const 0x04a54e44,
nsIPresContext * 0x04962c28, nsIFrame * 0x04a5f660, const nsHTMLReflowState &
{...}, nsHTMLReflowMetrics & {...}, int * 0x00000000, nsSize & {...}, nsMargin &
{...}, nsMargin & {...}, nsMargin & {...}, nsReflowReason
eReflowReason_Incremental, unsigned int & 0) line 1026 + 47 bytes
nsTableOuterFrame::IR_InnerTableReflow(nsTableOuterFrame * const 0x04a54e44,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, unsigned int & 0) line 1340 + 69 bytes
nsTableOuterFrame::IR_TargetIsInnerTableFrame(nsTableOuterFrame * const
0x04a54e44, nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, unsigned int & 0) line 1125 + 31 bytes
nsTableOuterFrame::IR_TargetIsChild(nsTableOuterFrame * const 0x04a54e44,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, unsigned int & 0, nsIFrame * 0x04a5f660) line 1097 +
31 bytes
nsTableOuterFrame::IncrementalReflow(nsTableOuterFrame * const 0x04a54e44,
nsIPresContext * 0x04962c28, nsHTMLReflowMetrics & {...}, const
nsHTMLReflowState & {...}, unsigned int & 0) line 1077 + 42 bytes
nsTableOuterFrame::Reflow(nsTableOuterFrame * const 0x04a54e44, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 1579 + 31 bytes
nsBlockReflowContext::ReflowBlock(const nsRect & {...}, int 0,
nsCollapsingMargin & {...}, int 1, nsMargin & {...}, nsHTMLReflowState & {...},
unsigned int & 0) line 536 + 42 bytes
nsBlockFrame::ReflowBlockFrame(nsBlockReflowState & {...}, nsLineList_iterator
{...}, int * 0x0012e038) line 3313 + 59 bytes
nsBlockFrame::ReflowLine(nsBlockReflowState & {...}, nsLineList_iterator {...},
int * 0x0012e038, int 1) line 2492 + 27 bytes
nsBlockFrame::ReflowDirtyLines(nsBlockReflowState & {...}) line 2274 + 31 bytes
nsBlockFrame::Reflow(nsBlockFrame * const 0x04a549f4, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 949 + 15 bytes
nsBlockReflowContext::ReflowBlock(const nsRect & {...}, int 1,
nsCollapsingMargin & {...}, int 1, nsMargin & {...}, nsHTMLReflowState & {...},
unsigned int & 0) line 536 + 42 bytes
nsBlockFrame::ReflowBlockFrame(nsBlockReflowState & {...}, nsLineList_iterator
{...}, int * 0x0012ec68) line 3313 + 59 bytes
nsBlockFrame::ReflowLine(nsBlockReflowState & {...}, nsLineList_iterator {...},
int * 0x0012ec68, int 1) line 2492 + 27 bytes
nsBlockFrame::ReflowDirtyLines(nsBlockReflowState & {...}) line 2274 + 31 bytes
nsBlockFrame::Reflow(nsBlockFrame * const 0x04a546f0, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 949 + 15 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x04a546f0, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 0, unsigned int & 0) line 790 + 31 bytes
CanvasFrame::Reflow(CanvasFrame * const 0x04a54190, nsIPresContext * 0x04962c28,
nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, unsigned int & 0)
line 567
nsBoxToBlockAdaptor::Reflow(nsBoxLayoutState & {...}, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0, int 0, int 0, int 4800, int 3900, int 1) line 882
nsBoxToBlockAdaptor::DoLayout(nsBoxToBlockAdaptor * const 0x04a5450c,
nsBoxLayoutState & {...}) line 625 + 46 bytes
nsBox::Layout(nsBox * const 0x04a5450c, nsBoxLayoutState & {...}) line 1064
nsScrollBoxFrame::DoLayout(nsScrollBoxFrame * const 0x04a542cc, nsBoxLayoutState
& {...}) line 395
nsBox::Layout(nsBox * const 0x04a542cc, nsBoxLayoutState & {...}) line 1064
nsBoxFrame::Reflow(nsBoxFrame * const 0x04a54294, nsIPresContext * 0x04962c28,
nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, unsigned int & 0)
line 1007
nsContainerFrame::ReflowChild(nsIFrame * 0x04a54294, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0,
int 0, unsigned int 0, unsigned int & 0) line 790 + 31 bytes
ViewportFrame::Reflow(ViewportFrame * const 0x04a54154, nsIPresContext *
0x04962c28, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...},
unsigned int & 0) line 577
IncrementalReflow::Dispatch(nsIPresContext * 0x04962c28, nsHTMLReflowMetrics &
{...}, const nsSize & {...}, nsIRenderingContext & {...}) line 894
PresShell::ProcessReflowCommands(int 1) line 6461
ReflowEvent::HandleEvent() line 6306
HandlePLEvent(ReflowEvent * 0x0495ab58) line 6320
PL_HandleEvent(PLEvent * 0x0495ab58) line 643 + 10 bytes
PL_ProcessPendingEvents(PLEventQueue * 0x00fc8c60) line 573 + 9 bytes
_md_EventReceiverProc(HWND__ * 0x001200e6, unsigned int 49472, unsigned int 0,
long 16551008) line 1308 + 9 bytes
assigning to peterl: can you take a look at this one
Assignee: beppe → peterl
Priority: -- → P3
Whiteboard: [PL2:NA]
Target Milestone: --- → mozilla1.2beta
Alright, I found the problem:

ns4xPluginInstance::mPeer and mStarted wasn't being set until NPN_New finished
and we were failing when creating a javascript URL requested via
NPN_GetURLNotify(target=null).

The following patch will set these variables before NPN_New is called and clear
them out if that function returns error.
Status: NEW → ASSIGNED
Keywords: patch, review, testcase
Summary: Browser stops responding to most events, and can break profile → NPN_GetURL and friends fail if called before NPP_New returns
Attached patch patch v.1Splinter Review
Comment on attachment 99894 [details] [diff] [review]
patch v.1

r=av
Attachment #99894 - Flags: review+
Comment on attachment 99894 [details] [diff] [review]
patch v.1

sr=heikki
Attachment #99894 - Flags: superreview+
patch in trunk, marking FIXED:

/cvsroot/mozilla/modules/plugin/base/src/ns4xPluginInstance.cpp
new revision: 1.100; previous revision: 1.99

thanks all!
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Keywords: review
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: