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 578287 - MAPI now sort of works, but some information is garbled and hangs occur
MAPI now sort of works, but some information is garbled and hangs occur
Status: RESOLVED FIXED
Product: evolution-mapi
Classification: Applications
Component: Mail
0.27.x
Other All
: Normal critical
: ---
Assigned To: Bharath Acharya
evolution-mapi-maint
evolution[mapi]
: 581595 583298 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-07 19:18 UTC by David Ronis
Modified: 2009-06-10 03:48 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
Garbled header using MAPI (158.73 KB, image/png)
2009-05-09 08:23 UTC, David Ayton
  Details
Garbled headers using MAPI still occurring (161.01 KB, image/png)
2009-05-13 10:14 UTC, David Ayton
  Details
Garbled headers using MAPI still occurring (2) (163.32 KB, image/png)
2009-05-13 10:18 UTC, David Ayton
  Details
Source of message with corrupted headers (474 bytes, text/plain)
2009-05-13 10:59 UTC, David Ayton
  Details
Openchange fetchmail (7.10 KB, text/plain)
2009-05-13 12:18 UTC, David Ayton
  Details
Openchange fetchmail with network trace (943.99 KB, text/plain)
2009-05-13 12:20 UTC, David Ayton
  Details
Test patch (1.17 KB, patch)
2009-05-15 04:26 UTC, Bharath Acharya
none Details | Review
Backtrace while mapi is trying to save remote folder (8.91 KB, text/plain)
2009-05-15 16:12 UTC, David Ronis
  Details
valgrind log (157.69 KB, text/plain)
2009-05-16 02:19 UTC, David Ayton
  Details
Garbled headers fixed (174.53 KB, image/png)
2009-05-16 02:39 UTC, David Ayton
  Details
Evolution Mapi patch (6.70 KB, patch)
2009-05-26 09:26 UTC, Bharath Acharya
committed Details | Review

