Menu

#2145 Unhandled exception randomly received

KeePass_2.x
closed
nobody
None
5
2022-03-15
2022-03-07
No

I randomly receive an Unhandled exception, exception text as follows
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Disposed 'Cursor' can no longer be used.'.
at System.Windows.Forms.Cursor.get_Handle()
at System.Windows.Forms.RichTextBox.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

2 Attachments

Discussion

1 2 > >> (Page 1 of 2)
  • Robert Routledge

    I'm on KeePass 2.50 & Win 11 Pro, 21H2 b22567.100

     
  • Dominik Reichl

    Dominik Reichl - 2022-03-07
    • status: open --> closed
     
  • Dominik Reichl

    Dominik Reichl - 2022-03-07

    As it can be seen from the stack trace, the exception occurs in .NET code; there's no KeePass code involved.

    My suggestion would be to try repairing the .NET Framework using the following tool:
    https://www.microsoft.com/en-us/download/details.aspx?id=30135

    Best regards,
    Dominik

     
  • Paul

    Paul - 2022-03-07

    As can be seen the issue is Windows.Forms. This is probably a .NET issue not KeePass.
    Try a DISM and SFC repair [1], then a .NET repair [2].

    cheers, Paul

    p.s. please post text directly. Having to download a doc file, check it, open it, delete afterwards is a pain.

    [1] https://www.askwoody.com/forums/topic/message-after-bootup/#post-2421061
    [2] https://www.microsoft.com/en-gb/download/details.aspx?id=30135

    ************** Exception Text **************
    System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'Disposed 'Cursor' can no longer be used.'.
       at System.Windows.Forms.Cursor.get_Handle()
       at System.Windows.Forms.RichTextBox.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    KeePass
        Assembly Version: 2.50.0.20886
        Win32 Version: 2.50.0.0
        CodeBase: file:///C:/Program%20Files/KeePass%20Password%20Safe%202/KeePass.exe
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    Accessibility
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    System.Security
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
    ----------------------------------------
    KeePass.XmlSerializers
        Assembly Version: 2.50.0.20886
        Win32 Version: 2.50.0.20886
        CodeBase: file:///C:/Program%20Files/KeePass%20Password%20Safe%202/KeePass.XmlSerializers.DLL
    ----------------------------------------
    
     
  • Robert Routledge

    I have turned off .NET in Windows Features but am still receiving the error as below

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ** Exception Text **
    System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'Disposed 'Cursor' can no longer be used.'.
    at System.Windows.Forms.Cursor.get_Handle()
    at System.Windows.Forms.RichTextBox.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ** Loaded Assemblies **
    mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll


    KeePass
    Assembly Version: 2.50.0.20886
    Win32 Version: 2.50.0.0
    CodeBase: file:///C:/Program%20Files/KeePass%20Password%20Safe%202/KeePass.exe


    System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll


    System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll


    System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll


    System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll


    System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll


    System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll


    Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll


    System.Security
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.9022.1 built by: NET481REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll


    KeePass.XmlSerializers
    Assembly Version: 2.50.0.20886
    Win32 Version: 2.50.0.20886
    CodeBase: file:///C:/Program%20Files/KeePass%20Password%20Safe%202/KeePass.XmlSerializers.DLL


    ** JIT Debugging **
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.

    For example:

    <configuration>
    <system.windows.forms jitdebugging="true">
    </system.windows.forms></configuration>

    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.

    Please can you advise further?

     
  • Paul

    Paul - 2022-03-09

    You can't turn off .NET, it's part of Windows. Repairing it is the usual remedy.

    cheers, Paul

     
  • Robert Routledge

    So what happens when I turn off .NET from the control panel, see screenshot?
    I've previously tried a .NET repair but it made no difference

     
  • Dominik Reichl

    Dominik Reichl - 2022-03-09

    In this dialog, you can remove .NET 3.5 and some additional things for .NET 4.8. Even if both options are turned off, .NET 4.8 continues to be installed.

    Best regards,
    Dominik

     
  • Vinnie-NZ

    Vinnie-NZ - 2022-03-09

    I've also got this across at least two machines on the insider builds (22572 - released today and 22567).

    I've done the DISM and SFC repairs, and the .NET troubleshooter and no issues found by anything, yet the problem still happens.

    I can reproduce it every time by running the mouse over the bottom of the KeePass main window (Entry View portion of the window).

     
    👍
    1
  • Paul

    Paul - 2022-03-10

    Do you have any plug-ins? Try it without them.

    Try a clean copy of the portable (zip) version with an enforced config file set to use new settings.
    Place the attached txt file in the same location as the portable KeePass.exe and rename it to KeePass.config.xml.
    Run KeePass.exe.

    cheers, Paul

     
    • Robert Routledge

      No plug-ins

       
  • Dominik Reichl

    Dominik Reichl - 2022-03-10

    Are you using any special cursor (e.g. a colored cursor)? If so, try using the regular one.

    Best regards,
    Dominik

     
    • Robert Routledge

      No special cursor

       
  • Paul

    Paul - 2022-03-10

    Clean config?

     
  • Vinnie-NZ

    Vinnie-NZ - 2022-03-10

    Also have no special cursor.

    Downloaded the portable version, extracted and then grabbed the clean config file.

    Renamed to KeePass.config.enforced.xml and dropped into the same folder I extracted the portable version to.

    Loaded up a DB file and selected an entry, then ran the mouse over the Entry View portion of the window for a few seconds and the same error still came up:

    See the end of this message for details on invoking 
    just-in-time (JIT) debugging instead of this dialog box.
    
    ************** Exception Text **************
    System.ObjectDisposedException: Cannot access a disposed object.
    Object name: 'Disposed 'Cursor' can no longer be used.'.
       at System.Windows.Forms.Cursor.get_Handle()
       at System.Windows.Forms.RichTextBox.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    
    
    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
    ----------------------------------------
    KeePass
        Assembly Version: 2.50.0.20886
        Win32 Version: 2.50.0.0
        CodeBase: file:///C:/Users/username/Desktop/KeePass-2.50/KeePass.exe
    ----------------------------------------
    System.Windows.Forms
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    ----------------------------------------
    System
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    ----------------------------------------
    System.Configuration
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    ----------------------------------------
    System.Core
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
    ----------------------------------------
    Accessibility
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
    ----------------------------------------
    KeePass.XmlSerializers
        Assembly Version: 2.50.0.20886
        Win32 Version: 2.50.0.20886
        CodeBase: file:///C:/Users/username/Desktop/KeePass-2.50/KeePass.XmlSerializers.DLL
    ----------------------------------------
    System.Security
        Assembly Version: 4.0.0.0
        Win32 Version: 4.8.9022.1 built by: NET481REL1
        CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Security/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Security.dll
    ----------------------------------------
    
    ************** JIT Debugging **************
    To enable just-in-time (JIT) debugging, the .config file for this
    application or computer (machine.config) must have the
    jitDebugging value set in the system.windows.forms section.
    The application must also be compiled with debugging
    enabled.
    
    For example:
    
    <configuration>
        <system.windows.forms jitDebugging="true" />
    </configuration>
    
    When JIT debugging is enabled, any unhandled exception
    will be sent to the JIT debugger registered on the computer
    rather than be handled by this dialog box.
    
     
    👍
    1

    Last edit: Vinnie-NZ 2022-03-11
  • Paul

    Paul - 2022-03-11

    Try a previous version of KeePass.

    cheers, Paul

     
  • Robert Routledge

    I can pin it down to when you roll over a link, in my case that is a group name (General) and/or a URL

     
  • Paul

    Paul - 2022-03-11

    When you roll over a URL you get a tooltip popup.
    Try editing an entry and roll over one of the icons. Yo should get a tooltip.

    cheers, Paul

     
  • Robert Routledge

    In edit mode a roll over one of the icons does indeed give me a tooltip
    So from what you are saying the issue appears to be an exception instead of a tool tip in view entry mode when rolling over group/URL

     

    Last edit: Robert Routledge 2022-03-11
  • Paul

    Paul - 2022-03-11

    Rolling over a group highlights the group name but doesn't produce a tooltip. Same as rolling over a field heading or entry.
    I can't reproduce this on my machines so I don't know what causes it, apart from .NET.

    Do you have any unusual programs installed?

    cheers, Paul

     
  • Robert Routledge

    If I can find a way of uninstalling .NET I'll retest to prove .NET
    Does KeePass 2.50 need .NET 4.8 to run?
    What's unusual in this context, please be more specific?

     

    Last edit: Robert Routledge 2022-03-11
  • Paul

    Paul - 2022-03-11

    If you manage to remove .NET, KeePass won't run.

    Non-office / browser software

    cheers, Paul

     

    Last edit: Paul 2022-03-11
  • Robert Routledge

    Yes of course I have!
    Most people have
    What's your point?
    What Windows versions are you testing against?

     

    Last edit: Robert Routledge 2022-03-11
  • Paul

    Paul - 2022-03-11

    Something interfering?

    Windows 10, NET 4.8, KeePass 2.50

     
  • Robert Routledge

    You need to test against Windows 11!
    Windows 11 was released to the general public on October 5, 2021
    I clearly stated at the start I was using Win 11
    You'll be unlikely to reproduce the bug unless you're using the same baseline
    Suggesting that users are at fault for using 'unusual programs' is not acceptable
    Your scope of testing is inadequate and needs to be addressed

     
1 2 > >> (Page 1 of 2)

Log in to post a comment.