Closed Bug 94059 Opened 23 years ago Closed 16 years ago

MLK: nsStr leaks upon loading a few mail/news folder and reading some messages

Categories

(MailNews Core :: Backend, defect, P1)

x86
Linux
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME
mozilla1.2alpha

People

(Reporter: naving, Unassigned)

Details

(Keywords: memory-leak)

Attachments

(2 files)

The XPCOM mem leak log below shows the details.
Attached file leak log
The refcnt log shows where it leaks. I think NS_ConvertUCS2toUTF8 is leaking
in nsMsgI18NGetAcceptLanguage(void)
Keywords: mailtrack
Some more data collected using purify

[W] MLK: Memory leak of 128 bytes from 6 blocks allocated in PR_Malloc
    Distribution of leaked blocks
        56 bytes from 2 blocks of 28 bytes (first block: 0x08b3f2c8) 
        40 bytes from 2 blocks of 20 bytes (first block: 0x08b3e700) 
        32 bytes from 2 blocks of 16 bytes (first block: 0x08a385c8) 
    Allocation location
    malloc+0xc           [msvcrt.DLL ip=0x580013eb]
    PR_Malloc+0xb        [nspr4.dll ip=0x3000751b]
    nsMemory::Alloc(UINT)+0x1d [xpcom.dll ip=0x100075c1]
    nsStr::EnsureCapacity(nsStr&,UINT)+0x18 [xpcom.dll ip=0x1003b62d]
    nsStr::StrAppend(nsStr&,nsStr const&,UINT,int)+0x41 [xpcom.dll 
ip=0x1003b738]
    nsString::AppendWithConversion(char const*,int)+0x55 [xpcom.dll 
ip=0x10038ccd]
    nsString::AssignWithConversion(char const*)+0x2c [xpcom.dll ip=0x10038c4d]
    DispatchMessageA+0xb [USER32.DLL ip=0x67e125a2]
    nsGetInterface::=(nsGetInterface const&)+0xcc5 [gkwidget.dll ip=0x04e7b9c4]
    nsQueryElementAt::=(nsQueryElementAt const&)+0x5703 [appshell.dll 
ip=0x049a6899]
Summary: nsStr leaks upon loading a few mail/news folder and reading some messages → MLK: nsStr leaks upon loading a few mail/news folder and reading some messages
This is showing up because mailnews is using a static constructor, which you
shouldn't be doing.  In particular, there are at least:

RCS file: /cvsroot/mozilla/mailnews/db/msgdb/src/nsDBFolderInfo.cpp,v
static nsString   gDefaultCharacterSet;

(not the source of this problem, but also a problem)
RCS file: /cvsroot/mozilla/mailnews/mime/cthandlers/vcard/mimevcrd.cpp,v
static nsCOMPtr<nsIStringBundle>   stringBundle = nsnull;
Assignee: scc → mscott
Component: String → Mail Back End
Product: Browser → MailNews
QA Contact: scc → esther
ok, thanks for the info.
Assignee: mscott → naving
QA Contact: esther → stephend
plussing.
Keywords: nsbeta1nsbeta1+
Priority: -- → P1
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Blocks: 122274
Keywords: nsbeta1+nsbeta1-
Target Milestone: mozilla0.9.9 → mozilla1.2
No longer blocks: 122274
mass re-assign.
Assignee: naving → sspitzer
Status: ASSIGNED → NEW
Product: MailNews → Core
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody
Comment on attachment 44904 [details]
leak log

not a patch
Attachment #44904 - Attachment is patch: false
Comment on attachment 44905 [details]
refcnt log showing the stack where leaks are occuring

not a patch
Attachment #44905 - Attachment is patch: false
Filter on "Nobody_NScomTLD_20080620"
QA Contact: stephend → backend
Product: Core → MailNews Core
I've had a look through mailnews/ and I can't find an instances of "static ns(C)String variable;". I have raised bug 467356 for some "static nsCOMPtr<>" instances. Therefore we can close this bug now and that bug will pick up the remaining issues.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: