Closed Bug 103236 Opened 23 years ago Closed 23 years ago

Memory leak of 122 bytes from 1 block allocated in PR_Malloc

Categories

(MailNews Core :: Composition, defect, P1)

x86
Windows 2000
defect

Tracking

(Not tracked)

VERIFIED WORKSFORME
mozilla0.9.8

People

(Reporter: stephend, Assigned: bugzilla)

References

Details

(Keywords: memory-leak)

Build ID:  Latest trunk CVS pull on Windows 2000, opt.

Steps to Reproduce:

1.  mozilla.exe -compose
2.  In the To: widget, type stephe (let it autocomplete to 
stephend@netscape.com).
3.  Tab out to subject.
4.  Tab out to body.
5.  Hit Send.

    [W] MLK: Memory leak of 122 bytes from 1 block 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::Alloc(UINT)+0x9a 
[c:\moz_src\mozilla\xpcom\base\nsMemoryImpl.cpp:556 ip=0x1003c871]
            if (gMemory == nsnull) {
                EnsureGlobalMemoryService();
            }
     =>     return gMemory->Alloc(size);
        }
        
        NS_EXPORT void*
        nsStr::EnsureCapacity(nsStr&,UINT)+0x5e 
[c:\moz_src\mozilla\string\obsolete\nsStr.cpp:117 ip=0x1010201c]
        PRBool nsStr::EnsureCapacity(nsStr& aString,PRUint32 aNewLength) {
          PRBool result=PR_TRUE;
          if(aNewLength>aString.mCapacity) {
     =>     result=Realloc(aString,aNewLength);
            if(aString.mStr)
              AddNullTerminator(aString);
          }
        nsString::SetCapacity(UINT)+0x60 
[c:\moz_src\mozilla\string\obsolete\nsString2.cpp:189 ip=0x100f8cc3]
            if ( aNewCapacity )
              {
                if( aNewCapacity > mCapacity )
     =>           GrowCapacity(*this, aNewCapacity);
                AddNullTerminator(*this);
              }
            else
        nsAString::do_AssignFromElementPtr(WORD const*)+0x84 
[c:\moz_src\mozilla\string\src\nsAString.cpp:274 ip=0x100e92a9]
        void
        nsAString::do_AssignFromElementPtr( const char_type* aPtr )
          {
     =>     do_AssignFromReadable(nsDependentString(aPtr));
          }
        
        void
        nsAString::Assign(WORD const*)+0x43 
[.\..\..\dist/include/string\nsAString.h:182 ip=0x1002371a]
        nsMsgProgress::OnStatusChange(nsIWebProgress *,nsIRequest *,UINT,WORD 
const*)+0x7d [c:\moz_src\mozilla\mailnews\base\src\nsMsgProgress.cpp:261 
ip=0x08aba3a7]
          nsresult rv = NS_OK;
        
          if (aMessage && *aMessage)
     =>   m_pendingStatus = aMessage;
          if (m_listenerList)
          {
            PRUint32 count;
        nsMsgComposeAndSend::SetStatusMessage(WORD const*)+0x67 
[c:\moz_src\mozilla\mailnews\compose\src\nsMsgSend.cpp:4256 ip=0x082f2d7b]
        nsMsgComposeAndSend::SetStatusMessage(const PRUnichar *aMsgString)
        {
          if (mSendProgress)
     =>     mSendProgress->OnStatusChange(nsnull, nsnull, 0, aMsgString);
          return NS_OK;
        }
        
        nsMsgComposeAndSend::MimeDoFCC(nsFileSpec *,int,char const*,char 
const*,char const*)+0x869 
[c:\moz_src\mozilla\mailnews\compose\src\nsMsgSend.cpp:3918 ip=0x082f1cc7]
              printfString = nsTextFormatter::smprintf(msg, "?");
            if (printfString)
            {
     =>       SetStatusMessage(printfString);
              PR_FREEIF(printfString);
            }
          }
        nsMsgComposeAndSend::DoFcc(void)+0x1cc 
[c:\moz_src\mozilla\mailnews\compose\src\nsMsgSend.cpp:3331 ip=0x082eff59]
                                  nsMsgDeliverNow,
                                  mCompFields->GetBcc(),
                                              mCompFields->GetFcc(),
     =>                           mCompFields->GetNewspostUrl());
          if (NS_FAILED(rv))
          {
            //
        ???            [ip=0x092ff2b0]
        nsMsgComposeAndSend::DoDeliveryExitProcessing(nsIURI *,UINT,int)+0x316 
[c:\moz_src\mozilla\mailnews\compose\src\nsMsgSend.cpp:3269 ip=0x082efcea]
          // way until later...
          //
        
     =>   nsresult retCode = DoFcc();
          if (NS_FAILED(retCode))
          {
        #ifdef NS_DEBUG
        nsMsgComposeAndSend::DeliverAsMailExit(nsIURI *,UINT)+0x1f 
[c:\moz_src\mozilla\mailnews\compose\src\nsMsgSend.cpp:3287 ip=0x082efd39]
        
        NS_IMETHODIMP
        nsMsgComposeAndSend::DeliverAsMailExit(nsIURI *aUrl, nsresult aExitCode)
     => {
          DoDeliveryExitProcessing(aUrl, aExitCode, PR_FALSE);
          return NS_OK;
        }
        nsMsgDeliveryListener::OnStopRunningUrl(nsIURI *,UINT)+0x1d2 
[c:\moz_src\mozilla\mailnews\compose\src\nsMsgDeliveryListener.cpp:96 
ip=0x08325809]
          // creators exit routine.
          //
          if (mCompletionCallback)
     =>     rv = (*mCompletionCallback) (aUrl, aExitCode, mDeliveryType, 
mTagData);
          else
            rv = NS_OK;
        
    nsUrlListenerManager::BroadcastChange(nsIURI *,nsUrlNotifyType,UINT)+0x233 
[c:\moz_src\mozilla\mailnews\base\src\nsUrlListenerManager.cpp:109 
ip=0x08a3bab6]
                        if (notification == nsUrlNotifyStartRunning)
                            listener->OnStartRunningUrl(aUrl);
                        else if (notification == nsUrlNotifyStopRunning)
     =>                     listener->OnStopRunningUrl(aUrl, aErrorCode);
                    }
        
                } // for each listener
    nsUrlListenerManager::OnStopRunningUrl(nsIMsgMailNewsUrl *,UINT)+0x2c 
