Crash [@ OOM | small ] during generating MSF file from many emails in Maildir format. Memory leak. @ OOM | small

NEW
Unassigned

Status

defect
--
critical
3 years ago
3 months ago

People

(Reporter: t.matsuu, Unassigned)

Tracking

(Blocks 1 bug, {crash, memory-leak})

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [maildirblocker?], )

How to reproduce:
1. Generate a folder like below with Explorer
C:\Users\<Windows user name>\AppData\Roaming\Thunderbird\Profiles\<Profile name>\Mail\Local Folders\foo\cur

2. Put many emails into the generated folder in Maildir format
3. Run Thunderbird
4. Select the folder to generate MSF file
5. Thunderbird crashed after several minutes

Sometimes 1200 emails are OK, and at other time 1000 email are NG.
So it depends on the condition.


Crash reports:
bp-ad27cdaa-770f-4806-b716-f54632170124
bp-c256ca32-4e45-441b-8a8f-78d072170124
bp-25dc17d4-da3b-4a04-ba4c-f781c2170124
bp-6b1067ad-c205-449d-8434-93eee2170124
bp-d8a14acd-51d4-4e21-a01c-93ca72170124
3 of the 4 are OOM | small. #3
Either there is a bad memory leak? (not closing files?)

Or foul play.  Please start *Windows'* safe mode with networking enabled
- win7 https://support.microsoft.com/en-us/help/17419/windows-7-advanced-startup-options-safe-mode#start-computer-safe-mode=windows-7
Still In Windows safe mode, start thunderbird in safe mode
- https://support.mozilla.org/kb/safe-mode-thunderbird
Does problem go away?
Severity: normal → critical
Flags: needinfo?(t.matsuu)
Keywords: crash, mlk
Summary: Crash during enerating MSF file from many emails in Maildir format → Crash [@ OOM | small ] during generating MSF file from many emails in Maildir format. Memory leak?
I cannot change boot option because my machine using Thunderbird Nightly is not under my control for that setting.

In case that folders "foo" and "bar" which have >1000 emails each (and MSF files are successfully generated), moving all emails from one folder to another is no problem.
Flags: needinfo?(t.matsuu)
You must have a very strong interest in maildir.

You have several major extentions installed. At least please try starting Thunderbird in safe mode. Please also use the current nightly 54.0a1. Thanks

