Closed Bug 106859 Opened 23 years ago Closed 23 years ago

Memory leak of 114 bytes in nsMemory::Clone

Categories

(Core :: XPCOM, defect, P4)

x86
Windows 2000
defect

Tracking

()

VERIFIED DUPLICATE of bug 106860
mozilla0.9.6

People

(Reporter: stephend, Assigned: brendan)

Details

(Keywords: memory-leak)

Attachments

(1 file)

Trunk CVS pull @8pm (tonight), Windows 2000.

Using the autocomplete setup provided by hong@netscape.com.

Steps to Reproduce:

1.  Mozilla.exe -compose.
2.  Type dmos (it'll complete to Dan Mosedale <dmose@netscape.com>).
3.  Tab to subject.
4.  Exit.

    [W] MLK: Memory leak of 114 bytes from 2 blocks allocated in PR_Malloc
        Distribution of leaked blocks
        Allocation location
        malloc+0xc           [C:\WINNT\SYSTEM32\msvcrt.DLL ip=0x580013eb]
        PR_Malloc+0x2c       [.\../../../../pr/src/malloc/prmem.c:50 
ip=0x30018c5c]
        nsMemory::Clone(void const*,UINT)+0x8f 
[c:\moz_src\mozilla\xpcom\base\nsMemoryImpl.cpp:592 ip=0x1003be36]
            if (gMemory == nsnull) {
                EnsureGlobalMemoryService();
            }
     =>     void* newPtr = gMemory->Alloc(size);
            if (newPtr)
                memcpy(newPtr, ptr, size);
            return newPtr;
        nsFastLoadService::StartMuxedDocument(nsISupports *,char const*,int)
+0x403 [c:\moz_src\mozilla\xpcom\io\nsFastLoadService.cpp:282 ip=0x1006c220]
            if ((aDirectionFlags & NS_FASTLOAD_WRITE) && mOutputStream) {
                control = do_QueryInterface(mOutputStream);
                if (control)
     =>             rv = control->StartMuxedDocument(aURI, aURISpec);
            }
            return rv;
        }
        nsXULDocument::PrepareToLoadPrototype(nsIURI *,char const*,nsIPrincipal 
*,nsIParser * *)+0x2c0 
[c:\moz_src\mozilla\content\xul\document\src\nsXULDocument.cpp:5154 
ip=0x0561f95a]
                // from the pre-existing part of the file.
                rv = gFastLoadService->StartMuxedDocument(aURI, urlspec,
                                                  
nsIFastLoadService::NS_FASTLOAD_READ |
     =>                                           
nsIFastLoadService::NS_FASTLOAD_WRITE);
                NS_ASSERTION(rv != NS_ERROR_NOT_AVAILABLE, "only reading 
FastLoad?!");
                if (NS_FAILED(rv))
                    AbortFastLoads();
        nsXULDocument::ResumeWalk(void)+0xa97 
[c:\moz_src\mozilla\content\xul\document\src\nsXULDocument.cpp:5829 
ip=0x05622a6a]
                    PR_LOG(gXULLog, PR_LOG_DEBUG, ("xul: overlay was not 
cached"));
        
                    nsCOMPtr<nsIParser> parser;
     =>             rv = PrepareToLoadPrototype(uri, "view", nsnull, 
getter_AddRefs(parser));
                    if (NS_FAILED(rv)) return rv;
        
                    nsCOMPtr<nsIStreamListener> listener = do_QueryInterface
(parser);
        nsXULDocument::EndLoad(void)+0x5ae 
[c:\moz_src\mozilla\content\xul\document\src\nsXULDocument.cpp:1656 
ip=0x056102a8]
            rv = PrepareToWalk();
            if (NS_FAILED(rv)) return rv;
        
     =>     return ResumeWalk();
        }
        
        
        XULContentSinkImpl::DidBuildModel(int)+0xee 
[c:\moz_src\mozilla\content\xul\document\src\nsXULContentSink.cpp:535 
ip=0x05602df7]
        
            nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocument);
            if (doc) {
     =>         doc->EndLoad();
                mDocument = nsnull;
            }
        
        CWellFormedDTD::DidBuildModel(UINT,int,nsIParser *,nsIContentSink *)
+0xb9 [c:\moz_src\mozilla\htmlparser\src\nsWellFormedDTD.cpp:306 ip=0x0459b469]
          if(aParser){
            mSink=aParser->GetContentSink();
            if((aNotifySink) && (mSink)) {
     =>         result = mSink->DidBuildModel(1);
        
          #if 0
              /* COMMENT OUT THIS BLOCK IF: you aren't using an 
nsHTMLContentSink...*/
        nsParser::ResumeParse(int,int)+0x60e 
[c:\moz_src\mozilla\htmlparser\src\nsParser.cpp:1876 ip=0x04591048]
                    if(!mParserContext->mPrevContext) {
                      if(eOnStop==mParserContext->mStreamListenerState) {
        
     =>                 DidBuildModel(mStreamStatus);
        
                        MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: 
nsParser::ResumeParse(), this=%p\n", this));
                        MOZ_TIMER_STOP(mParseTime);
        nsParser::OnStopRequest(nsIRequest *,nsISupports *,UINT)+0x215 
[c:\moz_src\mozilla\htmlparser\src\nsParser.cpp:2523 ip=0x0459372e]
             mParserFilter->Finish();
        
          mParserContext->mScanner->SetIncremental(PR_FALSE);
     =>   result=ResumeParse(PR_TRUE,PR_TRUE);
        
          // If the parser isn't enabled, we don't finish parsing till
          // it is reenabled.
        nsJARChannel::OnStopRequest(nsIRequest *,nsISupports *,UINT)+0x86 
[c:\moz_src\mozilla\netwerk\protocol\jar\src\nsJARChannel.cpp:611 ip=0x0487f707]
            }
        #endif
        
     =>     rv = mUserListener->OnStopRequest(this, mUserContext, aStatus);
            NS_ASSERTION(NS_SUCCEEDED(rv), "OnStopRequest failed");
        
            if (mLoadGroup)
        nsOnStopRequestEvent::HandleEvent(void)+0x172 
[c:\moz_src\mozilla\netwerk\base\src\nsRequestObserverProxy.cpp:176 
ip=0x047f5aff]
                NS_ASSERTION(NS_SUCCEEDED(rv), "GetStatus failed for request!");
        
                LOG(("handle stopevent=%8lX\n",(long)this));
     =>         (void) observer->OnStopRequest(mRequest, mContext, status);
            }
        };
        
        PL_HandleEvent+0x48  [c:\moz_src\mozilla\xpcom\threads\plevent.c:590 
ip=0x100cbfe8]
            /* This event better not be on an event queue anymore. */
            PR_ASSERT(PR_CLIST_IS_EMPTY(&self->link));
        
     =>     result = (*self->handler)(self);
            if (NULL != self->synchronousResult) {
              PR_Lock(self->lock);
              self->synchronousResult = result;
    md_EventReceiverProc+0x61 [c:\moz_src\mozilla\xpcom\threads\plevent.c:1071 
ip=0x100cc829]
            {
                PREventQueue *queue = (PREventQueue *)lParam;
                queue->removeMsg = PR_FALSE;
     =>         PL_ProcessPendingEvents(queue);
                queue->removeMsg = PR_TRUE;
        #ifdef XP_OS2
                return MRFROMLONG(TRUE);
    ScrollDC+0x490       [C:\WINNT\SYSTEM32\user32.dll ip=0x77e12e98]
    ScrollDC+0x6d8       [C:\WINNT\SYSTEM32\user32.dll ip=0x77e130e0]
    DispatchMessageA+0xb [C:\WINNT\SYSTEM32\user32.dll ip=0x77e15824]
    DispatchMessageA+0xb [C:\WINNT\SYSTEM32\USER32.DLL ip=0x67e125a2]
    nsAppShell::Run(void)+0x37c 
[c:\moz_src\mozilla\widget\src\windows\nsAppShell.cpp:121 ip=0x04cf3aab]
        //      if (!nsToolkit::gAIMMMsgPumpOwner || 
(nsToolkit::gAIMMMsgPumpOwner->OnTranslateMessage(&msg) != S_OK))
        //#endif
                TranslateMessage(&msg);
     =>         ::DispatchMessage(&msg);
                if (mDispatchListener)
                  mDispatchListener->AfterDispatch();
              }
That stack doesn't make sense.  Who called nsMemory::Clone?
The strmap_ClearEntry callback in xpcom/io/nsFastLoadFile.cpp will
nsMemory::Free that allocation.  Maybe the FastLoad service isn't shut properly.

Why isn't purify showing the frames between the one for nsFastLoadService.cpp
and nsMemory.cpp?

Have to prioritize this fairly low for now.  Please give me all the stack frame
source context, if you can get it out of purify.  Thanks,

/be
Status: NEW → ASSIGNED
Keywords: mozilla0.9.6
Priority: -- → P4
Target Milestone: --- → mozilla0.9.6

*** This bug has been marked as a duplicate of 106860 ***
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: