Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.AccessViolationException on Excel close #1710

Closed
joshkreud opened this issue Jun 6, 2016 · 9 comments
Closed

System.AccessViolationException on Excel close #1710

joshkreud opened this issue Jun 6, 2016 · 9 comments
Labels
bug Identifies work items for known bugs
Milestone

Comments

@joshkreud
Copy link

joshkreud commented Jun 6, 2016

Getting this crash when trying to close excel:

Just open it add a module and try to close excel

image

private IntPtr WindowProc(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam)
        {
            try
            {
                var suppress = false;
                if (hWnd == _mainWindowHandle)
                {
                    switch ((WM)uMsg)
                    {
                        case WM.HOTKEY:
                            suppress = HandleHotkeyMessage(wParam);
                            break;

                        case WM.ACTIVATEAPP:
                            HandleActivateAppMessage(wParam);
                            break;
                    }
                }

                return suppress 
                    ? IntPtr.Zero 
                    : User32.CallWindowProc(_oldWndProc, hWnd, uMsg, wParam, lParam);
            }
            catch (Exception exception)
            {
                _logger.Error(exception);
            }

            return IntPtr.Zero;
        }
@PeterMTaylor
Copy link

Are you using 1.4 or the latest commit? If the latest there is a debug option in VS that can help point point where the code fails which is helping developers here

@PeterMTaylor
Copy link

See #1703

@joshkreud
Copy link
Author

@PeterMTaylor Latest commit on next
And well i could add a screenshot of the locals.
The Callstack only shows [external Code]
image

The last few Immediate Logs:

2016-06-06 08:01:19.3457;WARN;Rubberduck.Parsing.Symbols.TypeAnnotationPass;Failed to resolve type VBE;
Exception thrown: 'System.NotSupportedException' in Rubberduck.dll
Exception thrown: 'System.NotSupportedException' in Rubberduck.dll
Exception thrown: 'System.NotSupportedException' in Rubberduck.dll

@comintern
Copy link
Contributor

This isn't the same issue as #1703. The hooks shouldn't be waiting for Dispose to detach themselves - it probably should simply be handled in the WindowProc when a WM_DESTROY is received.

@Hosch250 Hosch250 added the bug Identifies work items for known bugs label Jun 10, 2016
@Hosch250 Hosch250 added this to the Version 2.0 milestone Jun 10, 2016
@retailcoder
Copy link
Member

@comintern #1780 fixed this, right?

@comintern
Copy link
Contributor

@retailcoder - Didn't fix all the cases where you can end up with a zombie Excel, but it should close this specific access violation.

@joshkreud
Copy link
Author

joshkreud commented Jun 23, 2016

on commit: f0f830b
this is still an issue
open excel --> load rubberduck --> Close excel --> Exception

@PeterMTaylor
Copy link

With my fork in sync with f0f830b. I too got the open excel -> load rubberduck -> Close excel -> Exception.

Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
Exception thrown: 'System.Runtime.InteropServices.ExternalException' in System.Windows.Forms.dll
The program '[8096] Excel.exe' has exited with code -536870909 (0xe0000003).

@retailcoder
Copy link
Member

deemed fixed at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies work items for known bugs
Projects
None yet
Development

No branches or pull requests

5 participants