Oh, and why are they making you run win7 in 32bit?  That's pretty horrible.
Flags: needinfo?(t.matsuu)
(In reply to Wayne Mery (:wsmwk, NI for questions) from comment #3)
> You have several major extentions installed. At least please try starting
> Thunderbird in safe mode. Please also use the current nightly 54.0a1. Thanks

I have tested Thunderbird in safe mode with the latest comm-central build.
Build ID: 20170702030204
https://hg.mozilla.org/mozilla-central/rev/4d3de12dcdc539f14fcb06539da39fa7176c8955

And it is still reproduced.
bp-b4e3f908-722c-4430-8786-9aec50170703
bp-76fee5df-b57c-48e4-8314-d13a80170703
bp-1703c2b3-f18b-4380-939d-4b5390170703
bp-9c0a1ef5-f3e0-4683-bd62-e97270170703


> Oh, and why are they making you run win7 in 32bit?  That's pretty horrible.

PCs assigned to me at the office is win7 in 32 bit. :-(
Flags: needinfo?(t.matsuu)
Daniel is seeing this when viewing a folder bp-9acac2a3-6508-46fc-87e1-806c60170809  http://forums.mozillazine.org/viewtopic.php?f=39&t=3032305&sid=f3450df3e6ef57eea92a0c893ea7a4ed

A different user "When repairing maildir folder with a lot of messages (about 30.000, overall size still below 4GB on HDD) Thunderbird has a memory leak resulting in near 2GB RAM usage before crash." bp-b86b3d45-4e54-4ce2-a456-dc46e0170801
Summary: Crash [@ OOM | small ] during generating MSF file from many emails in Maildir format. Memory leak? → Crash [@ OOM | small ] during generating MSF file from many emails in Maildir format. Memory leak.
> 2. Put many emails into the generated folder in Maildir format

Note - I'm not sure this is expected to work.  


Most of the crashes are @ OOM | small but I'm not adding this to this bug report's crash signatures.

As for the other signatures:

Bug 1272230 4 crashes - Crash in CCGraphBuilder::BuildGraph - possible memory leak - no progress last 5 months and none likely in the near future

Bug 1353702  2 crashes (possibly dependent on bug 1364543) - Crash in PtrToNodeMatchEntry (CompareCacheMatchEntry) and OOM | small during CC. memory leak?  bp-b062f838-aa49-4240-b014-e0bc50170703

Bug 1353704 2 crashes - Crash in mozilla::mailnews::MsgDBReporter::GetPath - I doubt this will be actionable bp-d435504e-09d4-4084-9a0f-ffe200170703

Bug 1333038 1 crash - ref bug 1264302, bug 1284302 Crash in nsMsgLineStreamBuffer::ReadNextLine - probably not maildir related but should be actionable bp-fe9148cc-686b-425c-9613-154e30170703

RtlpDosPathNameToRelativeNtPathName_U | RtlDosPathNameToNtPathName_U_WithStatus | GetFileAttributesW  - 1 crash, no bug report  bp-76fee5df-b57c-48e4-8314-d13a80170703
Depends on: 1264302
Summary: Crash [@ OOM | small ] during generating MSF file from many emails in Maildir format. Memory leak. → Crash [@ OOM | small ] during generating MSF file from many emails in Maildir format. Memory leak. @ OOM | small
Whiteboard: [maildirblocker?]
No longer depends on: 1264302
Depends on: 1264302
Blocks: 1410631
Duplicate of this bug: 1410631
Do you also see this problem if you use the beta from http://www.mozilla.org/thunderbird/channel/ ?
Flags: needinfo?(t.matsuu)
Flags: needinfo?(mail)
I checked the issue still occurred or not with Thunderbird 60.0a1 (20180219030201).

And then I got OOM | small crash.
b693e37d-9950-4a70-a4a0-33eb60180220
Flags: needinfo?(t.matsuu)
I checked with suggested beta build and the problem is still present. :(
Flags: needinfo?(mail)
I have the same problem - is there any way to repair/ build msf file without thunderbird crashing in the process??
(In reply to skrytka from comment #12)
> I have the same problem - is there any way to repair/ build msf file without
> thunderbird crashing in the process??

p.s. i have 32 GB ddr4 3200 RAM and maildir folder is on NVME SSD drive. I can't build msf file. I lost all of my emails
I have folder with mails (1 year, 70 000 mails) Now I copy 800-900 files to a temporary folder, repair the folder, transfer all the letters to the desired folder. If I have more than 1000 mails in folder - I got crash. But even if I have 900 mails sometimes I have situation than TB moves 800 mails, and remain still 100-120. They can not be migrated before the program is restarted. I'll continue copying for now, if I notice some other regularities then I'll write here.

I used to run valgrind to see if there are memory alloc/free mismatches, etc.
This bug should be easy to spot if valgrind runs today.

Unfortunately, for some months since late last year, I cannot run valgrind on my local development PC.
I am running Debian kernel inside virtualbox.
It probably is a particular kernel configuration parameter or two of official Debian supported kernels
that must be the cause of strange valgrind crash.
In linux 3.x kernel series, there were versions that allowed me to run valgrind (and run thunderbird under it), but there are other versions that did not and I could not figure out what kernel config parameter changes were responsible for the failure of valgrind.
So I used to keep the particular 3.y kernel so that I could run valgrind to test TB's memory issue.

However, the time moved on and Debian userland now requires kernel 4.x series.
And the valgrind has been crashing and I have not been able to run it. I tried creating a reasonably configured kernel from pristine source, but
valgrind still crashed. I am not sure what is wrong.
I am not sure if this Debian specific (probably so because I could produce a kernel from pristine linux source with my own config that allowed me to run valgrind during 3.x days while some debian supported 3.y versions did not. ) or related to some arcane VirtualBox issue.

Anyway, if someone can run valgrind on their local development machine the cause of the bug should be very easy to spot.

Or does mozilla still run TB under valgrind for testing purposes from time to time?
(I understand FF is run under valgrind from time to time. No?)
I understand such a testing is done maybe once a week or less often.
(It used to take almost 24 hours on my PC to run |make mozmil| under valgrind.
Last November I specifically rebuilt my home PC in the hope of running |make mozmil| under valgrind faster by a ryzen CPU with 8 cores and 20MB cache, but due to the mysterious valgrind crash under debian supported 4.x series kernel, I have not been able to run it yet.)
ADDED: So if a test that mimics the behavior that triggers the problem is created and the testing using virtualbox is done from time to time in mozilla's testing farm, this problem probably is analyzed there.
(Wait, I wonder if |make mozmil| in stock form can be run under valgrind. I locally create a dummy thunderbird binary that actually invokes the original thunderbird under virtualbox and let this fake thunderbird binary run within |make mozmill| testing scheme. .If it is not easy to run TB under virtualbox, the testing in the mozilla testing farm may not be easy...)

So if a developer who uses maybe Fedora (I believe the main developer of valgrind/memcheck uses Fedora) on their development machine and can run TB test suite such as |make mozmil|, the cause of this problem and other bugzilla related to memory for Maildir usage should be easy to spot in no time.

Well I have used Debian for almost 20 years now, and so I am not inclined to switch to Fedora anytime soon... Maybe at the office...

If someone knows the particular change to the kernel config file that would allow Debian to run valgrind, I would love to hear about it.

NOTE: for a small program, valgrind has no issue even under Debian's 4.x kernel.
It is a huge program with many dynamically loaded libraries that causes this mysterious crash of valgrind. TB fits the bill.
I can run small programs under valgrind without an issue to my consternation. So debugging is very hard...

You need to log in before you can comment on or make changes to this bug.