View Issue Details

IDProjectCategoryView StatusLast Update
0003062Kali LinuxGeneral Bugpublic2025-07-14 09:38
ReporterWilliam Assigned Torhertzog  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version2016.1 
Summary0003062: keepass2 crashes with several mono exceptions when deleting groups within a keepass2 database
Description

While testing the migration to Kali Rolling, we observed and issue with Keepass2 that was not present with Kali Rolling where when an object is deleted from either an existing database, or a newly created database, with the latest package of Keepass2, after the application prompts for confirmation to delete the object, the left window produces a red 'x' and prompts if you want to save the database.

When executed from the console, keepass2 appears to crash with the following message when we delete the object from a new or existing database, but keepass2 still remains up:

(02/11/16 14:58:37)lorend@rad:~
$ keepass2
SendMessage (29360170, 0x112c, 0x4, 0x4)
System.OutOfMemoryException: Not enough memory to complete operation [GDI+ status: OutOfMemory]
at System.Drawing.GDIPlus.CheckStatus (Status status) <0x405c3360 + 0x001f3> in <filename unknown>:0
at System.Drawing.Graphics.DrawLine (System.Drawing.Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) <0x4078e4b0 + 0x000f7> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:DrawLine (System.Drawing.Pen,int,int,int,int)
at System.Windows.Forms.TreeView.DrawNodeLines (System.Windows.Forms.TreeNode node, System.Drawing.Graphics dc, Rectangle clip, System.Drawing.Pen dash, Int32 x, Int32 y, Int32 middle) <0x407ec810 + 0x00163> in <filename unknown>:0
at System.Windows.Forms.TreeView.DrawTreeNode (System.Windows.Forms.TreeNode node, System.Drawing.Graphics dc, Rectangle clip) <0x407ebf40 + 0x00417> in <filename unknown>:0
at System.Windows.Forms.TreeView.Draw (Rectangle clip, System.Drawing.Graphics dc) <0x407eba40 + 0x0029b> in <filename unknown>:0
at System.Windows.Forms.TreeView.OnPaintInternal (System.Windows.Forms.PaintEventArgs pe) <0x407eb9e0 + 0x00047> in <filename unknown>:0
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) <0x4070a350 + 0x00140> in <filename unknown>:0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) <0x40631c20 + 0x001f7> in <filename unknown>:0
at System.Windows.Forms.TreeView.WndProc (System.Windows.Forms.Message& m) <0x406c3360 + 0x000cb> in <filename unknown>:0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) <0x40631bf0 + 0x00024> in <filename unknown>:0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) <0x40631bb0 + 0x00036> in <filename unknown>:0
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) <0x406304f0 + 0x0031c> in <filename unknown>:0

Keepass2 then prompts if you want to save the database. If you save the database, it then crashes with the following output:

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () <0x40cbc720 + 0x0004b> in <filename unknown>:0
at System.Net.Sockets.Socket.Send (System.Byte[] buffer) <0x40ddb6b0 + 0x00023> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.WakeupMain () <0x40ddb5d0 + 0x00057> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SendAsyncMethod (System.Windows.Forms.AsyncMethodData method) <0x41da8e10 + 0x0022b> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SendMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) <0x40d5efe0 + 0x0032a> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.UnmapWindow (System.Windows.Forms.Hwnd hwnd, WindowType windows) <0x40e17200 + 0x00331> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SetVisible (IntPtr handle, Boolean visible, Boolean activate) <0x40e103c0 + 0x002e3> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SystrayRemove (IntPtr handle, System.Windows.Forms.ToolTip& tt) <0x41dbe340 + 0x00028> in <filename unknown>:0
at System.Windows.Forms.XplatUI.SystrayRemove (IntPtr handle, System.Windows.Forms.ToolTip& tt) <0x41dbe310 + 0x00029> in <filename unknown>:0
at System.Windows.Forms.NotifyIcon.HideSystray () <0x41dbe2a0 + 0x00043> in <filename unknown>:0
at System.Windows.Forms.NotifyIcon.Dispose (Boolean disposing) <0x41dbe230 + 0x00023> in <filename unknown>:0
at System.ComponentModel.Component.Finalize () <0x40dd7e80 + 0x0001d> in <filename unknown>:0
(02/11/16 15:06:20)lorend@rad:~
$

After deleting the object and saving the database, when we open the database back up, we get the following error messages:

(02/11/16 14:51:02)lorend@rad:~
$ keepass2 --debug
SendMessage (29360170, 0x112c, 0x4, 0x4)
System.OutOfMemoryException: Not enough memory to complete operation [GDI+ status: OutOfMemory]
at System.Drawing.GDIPlus.CheckStatus (Status status) <0x402ea360 + 0x001f3> in <filename unknown>:0
at System.Drawing.Graphics.DrawLine (System.Drawing.Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) <0x4049e850 + 0x000f7> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:DrawLine (System.Drawing.Pen,int,int,int,int)
at System.Windows.Forms.TreeView.DrawNodeLines (System.Windows.Forms.TreeNode node, System.Drawing.Graphics dc, Rectangle clip, System.Drawing.Pen dash, Int32 x, Int32 y, Int32 middle) <0x40513f10 + 0x00163> in <filename unknown>:0
at System.Windows.Forms.TreeView.DrawTreeNode (System.Windows.Forms.TreeNode node, System.Drawing.Graphics dc, Rectangle clip) <0x40513640 + 0x00417> in <filename unknown>:0
at System.Windows.Forms.TreeView.Draw (Rectangle clip, System.Drawing.Graphics dc) <0x40513140 + 0x0029b> in <filename unknown>:0
at System.Windows.Forms.TreeView.OnPaintInternal (System.Windows.Forms.PaintEventArgs pe) <0x405130e0 + 0x00047> in <filename unknown>:0
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) <0x404322e0 + 0x00140> in <filename unknown>:0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) <0x403594e0 + 0x001f7> in <filename unknown>:0
at System.Windows.Forms.TreeView.WndProc (System.Windows.Forms.Message& m) <0x403eb960 + 0x000cb> in <filename unknown>:0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) <0x403594b0 + 0x00024> in <filename unknown>:0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) <0x40359470 + 0x00036> in <filename unknown>:0
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) <0x40357db0 + 0x0031c> in <filename unknown>:0

Unhandled Exception:
System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'System.Net.Sockets.Socket'.
at System.Net.Sockets.Socket.ThrowIfDisposedAndClosed () <0x402b4720 + 0x0004b> in <filename unknown>:0
at System.Net.Sockets.Socket.Send (System.Byte[] buffer) <0x403d4270 + 0x00023> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.WakeupMain () <0x403d4190 + 0x00057> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SendAsyncMethod (System.Windows.Forms.AsyncMethodData method) <0x4051ecc0 + 0x0022b> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SendMessage (IntPtr hwnd, Msg message, IntPtr wParam, IntPtr lParam) <0x403578a0 + 0x0032a> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.UnmapWindow (System.Windows.Forms.Hwnd hwnd, WindowType windows) <0x404104d0 + 0x00331> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SetVisible (IntPtr handle, Boolean visible, Boolean activate) <0x40409690 + 0x002e3> in <filename unknown>:0
at System.Windows.Forms.XplatUIX11.SystrayRemove (IntPtr handle, System.Windows.Forms.ToolTip& tt) <0x4051fbf0 + 0x00028> in <filename unknown>:0
at System.Windows.Forms.XplatUI.SystrayRemove (IntPtr handle, System.Windows.Forms.ToolTip& tt) <0x4051fbc0 + 0x00029> in <filename unknown>:0
at System.Windows.Forms.NotifyIcon.HideSystray () <0x4051fb50 + 0x00043> in <filename unknown>:0
at System.Windows.Forms.NotifyIcon.Dispose (Boolean disposing) <0x4051fae0 + 0x00023> in <filename unknown>:0
at System.ComponentModel.Component.Finalize () <0x403d0860 + 0x0001d> in <filename unknown>:0
(02/11/16 14:54:03)lorend@rad:~
$

If we choose to say 'Yes' when prompted to delete the the group, again we get the following output:

(02/11/16 15:14:38)lorend@rad:~
$ keepass2
SendMessage (29360170, 0x112c, 0x4, 0x4)
System.OutOfMemoryException: Not enough memory to complete operation [GDI+ status: OutOfMemory]
at System.Drawing.GDIPlus.CheckStatus (Status status) <0x40e28360 + 0x001f3> in <filename unknown>:0
at System.Drawing.Graphics.DrawLine (System.Drawing.Pen pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2) <0x40ff3a30 + 0x000f7> in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Drawing.Graphics:DrawLine (System.Drawing.Pen,int,int,int,int)
at System.Windows.Forms.TreeView.DrawNodeLines (System.Windows.Forms.TreeNode node, System.Drawing.Graphics dc, Rectangle clip, System.Drawing.Pen dash, Int32 x, Int32 y, Int32 middle) <0x41051e40 + 0x00163> in <filename unknown>:0
at System.Windows.Forms.TreeView.DrawTreeNode (System.Windows.Forms.TreeNode node, System.Drawing.Graphics dc, Rectangle clip) <0x41051570 + 0x00417> in <filename unknown>:0
at System.Windows.Forms.TreeView.Draw (Rectangle clip, System.Drawing.Graphics dc) <0x41051070 + 0x0029b> in <filename unknown>:0
at System.Windows.Forms.TreeView.OnPaintInternal (System.Windows.Forms.PaintEventArgs pe) <0x41051010 + 0x00047> in <filename unknown>:0
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m) <0x40f6f400 + 0x00140> in <filename unknown>:0
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) <0x40e96c20 + 0x001f7> in <filename unknown>:0
at System.Windows.Forms.TreeView.WndProc (System.Windows.Forms.Message& m) <0x40f28360 + 0x000cb> in <filename unknown>:0
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) <0x40e96bf0 + 0x00024> in <filename unknown>:0
at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) <0x40e96bb0 + 0x00036> in <filename unknown>:0
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) <0x40e954f0 + 0x0031c> in <filename unknown>:0

What is different, however, is if we say 'No' to saving the database, it appears to also crash but with no other error messages.

This environment consists of the following:

(02/11/16 15:18:28)lorend@rad:~
$ which keepass2
/usr/bin/keepass2
(02/11/16 15:18:50)lorend@rad:~
$ tyhpe keepass2
bash: tyhpe: command not found
(02/11/16 15:18:55)lorend@rad:~
$ tyhpe keepass2
bash: tyhpe: command not found
(02/11/16 15:18:58)lorend@rad:~
$
(02/11/16 15:18:58)lorend@rad:~
$ which keepass2
/usr/bin/keepass2
(02/11/16 15:18:59)lorend@rad:~
$ type keepass2
keepass2 is hashed (/usr/bin/keepass2)
(02/11/16 15:19:02)lorend@rad:~
$ file /usr/bin/keepass2
/usr/bin/keepass2: POSIX shell script, ASCII text executable
(02/11/16 15:19:19)lorend@rad:~
$ dpkg --search /usr/bin/keepass2
keepass2: /usr/bin/keepass2
(02/11/16 15:19:40)lorend@rad:~
$ dpkg --list keepass2
Desired=Unknown/Install/Remove/Purge/Holdr
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==========================-==================-==================-==========================================================
ii keepass2 2.31+dfsg-1 all Password manager
(02/11/16 15:19:57)lorend@rad:~
$ dpkg --status keepass2
Package: keepass2
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 2910
Maintainer: Debian CLI Applications Team [email protected]
Architecture: all
Version: 2.31+dfsg-1
Depends: mono-runtime (>= 3.0~), libmono-corlib4.5-cil (>= 4.2.0), libmono-system-drawing4.0-cil (>= 3.0.6), libmono-system-security4.0-cil (>= 1.0), libmono-system-windows-forms4.0-cil (>= 1.0), libmono-system-xml4.0-cil (>= 4.2.0), libmono-system4.0-cil (>= 4.2.0), libx11-6 (>= 2:1.6.0)
Recommends: xsel
Suggests: keepass2-doc, mono-dmcs, xdotool
Description: Password manager
KeePass is a easy-to-use password manager for Windows, Linux, Mac OS X and
mobile devices. You can store your passwords in highly-encrypted databases,
which can only be unlocked with one master password and/or a key file.
A database consists of only one file that can be transferred from one computer
to another easily.
KeePass can import data from various file formats. The password list can be
exported to various formats, including TXT, HTML, XML and CSV files.
Homepage: http://keepass.info/
(02/11/16 15:20:12)lorend@rad:~
$ uname -a
Linux rad 4.3.0-kali1-amd64 0000001 SMP Debian 4.3.3-7kali2 (2016-01-27) x86_64 GNU/Linux
(02/11/16 15:20:30)lorend@rad:~
$ free -m
total used free shared buff/cache available
Mem: 32095 2847 13591 77 15655 29085
Swap: 9911 0 9911
(02/11/16 15:20:36)lorend@rad:~
$ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/dm-1 225G 16G 199G 8% /
(02/11/16 15:20:47)lorend@rad:~
$ cli -V
Mono JIT compiler version 4.2.1 (Debian 4.2.1.102+dfsg2-5)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: sgen
(02/11/16 15:21:06)lorend@rad:~
$ dpkg -s libc6 | grep ^Version
Version: 2.21-7
(02/11/16 15:23:18)lorend@rad:~
$