Description David Ronis 2009-04-07 19:18:28 UTC
Please describe the problem:
I'm following evo's svn/trunk development, and after several months of it not working (partly because of some symbolic link issues in openchange's install) got MAPI to work again (yesterday).  I see my remote folders and their contents (and some old mail that was sitting there looked right).

Today I tried testing the account by sending myself an e-mail  (from a non-mapi account to the mapi account, which is served on another host).  The mail arrived, but the header was garbled (the body was fine).   

What I should have seen was:
From: 	David Ronis <David.Ronis@McGill.CA>
Reply-to: 	ronis@ronispc.chem.mcgill.ca
To: 	associatechair.chemistry@mcgill.ca
Subject: 	TEST
Date: 	Tue, 07 Apr 2009 14:53:49 -0400


123


What I got was stuff like:   From:  h?f <h?f> 
                                            Subject:  mapi_SPropValue_array_named

(the copy of the message in my sent folder is ok).

I just tried a 2nd test.  The test went out fine, but now evo has stalled in fetching the mail from the mapi account (pressing cancel and/or cancel all doesn't help).

I've pasted a backtrace (by attaching gdb to the evo process) below.




Steps to reproduce:
1. 
2. 
3. 


Actual results:


Expected results:


Does this happen every time?


Other information:
(gdb) thread apply all bt full

Thread 3 (Thread 0xab40fb90 (LWP 18849))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_95
    from /lib/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #3 IA__g_static_rec_mutex_lock
    at gthread.c line 313
  • #4 camel_service_connect
    at camel-service.c line 349
  • #5 camel_mapi_store_connected
    at camel-mapi-store.c line 1084
  • #6 mapi_get_folder_info
    at camel-mapi-store.c line 1109
  • #7 camel_store_get_folder_info
    at camel-store.c line 894
  • #8 get_folderinfo_exec
    at mail-ops.c line 1069
  • #9 mail_msg_proxy
    at mail-mt.c line 520
  • #10 g_thread_pool_thread_proxy
  • #11 g_thread_create_proxy
    at gthread.c line 635
  • #12 start_thread
    from /lib/libpthread.so.0
  • #13 clone
    from /lib/libc.so.6

Thread 2 (Thread 0xa7386b90 (LWP 18858))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_95
    from /lib/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #3 IA__g_static_rec_mutex_lock
    at gthread.c line 313
  • #4 mapi_sync
  • #5 mapi_refresh_folder
    at camel-mapi-folder.c line 601
  • #6 mapi_refresh_info
    at camel-mapi-folder.c line 154
  • #7 camel_folder_refresh_info
    at camel-folder.c line 349
  • #8 refresh_folder_exec
    at mail-ops.c line 1658
  • #9 mail_msg_proxy
    at mail-mt.c line 520
  • #10 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #11 g_thread_create_proxy
    at gthread.c line 635
  • #12 start_thread
    from /lib/libpthread.so.0
  • #13 clone
    from /lib/libc.so.6

Comment 1 David Ronis 2009-04-07 19:21:26 UTC
Actually, things are a bit worse than I just reported.  Evo seems hung, I can't close the window, even with the window-kill button on the border.  One other bit of information:  I had deleted the 1st e-mail before sending the 2nd.  Funny thing is that it never appeared in the trash on the local machine or MAPI account.

Comment 2 David Ronis 2009-04-07 19:35:18 UTC
One final obseration (for now).  The information on the message list (preview) looks right.
Comment 3 Akhil Laddha 2009-05-07 05:19:49 UTC
*** Bug 581595 has been marked as a duplicate of this bug. ***
Comment 4 David Ronis 2009-05-08 17:29:26 UTC
I just upgraded to the svn/trunk of svn and retried the test.  The message is no longer garbled.  However, deleting it (which I presume should result in the message appearing in the MAPI account's "deleted" folder) does the following:

1.  the Message disappears from the Mapi/Inbox folder.

2.  I see, "Storing folder 'Mailbox - MyAccountName/Deleted Items' (...) in evo's status bar.

3.  On the console I see:

exchange-mapi-connection.c:2258: Leaving exchange_mapi_set_flags 
exchange-mapi-connection.c:1004: Entering exchange_mapi_connection_fetch_items: folder-id 2403D60000000001 libexchangemapi-Message: exchange-mapi-connection.c:1006: exchange_mapi_connection_fetch_items: lock(connect_lock)
libexchangemapi-Message: exchange-mapi-connection.c:1225: exchange_mapi_connection_fetch_items: unlock(connect_lock)

exchange-mapi-connection.c:1227: Leaving exchange_mapi_connection_fetch_items: folder-id 2403D60000000001 
exchange-mapi-connection.c:2216: Entering exchange_mapi_set_flags libexchangemapi-Message: exchange-mapi-connection.c:2218: exchange_mapi_set_flags: lock(connect_lock)
libexchangemapi-Message: exchange-mapi-connection.c:2256: exchange_mapi_set_flags: unlock(connect_lock)

exchange-mapi-connection.c:2258: Leaving exchange_mapi_set_flags 
exchange-mapi-connection.c:2365: Entering exchange_mapi_remove_items libexchangemapi-Message: exchange-mapi-connection.c:2367: exchange_mapi_remove_items: lock(connect_lock)
libexchangemapi-Message: exchange-mapi-connection.c:2416: exchange_mapi_remove_items: unlock(connect_lock)

exchange-mapi-connection.c:2418: Leaving exchange_mapi_remove_items 
exchange-mapi-connection.c:1004: Entering exchange_mapi_connection_fetch_items: folder-id 2703D60000000001 libexchangemapi-Message: exchange-mapi-connection.c:1006: exchange_mapi_connection_fetch_items: lock(connect_lock)
libexchangemapi-Message: exchange-mapi-connection.c:1225: exchange_mapi_connection_fetch_items: unlock(connect_lock)

exchange-mapi-connection.c:1227: Leaving exchange_mapi_connection_fetch_items: folder-id 2703D60000000001 

4.  Pressing Send/Receive in evo, hangs at the MAPI account, and this is not interrupted by pressing 'Cancel All'

5.  Trying to exit evo hangs & I'm forced to use --force-quit

My bet is that some thread is blocking the exchange operations.   I've attached to the current evo process and generated a new backtrace:

Thread 4 (Thread 0xb163db90 (LWP 32515))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_95
    from /lib/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #3 IA__g_static_rec_mutex_lock
    at gthread.c line 313
  • #4 mapi_sync
    at camel-mapi-folder.c line 523
  • #5 camel_folder_sync
    at camel-folder.c line 326
  • #6 sync_folder_exec
    at mail-ops.c line 1544
  • #7 mail_msg_proxy
    at mail-mt.c line 520
  • #8 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #9 g_thread_create_proxy
    at gthread.c line 635
  • #10 start_thread
    from /lib/libpthread.so.0
  • #11 clone
    from /lib/libc.so.6

Thread 3 (Thread 0xa8ab0b90 (LWP 32543))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_95
    from /lib/libpthread.so.0
  • #2 pthread_mutex_lock
    from /lib/libpthread.so.0
  • #3 IA__g_static_rec_mutex_lock
    at gthread.c line 313
  • #4 camel_service_connect
    at camel-service.c line 349
  • #5 camel_mapi_store_connected
    at camel-mapi-store.c line 1085
  • #6 mapi_get_folder_info
    at camel-mapi-store.c line 1109
  • #7 camel_store_get_folder_info
    at camel-store.c line 896
  • #8 get_folderinfo_exec
    at mail-ops.c line 1075
  • #9 mail_msg_proxy
    at mail-mt.c line 520
  • #10 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #11 g_thread_create_proxy
    at gthread.c line 635
  • #12 start_thread
    from /lib/libpthread.so.0
  • #13 clone
    from /lib/libc.so.6

Comment 5 David Ronis 2009-05-08 18:38:57 UTC
One additional observation:  after restarting evolution (1st running with --force-shutdown) I notice that the Exchange MAPI Inbox & Deleted Items folders are both empty; i.e., the mail was really deleted.  I don't know if this is the expected behavior.

Comment 6 David Ayton 2009-05-09 08:23:37 UTC
Created attachment 134297 [details]
Garbled header using MAPI

This shows the garbled To and ReplyTo fields.
Comment 7 David Ayton 2009-05-09 08:27:10 UTC
I can confirm intermittent occurance of the garbled header issue described above.

I am running Unbunto 9.04, and have built Evolution, Evolution data server and Evolution-mapi from their GIT master branches today (May 9, 2009). The mail account is on a MS Exchange small business server 2007.

I have used both the openchange --sendmail tool and evolution to send to the account. Both result in the garbled header display when the mail is fetched by evolution (screenshot attached). Using openchange --fetchmail tool, the headers are not corrupted.

Note that the issue described also occurs when using Evolution 2.26 and evo-mapi installed from synaptic.
Comment 8 David Ayton 2009-05-13 10:14:04 UTC
Created attachment 134556 [details]
Garbled headers using MAPI still occurring

Patch as per http://bugzilla.gnome.org/attachment.cgi?id=132189 for bug http://bugzilla.gnome.org/show_bug.cgi?id=569321 was applied to evolution-mapi source and rebuilt. Re-fetch by evolution forced by deleting folders.db file. Garbled headers still occurring, with same errors on same mails.

Similar corruption can also still be seen on emails sent/received after the patch application.
Comment 9 David Ayton 2009-05-13 10:18:32 UTC
Created attachment 134557 [details]
Garbled headers using MAPI still occurring (2)

Email sent/received after patch application.
Comment 10 David Ayton 2009-05-13 10:59:55 UTC
Created attachment 134558 [details]
Source of message with corrupted headers
Comment 11 David Ayton 2009-05-13 12:18:54 UTC
Created attachment 134560 [details]
Openchange fetchmail

openchangeclient --database=/students/u4495166/.openchange/profiles.ldb --profile=davidayton --to=davidayton@spectre.local --fetchmail > ~/Desktop/fetchmailtest.txt
Comment 12 David Ayton 2009-05-13 12:20:11 UTC
Created attachment 134561 [details]
Openchange fetchmail with network trace

openchangeclient --database=/students/u4495166/.openchange/profiles.ldb --profile=davidayton --to=davidayton@spectre.local --fetchmail --dump-data -d10 > ~/Desktop/fetchmail_trace_test.txt
Comment 13 Milan Crha 2009-05-14 14:43:44 UTC
(In reply to comment #12)
> Created an attachment (id=134561) [edit]
> Openchange fetchmail with network trace
> 
> openchangeclient --database=/students/u4495166/.openchange/profiles.ldb
> --profile=davidayton --to=davidayton@spectre.local --fetchmail --dump-data -d10
> > ~/Desktop/fetchmail_trace_test.txt
> 

Thanks for the update. As we talked on IRC, could you also try to get valgrind traces of the new fetch of evolution (steps like: delete local mapi account cache; run evolution as this:
   $ valgrind --leak-check=full evolution &>evo.log
and then try to open the test message in evolution (it should fetch it from the server). Let's see what it'll show us.

Note: Maybe the folder structure will be shown in the second run, so the second log might be OK, I hope.
Comment 14 Bharath Acharya 2009-05-15 04:26:17 UTC
Created attachment 134682 [details] [review]
Test patch

David, try it with this patch. Let me look for leaks and fix them in the meanwhile. Clear your MAPI mailer cache before testing it out.Thanks
Comment 15 David Ronis 2009-05-15 16:12:21 UTC
Created attachment 134717 [details]
Backtrace while mapi is trying to save remote folder

See thread #4.
Comment 16 David Ronis 2009-05-15 16:14:36 UTC
Hi Bharath,

It worked (although clearing the cache was essential).  The message is no longer corrupted in the display.   The problem with deleting a message still remains.   I deleted a message in the mapi inbox

Evo reports "Storing folder 'Mailbox -- ...  which seems to hang (the rest of evo is working fine, so it's probably just the thread that's stuck).  I'll attach another backtrace in a minute.

Thanks

Hmmm... This doesn't seem to have been saved.  I'll try again (the attachment already appeared).
Comment 17 David Ronis 2009-05-15 16:16:13 UTC
Some sort of collision occured.  The backtrace comment was deleted, but the backtrace attachment is still there:

https://bugzilla.gnome.org/attachment.cgi?id=134717
Comment 18 David Ayton 2009-05-16 02:19:22 UTC
Created attachment 134740 [details]
valgrind log

Milan, As requested valgrind log when starting evolution 2nd time after clearing cache, and fetching message "evo test 20".
Comment 19 David Ayton 2009-05-16 02:39:15 UTC
Created attachment 134741 [details]
Garbled headers fixed

Bharath,

I have applied your patch in http://bugzilla.gnome.org/attachment.cgi?id=134682 and can also confirm that it fixes the corrupted headers issue.
Comment 20 Johnny Jacob 2009-05-17 18:38:06 UTC
(In reply to comment #14)
> Created an attachment (id=134682) [edit]
> Test patch
> 
> David, try it with this patch. Let me look for leaks and fix them in the
> meanwhile. Clear your MAPI mailer cache before testing it out.Thanks
> 

Marking patch as reviewed (helps in my queries). We still wouldn't want to comment out releasing message object. 

Nice work Bharath! 

(We probably have to start working against openchange 0.8.2 . We'll decide that in next team meeting. )
Comment 21 Johnny Jacob 2009-05-22 07:42:53 UTC
*** Bug 583298 has been marked as a duplicate of this bug. ***
Comment 22 Bharath Acharya 2009-05-26 09:26:14 UTC
Created attachment 135371 [details] [review]
Evolution Mapi patch
Comment 23 Johnny Jacob 2009-06-10 03:07:09 UTC
(In reply to comment #22)
> Created an attachment (id=135371) [edit]
> Evolution Mapi patch
> 

Can you cleanup (remove commented code and unused variables) the patch and commit.
Comment 24 Bharath Acharya 2009-06-10 03:48:33 UTC
Cleanup done and committed to master.