After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 556068 - beagle's thunderbird backend leaves masses of stray files in /tmp
beagle's thunderbird backend leaves masses of stray files in /tmp
Status: RESOLVED FIXED
Product: beagle
Classification: Other
Component: General
0.3.8
Other All
: Normal critical
: ---
Assigned To: Beagle Bugs
Beagle Bugs
: 566538 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-10-12 22:41 UTC by jeremy
Modified: 2009-01-04 20:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
IndexHelper log (150.82 KB, application/x-gzip)
2008-11-25 19:38 UTC, jeremy
Details
IndexHelperExceptions log (2.12 KB, text/plain)
2008-11-25 19:39 UTC, jeremy
Details

Description jeremy 2008-10-12 22:41:53 UTC
Please describe the problem:
When using beagle's thunderbird extension, many files of the form /tmp/tmp*.tmp are left lying around.  When I first noticed the problem, there were over 40000 of them.

Aside from the file leakage, the indexing seems to actually work.

Steps to reproduce:
1. Enable thunderbird's beagle extension
2. Fetch mail from imap server
3. 


Actual results:
Mail is indexed, but many stray files are left in /tmp.

Expected results:
Indexed mail, with no persistent tmp files.

Does this happen every time?
Yes.

Other information:
I'm using Fedora rawhide packages:

beagle-gnome-0.3.8-7.fc10.x86_64
beagle-0.3.8-7.fc10.x86_64
beagle-firefox-0.3.8-7.fc10.x86_64
beagle-thunderbird-0.3.8-7.fc10.x86_64

thunderbird-2.0.0.17-1.fc10.x86_64

My mail is stored in a Cyrus imap server.
Comment 1 jeremy 2008-10-12 22:43:24 UTC
Also filed as https://bugzilla.redhat.com/show_bug.cgi?id=465358
Comment 2 Debajyoti Bera 2008-11-22 19:36:11 UTC
This is strange. Files do created in /tmp but they should be deleted once indexing is over. Is your /tmp on some non-standard kind of file system which is preventing them from getting deleted ? Can you check if the tmp files are attachments only, email body only or both.
Comment 3 jeremy 2008-11-24 23:40:40 UTC
/tmp is a standard ext3 filesystem.  I have selinux enabled, but there are no selinux notifications.

The files are a mixture of complete mails and just headers.

The header-only files all seem to just have Date:, From:, Subject:, To:, and Message-Id: headers, rather than the complete mail headers; I'm guessing they're the only header elements that beagle bothers to index?
Comment 4 Debajyoti Bera 2008-11-25 16:25:25 UTC
If you are still running with the thunderbird indexing enabled, can you send SIGUSR1 to beagled, let it run for 30 mins or so (basically wait for it to index a few thunderbird emails) and attach the beagle log files ~/.beagle/Log/current-*. If you not comfortable attaching the log files, can you look for Error and Exception in those files and report.

One other thing, could you pick up any of the emails found in /tmp and then verify that the email is actually an email in thunderbird. I thought thunderbird emails go to a different location other than /tmp.
Comment 5 jeremy 2008-11-25 17:30:28 UTC
It's an imap mailbox, so the mail isn't really stored on /tmp.

From the log entries, it looks like its putting the mail into tmp files for processing:

20081125 09:24:58.8518 18254 IndexH DEBUG: +file:///home/jeremy/.thunderbird/8wc
krzqc.default/ImapMail/mail.goop.org/INBOX/?id=157835 (file:///tmp/tmp3b95fc76.t
mp)
20081125 09:24:58.8609 18254 IndexH DEBUG: +file:///home/jeremy/.thunderbird/8wc
krzqc.default/ImapMail/mail.goop.org/INBOX/?id=157836 (file:///tmp/tmp74b950d6.t
mp)

After running for a couple of minutes, it has accumulated 240 /tmp/tmp*.tmp files.  There are no obvious errors or exceptions in the beagle log.  Do you want me to attach it; it doesn't seem to have anything sensitive in it.
Comment 6 Debajyoti Bera 2008-11-25 17:46:31 UTC
> After running for a couple of minutes, it has accumulated 240 /tmp/tmp*.tmp
> files.  There are no obvious errors or exceptions in the beagle log.  Do you
> want me to attach it; it doesn't seem to have anything sensitive in it.

Hmm... lets see the log file anyway. Maybe I will spot something interesting. Please attach both the current-Beagle and current-IndexHelper.

One more thing, do you know if this problem was present in earlier versions too ?
Comment 7 jeremy 2008-11-25 18:13:41 UTC
I wasn't using beagle before, so I don't know; the version I mentioned in the original report was the first I tried.  But every subsequent version has the same problem.
Comment 8 jeremy 2008-11-25 19:38:39 UTC
Created attachment 123385 [details]
IndexHelper log
Comment 9 jeremy 2008-11-25 19:39:26 UTC
Created attachment 123386 [details]
IndexHelperExceptions log
Comment 10 jeremy 2008-11-25 19:41:49 UTC
I didn't include current-Beagle because it has no interesting messages timestamped for today.  All it has is:

20081125 11:32:55.0842 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:05.2610 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:15.3521 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:15.3692 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:25.4192 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:25.4364 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:35.4825 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:35.5001 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:45.5482 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:33:55.6212 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
20081125 11:34:00.7234 03200 Beagle DEBUG: New Thunderbird indexable generator launched for /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ToIndex
Comment 11 Debajyoti Bera 2008-12-21 00:16:00 UTC
Sorry - I got busy in certain things, so I couldnt concentrate on this bug :-(. Can I request some more information ?

Stop beagled, delete /home/jeremy/.beagle/Indexes/ThunderbirdIndex/ and start beagled (if necessary, start with "--backend Thunderbird" to only start the TB indexing). Now ... probably within a few minutes there will be stray tmp files, so stop as soon as a few tmp files get created. Can you check if _all_ the files in "+file:///home/jeremy/.thunderbird/8wckrzqc.default/ImapMail/mail.goop.org/INBOX/?id=157835 (file:///tmp/tmp3b95fc76.tmp)" are there ? The code looks perfectly ok; so I am trying to figure out if the tmp files for some specific kind of mails are not removed or it is the case with all emails.

Also, if you have the lsof program, can you check if beagled or any other process has those tmp files opened even after beagled has apparently indexed them ?
Comment 12 Debajyoti Bera 2008-12-26 23:57:37 UTC
Another user reported the same problem and with his help, I think I figured out the reason. This problem will show up with a recent mono (mono-2.something).

The problem lies in how .net deletes a file. I checked in a workaround in svn r4897. That should fix this problem.
Comment 13 Debajyoti Bera 2009-01-04 20:38:11 UTC
*** Bug 566538 has been marked as a duplicate of this bug. ***