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 570438 - Infinite wait on "Filtering new nessages"
Infinite wait on "Filtering new nessages"
Status: RESOLVED OBSOLETE
Product: evolution
Classification: Applications
Component: Mailer
3.2.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[filters]
Depends on:
Blocks:
 
 
Reported: 2009-02-03 23:59 UTC by Patrick OCallaghan
Modified: 2013-09-26 11:54 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
gdb thread trace taken while Evo in "Filtering new message(s) (0%)" state (5.33 KB, text/plain)
2009-02-05 18:29 UTC, Patrick OCallaghan
Details
gdb thread trace taken while Evo in "Filtering new message(s) (0%)" state (5.49 KB, text/plain)
2009-02-05 19:39 UTC, Patrick OCallaghan
Details
gdb thread trace taken while Evo in "Filtering new message(s) (0%)" state (5.44 KB, text/plain)
2009-02-05 21:59 UTC, Patrick OCallaghan
Details
gdb trace of Evo hanging during Quit (6.32 KB, text/plain)
2009-02-17 20:24 UTC, Patrick OCallaghan
Details
Traceback of hung session (16.49 KB, text/plain)
2011-12-26 12:45 UTC, Patrick OCallaghan
Details

Description Patrick OCallaghan 2009-02-03 23:59:29 UTC
Please describe the problem:
Sometimes I get the "Filtering new messages(s) (0% complete)" for very long periods (an hour or more before killing Evo). Since the message doesn't mention the server, it's hard to know why, but I have 1 POP and 2 IMAP accounts. The POP account is very low traffic. One IMAP account is with Gmail, but is configured not to run filters. The other IMAP account appears to work normally i.e. I can visit folders, read and send messages and even receive new mail etc., just that the new mail is not being filtered, including Junk. This happens sporadically with no obvious pattern.

Steps to reproduce:
1. Visit IMAP account
2. See "Filtering new messages" status message
3. Wait forever


Actual results:
Eternal wait

Expected results:
Quick filtering of new messages and disappearance of staus message

Does this happen every time?
No

Other information:
Running 2.24.4 from Fedora Koji (pre updates-testing). Specific packages:

evolution-debuginfo-2.24.4-1.fc10.x86_64
evolution-webcal-2.23.91-1.fc10.x86_64
evolution-conduits-2.24.4-1.fc10.x86_64
evolution-data-server-debuginfo-2.24.4.1-1.fc10.x86_64
evolution-data-server-2.24.4.1-1.fc10.x86_64
evolution-spamassassin-2.24.4-1.fc10.x86_64
evolution-data-server-doc-2.24.4.1-1.fc10.x86_64
evolution-help-2.24.4-1.fc10.x86_64
evolution-bogofilter-2.24.4-1.fc10.x86_64
evolution-2.24.4-1.fc10.x86_64
Comment 1 Patrick OCallaghan 2009-02-04 00:05:13 UTC
Further info: on quitting Evo, the messages filtering suddenly wakes up (you can see it faintly in the staus bar). After restarting, all the messages have been appropriately filtered.

So it looks like a locking problem of some sort.
Comment 2 Akhil Laddha 2009-02-04 03:48:35 UTC
It would be great if you can provide gdb traces of evolution when you see filtering in status bar which will let us know what is going on, thanks.

(see http://live.gnome.org/GettingTraces/Details#gdb-not-yet-running for details
about how to do this)
Comment 3 Srinivasa Ragavan 2009-02-04 04:30:49 UTC
Patrick, I guess your problem could be that the db might be too bad. Just vaccum it once. You can use this script: 
http://www.gnome.org/~sragavan/evolution-rebuild-summarydb 

I'm planning to do it programatic.
Comment 4 Patrick OCallaghan 2009-02-04 14:05:19 UTC
Thanks Srini. I ran the script and we'll see what happens. In fact it was only after running it that I saw several new messages, including the posts from you and Akhil!

If I don't complain again, assume it worked :-)
Comment 5 Patrick OCallaghan 2009-02-04 15:56:20 UTC
It didn't work, so I'm complaining again :-(

In fact it has happened three times in a couple of hours, which seems to be more often than before. Usually I could just quit and restart, and it would recover, but the last time it simply hung indefinitely while quitting and I had to use --force-shutdown.

I'm willing to run with logging and/or gdb if you tell me what you need.
Comment 6 Patrick OCallaghan 2009-02-05 05:36:08 UTC
Sorry to be insistent, but this formerly sporadic problem is now happening to me *all the time*, i.e. my impression is that filters are being run on new messages when starting up Evo, but the indefinite wait prevents them from being triggered afterward (so I miss some new messages until I notice).

I've rebuilt the SQL db several times using Srini's script but it doesn't seem to help this particular problem.
Comment 7 Srinivasa Ragavan 2009-02-05 11:44:54 UTC
Patrick run on gdb and when u see the hang break into gdb and do 't a a bt' and collect the traces. 2 - 3 samples would help me. Thanks
Comment 8 Patrick OCallaghan 2009-02-05 18:29:41 UTC
Created attachment 128032 [details]
gdb thread trace taken while Evo in "Filtering new message(s) (0%)" state

Here's a trace. I'll send a couple more as they become available.
Comment 9 Patrick OCallaghan 2009-02-05 19:39:51 UTC
Created attachment 128033 [details]
gdb thread trace taken while Evo in "Filtering new message(s) (0%)" state

Second trace
Comment 10 Patrick OCallaghan 2009-02-05 21:59:43 UTC
Created attachment 128048 [details]
gdb thread trace taken while Evo in "Filtering new message(s) (0%)" state

Third and last trace.
Comment 11 Patrick OCallaghan 2009-02-07 14:12:55 UTC
I turned off automatic filtering (both normal and Junk) and now apply filters manually as required. This has worked every time so far with no hangs.
Comment 12 Srinivasa Ragavan 2009-02-08 04:17:05 UTC
Patrick, Awesome.

Thread 2 (Thread 0x7fae75931950 (LWP 23324))

  • #0 pthread_cond_wait
    at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S line 261
  • #1 e_flag_wait
    at e-flag.c line 120
  • #2 do_get_contacts
    at e-book.c line 2093
  • #3 e_book_get_contacts
    at e-book.c line 2131
  • #4 em_utils_in_addressbook
    at em-utils.c line 2181
  • #5 lookup_addressbook
    at mail-session.c line 409
  • #6 junk_test
    at camel-filter-search.c line 666
  • #7 e_sexp_term_eval
    at e-sexp.c line 720




So, in Mail Preferences, under Junk you would have a option, 

"Do not mark messages as junk if sender is in address book"

Disable it, it would solve. Your junk check on addressbook is taking time. Do you have a remote addressbook or ldap addressbook? That should be the culprit. 
Try using the option 'lookup in local addressbook only'

Comment 13 Patrick OCallaghan 2009-02-08 04:28:01 UTC
Thanks Srini, that's well-spotted. I do indeed check against a remote LDAP instance. I'll disable that and see how it goes.

Nonetheless, I don't quite see why this affects the automatic filtering but not the manual kind. Surely they both use the same rules?

I'll try it anyway.
Comment 14 Srinivasa Ragavan 2009-02-08 05:15:15 UTC
Actually you have 'check for junk'. It uses the same thing. But when you manually do filtering, you don't do junk-test.
Comment 15 Patrick OCallaghan 2009-02-08 05:51:36 UTC
I may not have been clear. I was also applying Junk filtering manually.
Comment 16 Patrick OCallaghan 2009-02-17 20:23:44 UTC
After a week or so of happy mailing with no problems, this issue (or a very similar one) has reared its head again. Twice today Evo has shown "Filtering new messages(s) (50% complete)" (note that it's now 50%. not 0% as before).

On quitting Evo, it just hangs and does nothing. The first time, I ran gdb on the process, did a trace and quit gdb, whereupon Evo woke up and finished.

The second tjime, I did the same thing but this time it didn't wake up so I had to use --force-shutdown. I'm attaching the trace of this second instance.

I should emphasize that I haven't altered my config in any way. Particularly, the "check non-local address books" setting for Junk is still off.
Comment 17 Patrick OCallaghan 2009-02-17 20:24:37 UTC
Created attachment 128925 [details]
gdb trace of Evo hanging during Quit
Comment 18 Srinivasa Ragavan 2009-02-18 08:14:02 UTC


  • #5 e_book_new
    at e-book.c line 3796
  • #6 em_utils_in_addressbook
    at em-utils.c line 2170
  • #7 lookup_addressbook
    at mail-session.c line 409
  • #8 junk_test
    at camel-filter-search.c line 666
  • #9 e_sexp_term_eval
    at e-sexp.c line 720
  • #10 e_sexp_eval
    at e-sexp.c line 1324
  • #11 camel_filter_search_match
  • #12 camel_filter_driver_filter_message
The trace says that junk test is stil looking in addressbook. But its for a local book. Either EDS is hung or died.
Comment 19 Patrick OCallaghan 2009-02-18 12:24:51 UTC
Luckily I still had the terminal session where I did this, so I could scroll back to where I listed the processes:

% pgrep -fl evol
9047 /usr/libexec/evolution-data-server-2.24 --oaf-activate-iid=OAFIID:GNOME_Evolution_DataServer_CalFactory:1.2 --oaf-ior-fd=20
9692 /usr/bin/evolution                                       
9728 /usr/libexec/evolution/2.24/evolution-alarm-notify --oaf-activate-iid=OAFIID:GNOME_Evolution_Calendar_AlarmNotify_Factory:2.24 --oaf-ior-fd=18                                                                          
17855 /usr/libexec/evolution-data-server-2.24 --oaf-activate-iid=OAFIID:GNOME_Evolution_DataServer_InterfaceCheck --oaf-ior-fd=22

As you can see, there are two e-d-s procs running. Presumably that's wrong. Of course at this point I don't know if either or both of them was hung.

If it happens again I'll check this.
Comment 20 Akhil Laddha 2010-03-26 09:04:22 UTC
Could you please confirm if this bug is still happening at your end ? Please try in 2.28.x or 2.30.0 and report back, thanks.
Comment 21 Patrick OCallaghan 2010-03-26 16:41:42 UTC
Hasn't happened in several months, possibly since upgrading to 2.28.
Comment 22 Patrick OCallaghan 2011-12-26 12:42:20 UTC
And we're back. Now on 3.2.2 (Fedora 16). The problem has been happening very frequently -- more than once a day -- and Evo can only be killed by zapping the process, i.e. it ignores the usual Quit. However the hang is not complete because some thread does seem to update the folder view periodically.

During the hang, there are two messages in the notification area: "Formatting Message" and "Filtering New Mail".

I turned off automatic checking of subscribed folders and the frequency has dropped considerably (several days without problems). However it hasn't gone away, so I've captured a trace and will upload it.

A change from my original reports is that I now have 1 POP account (very low traffic), 1 public Gmail account, 1 Google Apps for Education account and 1 Google Apps for Business account. All the Google/Gmail accounts are IMAP. The hang does not happen with the POP account, only with the others.
Comment 23 Patrick OCallaghan 2011-12-26 12:43:32 UTC
Re-submitting with correct Evo version, sorry.
Comment 24 Patrick OCallaghan 2011-12-26 12:45:46 UTC
Created attachment 204220 [details]
Traceback of hung session
Comment 25 Matthew Barnes 2011-12-26 14:16:32 UTC
(In reply to comment #22)
> And we're back. Now on 3.2.2 (Fedora 16). The problem has been happening very
> frequently -- more than once a day -- and Evo can only be killed by zapping the
> process, i.e. it ignores the usual Quit. However the hang is not complete
> because some thread does seem to update the folder view periodically.
> 
> During the hang, there are two messages in the notification area: "Formatting
> Message" and "Filtering New Mail".

Both tasks (Thread 7 and Thread 9) are stuck trying to compare email addresses with contacts from your address books, but it looks like the address book D-Bus service is not responding.  Perhaps it crashed or deadlocked?

Would be helpful if you can attach gdb to your e-addressbook-factory process ("gdb --pid $PID") and, next time Evolution gets stuck, stop the address book process if necessary and get a backtrace.
Comment 26 Patrick OCallaghan 2011-12-26 14:27:48 UTC
OK, I'll do that. Thanks Matt.
Comment 27 Patrick OCallaghan 2011-12-29 20:01:31 UTC
What I did was turn off an LDAP contact server which is sometimes unreliable, and the problem seems to have gone away for the moment. I don't really need that server so I'll probably just leave it that way unless the problem reappears.
Comment 28 Matthew Barnes 2011-12-30 04:09:28 UTC
Thanks, that would explain it.  The mailer/contact integration bits are still not completely asynchronous.
Comment 29 Milan Crha 2012-02-07 13:07:14 UTC
I'm afraid this is not about asynchronicity. The filter is run one after an other, not in parallel. And if one is stuck, then the rest is waiting. There was a similar issue with "Formatting message", the preview panel was locked due to similar issue.

Is the option from comment #12 on or off? If it's off, then probably other option invokes this addressbook checking, or there's a bug somewhere.
Comment 30 Milan Crha 2013-03-15 13:24:30 UTC
Patrick, do you still see this, say with at least 3.6.4, please?
Comment 31 Patrick OCallaghan 2013-03-16 13:44:28 UTC
I haven't seen this in quite some time, but IIRC I stopped using the flaky LDAP server over a year ago, so that may or may not be useful information. I just updated to 3.6.4 yesterday.
Comment 32 André Klapper 2013-09-26 11:54:20 UTC
Closing as per comment 31.