[Bug 333292] New: beagled leaks memory
https://bugzilla.novell.com/show_bug.cgi?id=333292 Summary: beagled leaks memory Product: openSUSE 10.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Major Priority: P5 - None Component: Mono AssignedTo: bnc-team-mono@forge.provo.novell.com ReportedBy: matz@novell.com QAContact: qa@suse.de Found By: --- I see this with openSuSE 10.3, RC3, i.e. the final release: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 27793 matz 22 7 1310m 539m 4772 S 0 53.4 142:59.08 beagled Yes, that's 1.3GB (mostly swapped out on my poor 1GB machine). This is a i686 machine. % rpm -qf /usr/bin/beagled beagle-0.2.18-30 I also have a corefile from that above beagled process, in case someone has the capability to debug this somehow. I've tried to restart the beagled over the kerry config dialog (stop,start), and a new one was started, but the old one didn't go away (it normally goes away after some time, but I waited about an hour and it still was there), so I somewhen killed it. Now the newly started beagled is leaking again already: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND matz 9386 81.1 22.9 301476 238012 ? SNl 09:47 16:40 beagled As you can see it also does heavy CPU usage. When I strace it I can see that it does no indexing work, though (i.e. it doesn't open any files). The memory usage keeps increasing. Does mono have a sort of heap debugger I could use to see where the memory is going? Anything else I can do to help debugging this? I'm setting this to Major on the basis that beagle is installed and active in a default installation, so many people will probably see this, and it can lead to strange effects on the desktop. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292#c1
--- Comment #1 from Michael Matz
From looking at some of those files it seems they are all mail bodies.
-- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
Stephan Binner
https://bugzilla.novell.com/show_bug.cgi?id=333292
Magnus Boman
https://bugzilla.novell.com/show_bug.cgi?id=333292#c3
Roger Horne
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c4
D Bera
I see this with openSuSE 10.3, RC3, i.e. the final release:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 27793 matz 22 7 1310m 539m 4772 S 0 53.4 142:59.08 beagled
I spotted this bug and am curious. Do you use Thunderbird backend and/or Evolution-Data-Server backend ? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c5
--- Comment #5 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User jpr@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c6
--- Comment #6 from JP Rosevear
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c7
--- Comment #7 from D Bera
which presumably means, I don't use the Thunderbird or Evolution backend. Hmm...
Do you use mbox style emails in KMail ? All those tmp files must have come from somewhere.
I have switched off beagle since a long time, as obviously nobody of the authors of it really cares to do something about this. Well thats definitely not true, at least not 100% :) I am part of an author but I didnt know about this problem until I read it on a forum post :(
You asked about any sort of debugging aid - yes you can use heap-shot to figure out where are all the memory allocated. Well, in case if you are still interested, that is. And yes. Recently I encountered another NFS related problem. I am not 100% sure that indexing NFS homedirs work as expected. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c8
--- Comment #8 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c9
--- Comment #9 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c10
--- Comment #10 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c11
--- Comment #11 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c12
--- Comment #12 from D Bera
beagle-extract-content doesn't want to deal with mbox'es it seems: . But I know for certain that beagle _does_ index those files, as I still have the indexes from a year ago, i.e. searching for text with kerry does find mails from those very mboxes, and clicking on a result starts kmail like:
# kmail --view mbox:/suse/matz/Mail/in-binutils/From\ binutils-return-52787-matz=suse.de%40sourceware.org%20 Thu Oct%20 4 02:02:31\ 2007
It was a bug in the KMail backend long ago that it thought any mbox email in ~/Mail was its email. Its fixed since then. But this information is good, now I will try to debug KMail with mbox. BTW, you dont have *.index files in ~/Mail do you ?
I've restarted the beagle daemon, and it starts eating memory immediately, it runs since 20 minutes and needs already 315MB. It seems when I last year just killed beagled and the index helper it left over half-invalid indexes, as I can see this in the current logfiles:
Caught exception trying to execute Beagle.Daemon.DaemonInformationExecutor. Sending error response System.IO.FileNotFoundException: Could not find file "/tmp/beagle-matz-d940e0a2-cc60-49e0-a322-9dcaf30bf675/Indexes/KMailIndex/PrimaryIndex/_13iy.fnm". at System.IO.FileStream..ctor (System.String name, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000]
This file (_13iy.fnm) is indeed not there, but referenced from the PrimaryIndex/segments file, so I assume the index is in an inconsistent state. I don't yet want to remove and rebuild the index as I first want to see where beagled eats the memory.
Can you stop beagled, and then restart, let it run for some time (with leak) and share the log files with me ? I want to add a safeguard against such behaviours; beagled already auto-corrects against some kind of corrupt indexes but not all cases are covered. I have a hunch regarding the memory leak, probably some gmime stream is not closed/disposed. The last time I looked at the KMail backend was more than a year ago :)
beagled btw. also takes up much CPU time, it seems to wake up very often without need (from strace):
[pid 777] gettimeofday({1201533056, 950187}, NULL) = 0 [pid 777] futex(0xb7865ff0, FUTEX_WAKE, 1) = 0 [pid 777] clock_gettime(CLOCK_REALTIME, {1201533056, 950557164}) = 0 [pid 777] futex(0xb786600c, FUTEX_WAIT, 16451, {0, 99442836}) = -1 ETIMEDOUT (Connection timed out)
(ad nauseam)
Its a faulty Monitor.Wait in mono. They know about it. Monitor.Wait wakes up every 100ms.
Hmm, so, how can I do that heap-shot thingy? It seems it's required that a program is started with extra mono options for this. That's okay as I seem to be able to reproduce the leaking behaviour. But where can I specify options for the beagled process?
pass --heap-shot to beagled. The starting script will take care of the right mono options. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c13
--- Comment #13 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c14
--- Comment #14 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c15
--- Comment #15 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c16
--- Comment #16 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c17
--- Comment #17 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c18
--- Comment #18 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c19
--- Comment #19 from Michael Matz
From kde-commits-bounces-+kde.org-matz=kde.org@kde.org Thu Apr 27 18:14:28 2006 Subject: extragear/multimedia/k3b/src Folder: /suse/matz/Mail/in-kde-cvs 3445 From evandro.menezes@amd.com Thu Apr 27 18:15:42 2006 Subject: RE: String Functions for x86-64 Folder: /var/spool/mail/matz 3294 From kde-core-devel-bounces-+matz=suse.de@kde.org Thu Apr 27 18:19:34 2006 Subject: Re: kde4 dbus state ? Folder: /suse/matz/Mail/in-kde-core-devel 3430 .. and so on. This roughly looks like a traditional mail envelope with two mail headers. But it has no body, and no envelope separator. Perhaps it's treating the rest of the file as headers, or even walks into a qudratic behaviour (starting from each "^From" line, regarding the whole rest of file as headers). Or something.
In any case, it's not in GC memory, but somewhere else, probably in the mailbox parser. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c20
--- Comment #20 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c21
--- Comment #21 from Michael Matz
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c22
--- Comment #22 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User fejj@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c23
Jeffrey Stedfast
https://bugzilla.novell.com/show_bug.cgi?id=333292
User jpr@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c24
--- Comment #24 from JP Rosevear
https://bugzilla.novell.com/show_bug.cgi?id=333292
User fejj@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c25
--- Comment #25 from Jeffrey Stedfast
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c26
--- Comment #26 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User fejj@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c28
Jeffrey Stedfast
From foo@bar.com <date> <message headers>
that last "--xyz" should have been "--xyz--", but since it's not, GMime happily chugs along into the "From "-line and following message headers as if it were headers of the next mime part. Now, normally, mbox files put a blank line between between messages - and if that were done in the above example, GMime would have parsed it properly - but since no blank line, it doesn't. So the "real" bug in the above case is that the mailer that wrote this mbox didn't properly append a blank line. Anyways, I'll need at least this weekend to ponder my fix some more and maybe clean it up a bit more to be confident that it won't break anything else - if I'm satisfied, I'll commit it and append the final patch here. I agree with D Bera, however, that ideally beagle shouldn't point GMime at a file and ask it to be parsed as an mbox w/o knowing for sure that it is an mbox file... then again, I'm not sure of any concrete way of knowing without trying to parse it ;-) Reassigning to myself so that I can more easily find this bug again... -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
User fejj@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c29
--- Comment #29 from Jeffrey Stedfast
https://bugzilla.novell.com/show_bug.cgi?id=333292
User fejj@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c30
Jeffrey Stedfast
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c31
--- Comment #31 from D Bera
https://bugzilla.novell.com/show_bug.cgi?id=333292
User gekker@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c32
Gary Ekker
https://bugzilla.novell.com/show_bug.cgi?id=333292
User federico@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c33
Federico Mena Quintero
https://bugzilla.novell.com/show_bug.cgi?id=333292
User matz@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c34
--- Comment #34 from Michael Matz From kde-commits-bounces-+kde.org-matz=kde.org@kde.org Thu Apr 27 18:14:28
2006
Subject: extragear/multimedia/k3b/src
Folder: /suse/matz/Mail/in-kde-cvs 3445
EOF
% for i in `seq 1 6`; do
cat bla1.log bla1.log bla1.log bla1.log > bla2.log
cat bla2.log bla2.log bla2.log bla2.log > bla1.log
done That should give you a procmail logfile containing roughlyu 780000 lines,
a third of my own one, but probably enough to see any bad behaviour in
gmime.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=333292
User dbera.web@gmail.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=333292#c35
--- Comment #35 from D Bera
participants (1)
-
bugzilla_noreply@novell.com