Closed Bug 303487 Opened 19 years ago Closed 8 years ago

ASSERTION: this should only be called after we've retrieved a progress iface: 'mWebProgress', file r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp, line 268

Categories

(Core Graveyard :: Embedding: APIs, defect)

x86
Windows XP
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: timeless, Assigned: adamlock)

Details

(Keywords: assertion, crash)

note; this is a very unhappy computer, but it's a legal case.

R:\mozilla\dbg-i686-pc-cygwin\dist\bin>winEmbed.exe
You are embedded, man!

******************************************************************
*                                                                *
*  IMPORTANT NOTE:                                               *
*                                                                *
*  WinEmbed is not supported!!! Do not raise bugs on it unless   *
*  it is badly broken (e.g. crash on start/exit, build errors)   *
*  or you have the patch to make it better! MFCEmbed is now our  *
*  embedding test application on Win32 and all testing should    *
*  be done on that.                                              *
*                                                                *
******************************************************************


Type Manifest File: R:\mozilla\dbg-i686-pc-cygwin\dist\bin\components\xpti.dat
+++ JavaScript debugging hooks installed.
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nsNativeComponentLoader: registering deferred (0)
nsNativeComponentLoader: GetFactory(gklayout.dll) Load FAILED with error: error 
999
nsNativeComponentLoader: GetFactory(gklayout.dll) Load FAILED with error: error 
999
nsNativeComponentLoader: GetFactory(imglib2.dll) Load FAILED with error: error 
999
nsNativeComponentLoader: GetFactory(rdf.dll) Load FAILED with error: error 999
###!!! ASSERTION: Could not initialize nsXULContentUtils: 'Error', file 
r:/mozilla/layout/build/nsLayoutModule.cpp, line 302
###!!! ASSERTION: Factory creation failed: 'NS_SUCCEEDED(rv)', file 
r:/mozilla/xpcom/components/nsNativeComponentLoader.cpp, line 158
WARNING: Cannot create startup observer : service,@mozilla.org/typeaheadfind;1, 
file r:/mozilla/embedding/components/appstartup/src/nsAppStartupNotifier.cpp, 
line 112
nsNativeComponentLoader: GetFactory(appshell.dll) Load FAILED with error: error 
999
WARNING: Cannot create startup observer : service,@mozilla.org/rdf/datasource;1?
name=window-mediator, file 
r:/mozilla/embedding/components/appstartup/src/nsAppStartupNotifier.cpp, line 
112
nsNativeComponentLoader: GetFactory(gkgfxwin.dll) Load FAILED with error: error 
999
nsNativeComponentLoader: GetFactory(docshell.dll) Load FAILED with error: error 
999
WARNING: NS_ENSURE_TRUE(mDocShell) failed, file 
r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp, line 446
###!!! ASSERTION: this should only be called after we've retrieved a progress 
iface: 'mWebProgress', file 
r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp, line 268
Break: at file r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp, line 
268

 # 
00 ntdll!DbgBreakPoint (FPO: [0,0,0])
01 xpcom_core!nsDebugImpl::Break(char * aFile = 
0x023578a4 "r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp", int 
aLine = 0x10c)+0x7e (FPO: [Non-Fpo]) (CONV: stdcall) 
[r:\mozilla\xpcom\base\nsdebugimpl.cpp @ 350]
02 xpcom_core!nsDebugImpl::Assertion(char * aStr = 0x023578f0 "this should only 
be called after we've retrieved a progress iface", char * aExpr = 
0x023578e0 "mWebProgress", char * aFile = 
0x023578a4 "r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp", int 
aLine = 0x10c)+0x29e (FPO: [Non-Fpo]) (CONV: stdcall) 
[r:\mozilla\xpcom\base\nsdebugimpl.cpp @ 266]
03 xpcom_core!nsDebug::Assertion(char * aStr = 0x023578f0 "this should only be 
called after we've retrieved a progress iface", char * aExpr = 
0x023578e0 "mWebProgress", char * aFile = 
0x023578a4 "r:/mozilla/embedding/browser/webBrowser/nsWebBrowser.cpp", int 
aLine = 0x10c)+0x4d (FPO: [Non-Fpo]) (CONV: cdecl) [r:\mozilla\dbg-i686-pc-
cygwin\xpcom\build\nsdebug.cpp @ 109]
04 webbrwsr!nsWebBrowser::BindListener+0x56
05 webbrwsr!nsWebBrowser::Create+0x4a6
06 winEmbed!WebBrowserChrome::CreateBrowser(int aX = 0xffffffff, int aY = 
0xffffffff, int aCX = 0xffffffff, int aCY = 0xffffffff, class nsIWebBrowser ** 
aBrowser = 0x0012fe00)+0x171 (FPO: [Non-Fpo]) (CONV: thiscall) 
[r:\mozilla\embedding\tests\winembed\webbrowserchrome.cpp @ 91]
07 winEmbed!AppCallbacks::CreateBrowserWindow(unsigned int aChromeFlags = 
0xffe, class nsIWebBrowserChrome * aParent = 0x00000000, class 
nsIWebBrowserChrome ** aNewWindow = 0x0012fedc)+0xaf (FPO: [Non-Fpo]) (CONV: 
cdecl) [r:\mozilla\embedding\tests\winembed\winembed.cpp @ 1155]
08 winEmbed!OpenWebPage(char * url = 
0x00413578 "http://www.mozilla.org/projects/minimo")+0x35 (FPO: [Non-Fpo]) 
(CONV: cdecl) [r:\mozilla\embedding\tests\winembed\winembed.cpp @ 237]
09 winEmbed!main(int argc = 1, char ** argv = 0x003d7a88)+0x173 (FPO: [Non-
Fpo]) (CONV: cdecl) [r:\mozilla\embedding\tests\winembed\winembed.cpp @ 181]
0a winEmbed!mainCRTStartup(void)+0x12c (FPO: [Non-Fpo]) (CONV: cdecl) 
[f:\vs70builds\3077\vc\crtbld\crt\src\crtexe.c @ 398]
0b kernel32!BaseProcessStart+0x23 (FPO: [Non-Fpo])

