GNOME Bugzilla – Bug 556001
search does not function correctly in evolution 2.25.1 (svn trunk build)
Last modified: 2013-09-12 11:06:15 UTC
Please describe the problem: I have an imap account and local folders. I search for a term in the mail body. 2 messages contain this term. One is located in my imap folders, the other in my local folders. When I select the Inbox folder of the imap account and choose "All Accounts" for the search, only the one in the local folders is found. When I choose "Current Account", the one in the imap folders is found correctly. This is just an example of some oddities with the search, which makes it somewhat unreliable. Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information: I do have the trunk checkout here. It's a recent build. If you give me some instructions on how to debug this, I can give more details. Regards, thomas
Akhil, can you verify this?
Don't feel that this is disk summary specific. Jony can you look at this search thing?
I debugged this beast a little and think I found the problem spot to be in evolution/mail/mail-vfolder.c, in function mail_vfolder_add_uri. In line 447 it sets an ignore flag, so draft/Outbox/Sent folders dont't make into source_folders_local. This variable is later returned in function emfb_search_search_activated in evolution/mail/em-folder-browser.c, line 123 /* FIXME: there got to be a better way :) */ /* Add the local folders */ l = mail_vfolder_get_sources_local (); Note the FIXME above. So that's why I could not find that mail in the Sent folder. Regards, thomas
(In reply to comment #3) > I debugged this beast a little and think I found the problem spot to be in > evolution/mail/mail-vfolder.c, in function mail_vfolder_add_uri. > In line 447 it sets an ignore flag, so draft/Outbox/Sent folders dont't make > into source_folders_local. This variable is later returned in function > emfb_search_search_activated in evolution/mail/em-folder-browser.c, line 123 > > /* FIXME: there got to be a better way :) */ ;-) > /* Add the local folders */ > l = mail_vfolder_get_sources_local (); > Will you be able to get a patch for this ? :)
Well, I added code to include the Sent and drafts folders. Now that mail in the sent folder is found with all-accounts-search, while the 2 mails in that imap folder are not found anymore. Astonishingly, if I just delete the final character of the search term, all 3 mails are found. Must be something with these caching folders. But that's beyond me right now.
... and got a nice crash. Can't remember specifically what I was doing but I have the core file. Attached is the stacktrace from gdb.
Created attachment 121528 [details] gdb stacktrace
Created attachment 121554 [details] [review] patch for all account search problems
The reason why the mails in the imap account were not found was, that there was no output stream to the imap store. Attached comes the patch.
Created attachment 121611 [details] [review] corrected patch Inserting camel_imap_store_connected into imap_command_start led to endless loops. So I put it into imap_body_contains.
I didnt understand your em-folder-browser.c changes. Are they intentional ?
(In reply to comment #11) > I didnt understand your em-folder-browser.c changes. Are they intentional ? > Sure. See comment #3. thomas
I got it Thomas. Why is the imap_* change needed for this? Do you have a issue/trace for that endless loop?
When I debugged the search, I found that there always came these "No output stream" message in the debug output, which is in imap_command_start. So I tried to put a call to camel_imap_store_connected in there. Unfortunately, camel_imap_store_connected again calls imap_command_start, therefore the endless loop. So I put it into imap_body_contains in file camel_imap_search.c. thomas
Thomas, do you have a stack trace for this? Because, it checks for offline before your fix.
Thomas: Ping.. Do you have a stack trace for the infinite loop you said. I think I must see to understand it better. Thanks.
The first patch, I submitted was the one that caused the endless-loop. http://bugzilla.gnome.org/attachment.cgi?id=121554&action=view Can you reproduce it?
Oh wait, so your patch caused it and you reworked to fix it. Good. I never understood that. Lemme try and see it. thanks Thomas.
ping, any update on the patch ?
No, nothing new. I use stacked git (stg) to apply this patch over the latest git version pulled.
So does this patch still needs rework? Or needs to be committed? Srag / Thomas?
(In reply to comment #21) > So does this patch still needs rework? Or needs to be committed? > Srag / Thomas? I checked my local sources (still 2.28.4) and found part of the patch applied, i.e. the part in camel-imap-search.c, but the first change in em-folder-browser is not present in my sources. Definitely needs some rework. Don't commit that!! Hope that helps, thomas
This is fixed in 3.8.4, thus I'm closing it.