rubberduck-vba / Rubberduck

Every programmer needs a rubberduck. COM add-in for the VBA & VB6 IDE (VBE).
https://rubberduckvba.com
GNU General Public License v3.0
1.92k stars 302 forks source link

Excel crash when closing #2436

Closed halcwb closed 7 years ago

halcwb commented 7 years ago

Excel crashes when closing the application.

The log trace shows:

2016-12-17 22:43:35.5640;ERROR;Rubberduck._Extension;System.ArgumentException: Invalid argument. at Microsoft.Vbe.Interop.Forms.Controls.Item(Object varg) at Rubberduck.VBEditor.SafeComWrappers.VBA.Controls.get_Item(Object index) in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\Controls.cs:line 24 at Rubberduck.VBEditor.SafeComWrappers.VBA.Controls.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\Controls.cs:line 43 at Rubberduck.VBEditor.SafeComWrappers.VBA.VBComponent.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBComponent.cs:line 174 at Rubberduck.VBEditor.SafeComWrappers.VBA.VBComponents.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBComponents.cs:line 79 at Rubberduck.VBEditor.SafeComWrappers.VBA.VBProject.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBProject.cs:line 109 at Rubberduck.VBEditor.SafeComWrappers.VBA.VBProjects.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBProjects.cs:line 65 at Rubberduck.VBEditor.SafeComWrappers.VBA.VBE.Release() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\Rubberduck.VBEEditor\SafeComWrappers\VBA\VBE.cs:line 76 at Rubberduck._Extension.ShutdownAddIn() in c:\Users\Mathieu\Documents\GitHub\Rubberduck\RetailCoder.VBE\Extension.cs:line 195;

retailcoder commented 7 years ago

Thanks for reporting. Is that off release 2.0.9 or the current 2.0.10 build?

halcwb commented 7 years ago

This in the 2.0.9 release.

retailcoder commented 7 years ago

Cool. I believe it might quite possibly have been fixed with the ComWrapperEnumerator tweaks (added null-check) merged in #2370.

Looking at #2437 though, it seems likely that whatever made the source control crash trying to export all these forms is also responsible for crashing the teardown of these forms.

The teardown process has been massively modified since 2.0.9 was released; we're still getting crash-on-exit every now and then (seems related to the parser threads), but very frequent "clean" exits too.

halcwb commented 7 years ago

I think it could also be related to opening an excel project without ever hitting the code refresh button. I will try and investigate further. I was able to exit excel without any error after making sure Rubberduck refresh was up to date.

halcwb commented 7 years ago

Seems fixed in: https://github.com/rubberduck-vba/Rubberduck/releases/tag/v2.0.10.