Outlook won't close when my addin contains a form region

Add-in Express™ Support Service
That's what is more important than anything else

Only registered users are allowed to subscribe.
Outlook won't close when my addin contains a form region
 
Melvyn Laïly




Posts: 5
Joined: 2017-10-25
Hi,

I'm working on an Outlook addin and I have a problem: sometimes when the addin is loaded and an Inspector with an advanced form region is open, if I close the Explorer, Outlook never closes completely.
The process stays alive with a grey icon in the systray, and it uses 100% CPU time on one core.
It's then impossible to reopen it or close it properly without killing the process first.

The problem happens almost every time on some machines, and rarely on others.

I know this looks like a frequent problem related to not properly releasing COM objects, but I believe this is a different scenario.
I've been able to reproduce the problem with a completely new addin project using the latest version, with only an empty advanced region added and configured to show when writing a new mail from an Inspector.

What I've found so far:
- The problem only happens on Windows 10 (I tested it on a clean Windows 7 VM (the bug never happens), and a clean Windows 10 VM (the bug seems to always happen), with a release build of my test addin)
- When tested on live Windows 10 machines, it seems to happen more frequently on some machines than on others, but I've not been able to figure out why.
- The problem only happens when the "Zimbra Shutdown Addin" is loaded (I disabled everything except this Zimbra addin and my addin. The version of Zimbra is the latest available: 8.7.10.1711)
- The "Zimbra Shutdown Addin" and my test addin both work properly when they are the only addin loaded.
- When attaching a debugger to the failing Outlook process and pausing randomly, I sometimes get in some Add-in Express code: AddinExpress.OL.2005.dll!AddinExpress.Extensions.ADXMessageRetHook.CallbackFunction(int code, System.IntPtr wParam, System.IntPtr lParam), or AddinExpress.OL.2005.dll!AddinExpress.Extensions.ADXMessageHook.CallbackFunction(int code, System.IntPtr wParam, System.IntPtr lParam) for example. I'm not sure if this is related to the problem or important to know...
- When activating the full log for the Zimbra Connector for Outlook, I see that after Outlook tries to close, it gets stuck in an infinite loop processing the same Windows message (from the log: "Dispatching message 0x738")
- I don't know what this Windows message means, but I found someone with a strangely similar problem here: https://fleexlab.blogspot.fr/2017/06/patch-to-fix-100-cpu-usage-and-freezing.html - It says that this 0x738 message appeared in Windows 10 1703, which would explain why I can't reproduce the problem on Windows 7.

So to sum up, it seems to be an interaction between the Add-in Express advanced form regions, and this "Zimbra Shutdown Addin".
This would be easy to say it's Zimbra's fault, but unfortunately we obviously can't release an addin that would not work if our clients happen to use Zimbra, especially when Zimbra on its own works fine.

I've been stuck on this problem for a while now, and I would very much appreciate your help.

Thank you.
Posted 30 Nov, 2017 09:47:14 Top
Andrei Smolin


Add-in Express team


Posts: 15207
Joined: 2006-05-11
Hello Melvyn,

I'm sorry, I expect that we will have some comments on this next Monday-Tuesday.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 01 Dec, 2017 10:19:16 Top
Melvyn Laïly




Posts: 5
Joined: 2017-10-25
Hello Andrei,

Have you been able to at least reproduce my problem? Feel free to ask for more information!

Thanks.
Posted 06 Dec, 2017 04:12:44 Top
Alexander Solomenko


Add-in Express team


Posts: 118
Joined: 2009-02-27
Hi Melvyn,

Sorry for the delay in our response. We installed Zimbra add-in, but have not been able to reproduce the issue, although we believe it exists. Probably we need credentials for Zimbra Colaboration Network, but we don't have them.

What you see in the debugger is the consequence (aftereffect) of the problem, i.e. our add-in is still working and the hook handler reacts to any message that is sent in the current thread. Looping occurs for other reasons that are unknown yet. The message you are talking about seems to be a regular internal Outlook message (WM_USER + id), the infinite appearance of which is a consequence and not the source of the problem.

Let's try to localize the problem. First off, do not show our region in the inspector window, and then remove the entire ADXOlFormsManager component from the test add-in. If the issue is gone on any step, then at least we will know what forces it to appear. The next step is likely to require that we access your PC remotely (preferably with VS installed) to determine the exact reasons of the problem. I do not see any other ways.
Regards,
Aleksandr Solomenko
Posted 06 Dec, 2017 06:17:58 Top
Melvyn Laïly