[c:\moz_src\mozilla\mailnews\base\src\nsUrlListenerManager.cpp:124 
ip=0x08a3bb81]
        }
        
        nsresult nsUrlListenerManager::OnStopRunningUrl(nsIMsgMailNewsUrl * 
aUrl, nsresult aErrorCode)
     => {
            nsresult rv = BroadcastChange(aUrl, nsUrlNotifyStopRunning, 
aErrorCode);
          // in order to prevent circular references, after we issue on stop 
running url,
          // go through and release all of our listeners...
    nsSmtpProtocol::ProcessProtocolState(nsIURI *,nsIInputStream *,UINT,UINT)
+0x4f2 [.\.\WIN32_O.OBJ\nsSmtpProtocol.obj:1467 ip=0x0830e873]
    nsMsgProtocol::OnDataAvailable(nsIRequest *,nsISupports *,nsIInputStream 
*,UINT,UINT)+0xf4 [c:\moz_src\mozilla\mailnews\base\util\nsMsgProtocol.cpp:261 
ip=0x083a525a]
        {
            // right now, this really just means turn around and churn through 
the state machine
            nsCOMPtr<nsIURI> uri = do_QueryInterface(ctxt);
     =>     return ProcessProtocolState(uri, inStr, sourceOffset, count);
        }
        
        NS_IMETHODIMP nsMsgProtocol::OnStartRequest(nsIRequest *request, 
nsISupports *ctxt)
    nsOnDataAvailableEvent::HandleEvent(void)+0x180 
[c:\moz_src\mozilla\netwerk\base\src\nsStreamListenerProxy.cpp:193 
ip=0x04826147]
            // Forward call to listener
            if (listener)
                rv = listener->OnDataAvailable(mRequest, mContext,
     =>                                        mSource, mOffset, count);
        
            LOG(("nsOnDataAvailableEvent: Done with the consumer's 
OnDataAvailable "
                 "[rv=%x, req=%x]\n", rv, mRequest.get()));
Keywords: mlk
QA Contact: sheelar → stephend
Keywords: nsbeta1
don't want to be leaking status strings.
Keywords: nsbeta1nsbeta1+
Priority: -- → P1
Target Milestone: --- → mozilla0.9.8
Looks like we are leaking a nsString (m_pendingStatus). My guess is that in fact
we are leaking the whole nsIMsgProgress object!

Stephen, do you have the pref "mail.compose.max_recycled_windows" set to 1?
Status: NEW → ASSIGNED
I think dbaron fixed the msgProgress leak, this may have been already fixed, don't
know for sure.
good catch Navin, fox for bug 99180 seems to fix this one also. Therefore, WFM
using a recent build.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → WORKSFORME
Yeah, this is fixed.

Verified, windows 2000 trunk latest build.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.