NS_IMETHODIMP nsWebBrowser::Create()
{
   NS_ENSURE_STATE(!mDocShell && (mParentNativeWindow || mParentWidget));

   NS_ENSURE_SUCCESS(EnsureDocShellTreeOwner(), NS_ERROR_FAILURE);

   nsCOMPtr<nsIWidget> docShellParentWidget(mParentWidget);
   if(!mParentWidget) // We need to create a widget
      {
      // Create the widget
      NS_ENSURE_TRUE(mInternalWidget = do_CreateInstance(kChildCID), 
NS_ERROR_FAILURE);

      docShellParentWidget = mInternalWidget;
      nsWidgetInitData  widgetInit;

      widgetInit.clipChildren = PR_TRUE;
      widgetInit.mContentType = (mContentType == typeChrome || 
        mContentType == typeChromeWrapper)? eContentTypeUI: eContentTypeContent;

      widgetInit.mWindowType = eWindowType_child;
      nsRect bounds(mInitInfo->x, mInitInfo->y, mInitInfo->cx, mInitInfo->cy);
      
      mInternalWidget->SetClientData(NS_STATIC_CAST(nsWebBrowser *, this));
      mInternalWidget->Create(mParentNativeWindow, bounds, 
nsWebBrowser::HandleEvent,
                              nsnull, nsnull, nsnull, &widgetInit);  
      }

   nsCOMPtr<nsIDocShell> docShell(do_CreateInstance("@mozilla.org/webshell;1"));
   NS_ENSURE_SUCCESS(SetDocShell(docShell), NS_ERROR_FAILURE);

   // get the system default window background colour
   {
      nsCOMPtr<nsILookAndFeel> laf = do_GetService(kLookAndFeelCID);
      laf->GetColor(nsILookAndFeel::eColor_WindowBackground, mBackgroundColor);
   }

   // the docshell has been set so we now have our listener registrars.
   if (mListenerArray) {
      // we had queued up some listeners, let's register them now.
      PRInt32 count = mListenerArray->Count();
      PRInt32 i = 0;
      NS_ASSERTION(count > 0, "array construction problem");
      while (i < count) {
          nsWebBrowserListenerState *state = (nsWebBrowserListenerState*)
mListenerArray->ElementAt(i);
          NS_ASSERTION(state, "array construction problem");
          nsCOMPtr<nsISupports> listener = do_QueryReferent(state->mWeakPtr);
          NS_ASSERTION(listener, "bad listener");
          (void)BindListener(listener, state->mID);
          i++;
      }
      (void)mListenerArray->EnumerateForwards(deleteListener, nsnull);
      NS_DELETEXPCOM(mListenerArray);
      mListenerArray = nsnull;
   }

   // HACK ALERT - this registration registers the nsDocShellTreeOwner as a 
   // nsIWebBrowserListener so it can setup it's MouseListener in one of the 
   // progress callbacks. If we can register the MouseListener another way, 
this 
   // registration can go away, and nsDocShellTreeOwner can stop implementing
   // nsIWebProgressListener.
   nsCOMPtr<nsISupports> supports = nsnull;
   (void)mDocShellTreeOwner->QueryInterface(NS_GET_IID(nsIWebProgressListener),
                             NS_STATIC_CAST(void**, getter_AddRefs(supports)));
   (void)BindListener(supports, NS_GET_IID(nsIWebProgressListener));

void is bogus, and not checking supports is bogus. initializing a comptr to 
null is just silly.
###!!! ASSERTION: You can't dereference a NULL nsCOMPtr with operator->
().: 'mRawPtr != 0', file ../../../dist/include/xpcom\nsCOMPtr.h, line 849
Break: at file ../../../dist/include/xpcom\nsCOMPtr.h, line 849
Severity: normal → critical
Keywords: crash
So.. instead of using BindListener, should we be using AddWebBrowserListener to
register the listener, since the window has not yet been created?
QA Contact: apis
Marking a bunch of bugs in the "Embedding: APIs" component INCOMPLETE in preparation to archive that component. If I have done this incorrectly, please reopen the bugs and move them to a more correct component as we don't have "embedding" APIs any more.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INCOMPLETE
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.