Posts: 5
Joined: 2017-10-25
Thank you for your reply.

I tried to find where you might have been blocked by installing the Zimbra Connector for Outlook in a virtual machine without connecting to a Zimbra server but I couldn't find a way. I'm not sure if you managed to do it but I understand this is hard to try to reproduce the problem without it... (I guess installing the trial version of Zimbra server might work, but it would be a real pain to do so)

Anyway, I tried what you suggested and here are the results:
- Test addin with a region showing in the inspector: I reproduced the problem.
- Test addin with a region having its "enabled" property set to false: I reproduced the problem.
- Test addin with a region not configured for showing in either explorers or inspectors: I reproduced the problem.
- Test addin with a form manager without a form in its "Items" collection: I reproduced the problem.
- Test addin without any form manager: I couldn't reproduce the problem.

So it seems the mere presence of an OlFormsManager causes the bug to happen when closing Outlook with an Inspector open...
(I didn't notice any difference in the frequency of the bug: it does not happen every time, but a few tries are enough at each step)

Tell me if this can help you diagnose the problem.
Regarding you accessing my PC remotely, I'm not sure how this could help since I don't have access to the Addin-Express source code to debug it, but I understand you might want to see the problem for yourself, and it's hard to do so without Zimbra, so I'm open to this solution if this is required.

Let me know what you think.

Regards,

Melvyn.
Posted 07 Dec, 2017 10:14:30 Top
Andrei Smolin


Add-in Express team


Posts: 15207
Joined: 2006-05-11
Hello Melvyn,

Thank you! This helps a lot.

We see two variants:
1) if you could provide a test Zymbra account, we could try to reproduce the issue on our side
2) we will provide the source code to debug the issue on your side during a remote session.

What do you think?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Dec, 2017 05:24:34 Top
Melvyn Laïly




Posts: 5
Joined: 2017-10-25
Hi,

I asked my IT department, and it should be possible to provide you with a test account on our Zimbra server.

I will give you the credentials as soon as the account is ready. How can I contact you privately?

In case this is not enough, we can still do a remote session after that...

Regards,

Melvyn.
Posted 08 Dec, 2017 08:26:14 Top
Andrei Smolin


Add-in Express team


Posts: 15207
Joined: 2006-05-11
Thank you, Melvyn.

You can send that information to the support email address; find it in {Add-in Express installation folder}\readme.txt; please make sure your email contains a link to this topic.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Dec, 2017 08:29:56 Top
Melvyn Laïly




Posts: 5
Joined: 2017-10-25
Just as a follow-up if anyone has the same problem:

The Add-in Express team have been able to reproduce the issue on their side, and it does not seem to be related to the Add-in Express framework.

Here are the important points we discussed:

Andrei Smolin writes:
When it occurs, the code of Add-in Express doesn’t receive any events informing us that the add-in stops working and this prevents Add-in Express from releasing resources (including Outlook objects). Obviously, the issue occurs because of the Zimbra Shutdown add-in: everything works if we turn it off. We tried to set RequireShutdownNotification for our add-in (see here); this doesn’t help.

We suppose the Zimbra Shutdown add-in waits for some objects to get released in an endless loop.


Andrei Smolin writes:
We suppose there’s an object or resource that the Forms Manager uses and the Shutdown add-in waits for. Finding that resource will take quite a lot of time. The issue is now filed down under #12036 in our issue-tracking DB. When I have news on it, I’ll send you a note.


Andrei Smolin writes:
For your information, we were able to reproduce (twice) the hang on an Outlook that has these add-ins enabled: two Zimbra add-ins and an add-in that Visual Studio installs.
(Team Foundation Add-in or Visual Studio Tools for Office Design-Time Adaptor for Excel. If required, I’ll find out which of them was turned on.)

In other words, no Add-in Express based add-ins were enabled in that moment.


I'm now trying to contact the Zimbra support via my IT department, to have them look at this problem on their side. (They haven't answered my topic on their forum after almost two months)
Posted 26 Jan, 2018 05:10:37 Top
Andrei Smolin


Add-in Express team


Posts: 15207
Joined: 2006-05-11
Thank you, Melvyn! Please keep us and forum readers informed. If the topic gets closed by the time you have more info, write me to the support email address and I'll open it.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Jan, 2018 04:25:18 Top