In closing, we believe this to be a bug with with the 2.31 package of Keepass2, and while a tools upgrade request was opened to upgrade keepass2 in issue 0001945, we believe that package 2.28 is more stable than the present package 2.31, so we propose backing out of version 2.31, going back to version 2.28, or identifying the issue causing this behavior in package 2.31, which is currently marked as 'unstable'.

Steps To Reproduce

This is reproducible in one of two ways, pending if you have an old Keepass2 database from another source.

If you do not have an old keepass2 database from another source, do the following:

  1. Running Kali Rolling 2016.1, with updated packages, as any user, open up 'gnome-terminal' and execute 'keepass2' from the command line.
  2. If prompted to 'Open Database - ', click 'Cancel'.
  3. When the 'Keepass' window opens up, click the 'New (CTRL +N)' button.
  4. When a 'Create New Password Database' file save dialog comes up, save the file anywhere using either the default name (NewDatabase.kdbx) or a name of your choosing as the 'File name' and selecting 'Save as type:' as 'Keepass KDBX Files (*.kdbx)'
  5. Click 'Save'
  6. If a file already exists, either specify a new file or overwrite the file you specified in step four by clicking 'OK' when the 'Save' dialog pops up.
  7. When the 'Create Composite Master Key' window shows up, ensure that 'Master Password' is checked and specify a password, such as 'asdf'. Then specify the same password in the 'Repeat Password' dialog box and click 'OK'
  8. When the 'Create New Password Database - Step 2' window pops up, within the 'Enter a name for the database or leave it empty' dialog of the 'General' tab, specify some value, such as 'asdf' and click 'OK'
  9. This will open up the main Keepass window with the newly created sample database. From here, click on the 'Save' icon. Then close the window.
  10. Execute 'keepass2' program again from 'gnome-terminal' as the same user. This should open up an 'Open Database - ' Window, prompting for a password to the database.
  11. Check the 'Master Password' box and specify the password provided in step 7 and click 'OK'
  12. Delete any group under the 'General' group name, such as 'Windows' or 'Network' by either selecting the object and pressing the 'delete' key or right clicking on the group object and selecting 'Delete Group'.
  13. When the 'Delete Group' dialog box pops up, asking 'Are you sure you want to move the selected group to the recycle bin?', click 'Yes'.
  14. When the 'KeePass - Save Before Close/Lock?' dialog box pops up, click the 'Yes' button.
  15. This should cause the program to close or crash.
  16. Attempt to open the database again as per step 10, noting that after providing the 'Master password' and clicking 'OK', the application will crash.

If you have an old keepass2 database from another source, execute steps 10 and on up above, specifying the old keepass2 database.

Additional Information

Package 2.31+dfsg-1 is listed as unstable as per packages.qa.debian.org/keepass2.html. Package 2.28 is the latest stable package. When we download and install package 2.28 on a fresh install of Kali Rolling 2016.1 and fresh updates, we do not face these issues.

We also notice that there is no 'Recycle Bin' object in the 2.31 version of Keepass2, which is odd. Regardless, even though the same behavior is observed with previous keepass2 databases, we attempted to recreate the 'Recycle Bin' group object as it is configred within the 2.28 package, but it still appears to crash when deleting objects.

This testing was conducted on two HP ZBooks 17G2 laptops, one running Kali 2 and run running Kali 2016.1, both with with 32GB's of Ram and an i7-4810MQ Intel processor as well as a Lenovo W520 with 32GB's of RAM and an i7- intel 2860 QM processor.

Activities

William

William

2016-02-12 00:24

reporter   ~0004697

Please review issue 3063, as this has an uploaded video (the file was too big initially).

rhertzog

rhertzog

2016-02-15 07:55

administrator   ~0004705

Tracked in 0003063.

Issue History

Date Modified Username Field Change
2016-02-12 00:16 William New Issue
2016-02-12 00:24 William Note Added: 0004697
2016-02-15 07:55 rhertzog Note Added: 0004705
2016-02-15 07:55 rhertzog Status new => closed
2016-02-15 07:55 rhertzog Assigned To => rhertzog
2016-02-15 07:55 rhertzog Resolution open => duplicate
2025-07-14 09:38 g0tmi1k Severity crash => minor