Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 435860 - app-admin/keepass USE=aot - Mono aborts with an assertion failure on opening database
Summary: app-admin/keepass USE=aot - Mono aborts with an assertion failure on opening ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Alessandro Di Federico
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-22 13:33 UTC by Alex Xu (Hello71)
Modified: 2012-09-26 13:35 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
`emerge --info keepass` (emergeinfo.txt,5.79 KB, text/plain)
2012-09-24 19:56 UTC, Alex Xu (Hello71)
Details
`emerge -O keepass` (emerge.log,28.89 KB, text/plain)
2012-09-24 19:59 UTC, Alex Xu (Hello71)
Details
Patch to copy the KeePass.exe.config file in the build ouput directory, so the AOT compiler has all the information needed to produce a correct output. (keepass-2.20-r1.ebuild.patch,547 bytes, patch)
2012-09-25 00:22 UTC, Alessandro Di Federico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Xu (Hello71) 2012-09-22 13:33:49 UTC
How to reproduce:

1. Emerge keepass with aot USE flag enabled.
2. Open KeePass.
3. Attempt to open a database.

Expected results:

DB opens.

Actual results:

Mono aborts with an assertion failure.

Workaround:

Manually go to /usr/lib/keepass and run `mono --aot -O=all KeePass.exe`.

The level of AOT run manually does not appear to have an impact on reproducibility. (i.e. never happens when AOT is done manually)
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2012-09-24 10:54:45 UTC
1) Please post your `emerge --info app-admin/keepass' output in a comment.
2) Please post the output of the failing command.
Comment 2 Alex Xu (Hello71) 2012-09-24 19:56:18 UTC
Created attachment 324870 [details]
`emerge --info keepass`
Comment 3 Alex Xu (Hello71) 2012-09-24 19:58:09 UTC
KDE colorscheme read failure, using built-in colorscheme
SendMessage (37748769, 0x101f, (nil), (nil))
SendMessage (0, 0x1203, (nil), 0x7fff19bea620)
SendMessage (0, 0x1204, (nil), 0x7fff19bea620)
SendMessage (0, 0x1203, 0x1, 0x7fff19bea620)
SendMessage (0, 0x1204, 0x1, 0x7fff19bea620)
SendMessage (0, 0x1203, 0x2, 0x7fff19bea620)
SendMessage (0, 0x1204, 0x2, 0x7fff19bea620)
<enter password to open DB>
* Assertion at class.c:4319, condition `cur_slot == class->vtable_size' not met

Stacktrace:

  at KeePassLib.Utility.MemUtil.Read (System.IO.Stream,int) <0x00064>
  at KeePassLib.Serialization.BinaryReaderEx.ReadBytes (int) <0x0002a>
  at KeePassLib.Serialization.KdbxFile.ReadHeader (KeePassLib.Serialization.BinaryReaderEx) <0x00063>
  at KeePassLib.Serialization.KdbxFile.Load (System.IO.Stream,KeePassLib.Serialization.KdbxFormat,KeePassLib.Interfaces.IStatusLogger) <0x00148>
  at KeePassLib.PwDatabase.Open (KeePassLib.Serialization.IOConnectionInfo,KeePassLib.Keys.CompositeKey,KeePassLib.Interfaces.IStatusLogger) <0x00171>
  at KeePass.Forms.MainForm.OpenDatabaseInternal (KeePassLib.Serialization.IOConnectionInfo,KeePassLib.Keys.CompositeKey) <0x00275>
  at KeePass.Forms.MainForm.OpenDatabase (KeePassLib.Serialization.IOConnectionInfo,KeePassLib.Keys.CompositeKey,bool) <0x006a9>
  at KeePass.Forms.MainForm.OnFormLoad (object,System.EventArgs) <0x02afc>
  at System.Windows.Forms.Form.OnLoad (System.EventArgs) <0x00075>
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs) <0x0007f>
  at System.Windows.Forms.Form.OnCreateControl () <0x00053>
  at System.Windows.Forms.Control.CreateControl () <0x00127>
  at System.Windows.Forms.Control.WmShowWindow (System.Windows.Forms.Message&) <0x00193>
  at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message&) <0x002c7>
  at System.Windows.Forms.ScrollableControl.WndProc (System.Windows.Forms.Message&) <0x00013>
  at System.Windows.Forms.ContainerControl.WndProc (System.Windows.Forms.Message&) <0x0005b>
  at System.Windows.Forms.Form.WndProc (System.Windows.Forms.Message&) <0x0024f>
  at KeePass.Forms.MainForm.WndProc (System.Windows.Forms.Message&) <0x00223>
  at System.Windows.Forms.Control/ControlWindowTarget.OnMessage (System.Windows.Forms.Message&) <0x00024>
  at System.Windows.Forms.Control/ControlNativeWindow.WndProc (System.Windows.Forms.Message&) <0x00036>
  at System.Windows.Forms.NativeWindow.WndProc (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x002f0>
  at System.Windows.Forms.XplatUIX11.SendMessage (intptr,System.Windows.Forms.Msg,intptr,intptr) <0x00313>
  at System.Windows.Forms.XplatUIX11.MapWindow (System.Windows.Forms.Hwnd,System.Windows.Forms.WindowType) <0x001fb>
  at System.Windows.Forms.XplatUIX11.CreateWindow (System.Windows.Forms.CreateParams) <0x00d53>
  at System.Windows.Forms.XplatUI.CreateWindow (System.Windows.Forms.CreateParams) <0x00024>
  at System.Windows.Forms.NativeWindow.CreateHandle (System.Windows.Forms.CreateParams) <0x0003f>
  at System.Windows.Forms.Control.CreateHandle () <0x00069>
  at System.Windows.Forms.Form.CreateHandle () <0x0001b>
  at System.Windows.Forms.Control.CreateControl () <0x00087>
  at System.Windows.Forms.Control.SetVisibleCore (bool) <0x0009f>
  at System.Windows.Forms.Form.SetVisibleCore (bool) <0x002ef>
  at System.Windows.Forms.Control.set_Visible (bool) <0x00032>
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control.set_Visible (bool) <0xffffffff>
  at System.Windows.Forms.Application.RunLoop (bool,System.Windows.Forms.ApplicationContext) <0x002cf>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.ApplicationContext) <0x0005f>
  at System.Windows.Forms.Application.Run (System.Windows.Forms.Form) <0x00033>
  at KeePass.Program.Main (string[]) <0x00cb3>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        mono() [0x493942]
        /lib64/libpthread.so.0() [0x36c1010bf0]
        /lib64/libc.so.6(gsignal+0x35) [0x36c0c37b45]
        /lib64/libc.so.6(abort+0x17b) [0x36c0c38fbb]
        mono() [0x5cae9f]
        mono() [0x5cafc6]
        mono() [0x4f7da8]
        mono() [0x4f8302]
        mono() [0x5023b8]
        mono() [0x496231]
        [0x404f4bba]

Debug info from gdb:

Mono support loaded.
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
[New Thread 0x7faf6e473700 (LWP 8357)]
[New Thread 0x7faf6e4b4700 (LWP 8356)]
[New Thread 0x7faf6e6b5700 (LWP 8355)]
[New Thread 0x7faf74eec700 (LWP 8353)]
[New Thread 0x7faf7626b700 (LWP 8352)]
[New Thread 0x7faf76a6c700 (LWP 8351)]
[New Thread 0x7faf7726d700 (LWP 8350)]
0x00000036c10107ad in waitpid () from /lib64/libpthread.so.0
  Id   Target Id         Frame 
  8    Thread 0x7faf7726d700 (LWP 8350) "mono" 0x00000036c100cdcc in pthread_cond_wait () from /lib64/libpthread.so.0
  7    Thread 0x7faf76a6c700 (LWP 8351) "mono" 0x00000036c100cdcc in pthread_cond_wait () from /lib64/libpthread.so.0
  6    Thread 0x7faf7626b700 (LWP 8352) "mono" 0x00000036c100cdcc in pthread_cond_wait () from /lib64/libpthread.so.0
  5    Thread 0x7faf74eec700 (LWP 8353) "mono" 0x00000036c100ef70 in sem_wait () from /lib64/libpthread.so.0
  4    Thread 0x7faf6e6b5700 (LWP 8355) "mono" 0x00000036c0cdb37d in read () from /lib64/libc.so.6
  3    Thread 0x7faf6e4b4700 (LWP 8356) "mono" 0x00000036c101044d in nanosleep () from /lib64/libpthread.so.0
  2    Thread 0x7faf6e473700 (LWP 8357) "mono" 0x00000036c100f061 in sem_timedwait () from /lib64/libpthread.so.0
* 1    Thread 0x7faf77433740 (LWP 8349) "mono" 0x00000036c10107ad in waitpid () from /lib64/libpthread.so.0

Thread 8 (Thread 0x7faf7726d700 (LWP 8350)):
#0  0x00000036c100cdcc in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00000000005ddbc3 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005d7f0c in GC_help_marker (my_mark_no=17) at mark.c:1116
#3  0x00000000005dc387 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00000036c1008ec6 in start_thread () from /lib64/libpthread.so.0
#5  0x00000036c0ce8b4d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7faf76a6c700 (LWP 8351)):
#0  0x00000036c100cdcc in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00000000005ddbc3 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005d7f0c in GC_help_marker (my_mark_no=17) at mark.c:1116
#3  0x00000000005dc387 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00000036c1008ec6 in start_thread () from /lib64/libpthread.so.0
#5  0x00000036c0ce8b4d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7faf7626b700 (LWP 8352)):
#0  0x00000036c100cdcc in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00000000005ddbc3 in GC_wait_marker () at pthread_support.c:1863
#2  0x00000000005d7f0c in GC_help_marker (my_mark_no=17) at mark.c:1116
#3  0x00000000005dc387 in GC_mark_thread (id=<optimized out>) at pthread_support.c:552
#4  0x00000036c1008ec6 in start_thread () from /lib64/libpthread.so.0
#5  0x00000036c0ce8b4d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7faf74eec700 (LWP 8353)):
#0  0x00000036c100ef70 in sem_wait () from /lib64/libpthread.so.0
#1  0x00000000005c2d88 in mono_sem_wait (sem=0x8ec060, alertable=1) at mono-semaphore.c:113
#2  0x0000000000511e8b in finalizer_thread (unused=<optimized out>) at gc.c:1066
#3  0x0000000000593775 in start_wrapper_internal (data=0x156f0b0) at threads.c:784
#4  start_wrapper (data=0x156f0b0) at threads.c:832
#5  0x00000000005bd992 in thread_start_routine (args=0x1551aa0) at wthreads.c:287
#6  0x00000000005dd9ad in GC_start_routine (arg=<optimized out>) at pthread_support.c:1468
#7  0x00000036c1008ec6 in start_thread () from /lib64/libpthread.so.0
#8  0x00000036c0ce8b4d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7faf6e6b5700 (LWP 8355)):
#0  0x00000036c0cdb37d in read () from /lib64/libc.so.6
#1  0x00000000403d8ed1 in ?? ()
#2  0x00007faf68000c20 in ?? ()
#3  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7faf6e4b4700 (LWP 8356)):
#0  0x00000036c101044d in nanosleep () from /lib64/libpthread.so.0
#1  0x00000000005bcd16 in SleepEx (ms=<optimized out>, alertable=1) at wthreads.c:1027
#2  0x000000000058a5d8 in monitor_thread (unused=<optimized out>) at threadpool.c:777
#3  0x0000000000593775 in start_wrapper_internal (data=0x1dd3210) at threads.c:784
#4  start_wrapper (data=0x1dd3210) at threads.c:832
#5  0x00000000005bd992 in thread_start_routine (args=0x15520e0) at wthreads.c:287
#6  0x00000000005dd9ad in GC_start_routine (arg=<optimized out>) at pthread_support.c:1468
#7  0x00000036c1008ec6 in start_thread () from /lib64/libpthread.so.0
#8  0x00000036c0ce8b4d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7faf6e473700 (LWP 8357)):
#0  0x00000036c100f061 in sem_timedwait () from /lib64/libpthread.so.0
#1  0x00000000005c2e7b in mono_sem_timedwait (sem=0x8ecd68, timeout_ms=<optimized out>, alertable=1) at mono-semaphore.c:76
#2  0x000000000058ca8f in async_invoke_thread (data=0x0) at threadpool.c:1485
#3  0x0000000000593775 in start_wrapper_internal (data=0x1d25b80) at threads.c:784
#4  start_wrapper (data=0x1d25b80) at threads.c:832
#5  0x00000000005bd992 in thread_start_routine (args=0x15521a8) at wthreads.c:287
#6  0x00000000005dd9ad in GC_start_routine (arg=<optimized out>) at pthread_support.c:1468
#7  0x00000036c1008ec6 in start_thread () from /lib64/libpthread.so.0
#8  0x00000036c0ce8b4d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7faf77433740 (LWP 8349)):
#0  0x00000036c10107ad in waitpid () from /lib64/libpthread.so.0
#1  0x0000000000493a91 in mono_handle_native_sigsegv (signal=<optimized out>, ctx=<optimized out>) at mini-exceptions.c:2192
#2  <signal handler called>
#3  0x00000036c0c37b45 in raise () from /lib64/libc.so.6
#4  0x00000036c0c38fbb in abort () from /lib64/libc.so.6
#5  0x00000000005cae9f in monoeg_g_logv (log_domain=<optimized out>, log_level=<optimized out>, format=<optimized out>, args=<optimized out>) at goutput.c:129
#6  monoeg_g_logv (log_domain=<optimized out>, log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=<optimized out>) at goutput.c:113
#7  0x00000000005cafc6 in monoeg_assertion_message (format=<optimized out>) at goutput.c:153
#8  0x00000000004f7da8 in mono_class_setup_vtable_general (class=<optimized out>, overrides=<optimized out>, onum=<optimized out>, in_setup=<optimized out>) at class.c:4319
#9  0x00000000004f8302 in mono_class_setup_vtable_full (class="KeePassLib.Cryptography.HashingStreamEx", in_setup=0x1f9c160) at class.c:3475
#10 0x00000000005023b8 in mono_class_get_vtable_entry (class="KeePassLib.Cryptography.HashingStreamEx", offset=17) at class.c:2109
#11 0x0000000000496231 in mono_vcall_trampoline (regs=0x7fff19bea4a8, code=0x41bce625 "H\213\330\205\300t\vD\003\343D+\373E\205\377\177\331IcE\030D;\340t)\277\260\307N\001I\213\364ff\220\350\020y\262\377H\213\350I\213\375H\213\365I\213\324ff\220\350\031\276,\377H\213\305\353\003I\213\305H\213\034$H\213l$\bL\213d$\020L\213l$\030L\213t$ L\213|$(H\203\304\070ΓΏ0\310V\001\276Y(", slot=17, tramp=<optimized out>) at mini-trampolines.c:660
#12 0x00000000404f4bba in ?? ()
#13 0x00007fff19bea538 in ?? ()
#14 0x00007faf6ef71c98 in ?? ()
#15 0x00007fff19bea590 in ?? ()
#16 0x0000000000591703 in mono_thread_interruption_checkpoint_request (bypass_abort_protection=431924560) at threads.c:4185
#17 0x00000000404f3177 in ?? ()
#18 0x00007fff19bea5c0 in ?? ()
#19 0x0000000000591703 in mono_thread_interruption_checkpoint_request (bypass_abort_protection=431924624) at threads.c:4185
#20 0x0000000000591703 in mono_thread_interruption_checkpoint_request (bypass_abort_protection=431924704) at threads.c:4185
#21 0x00000000404f3177 in ?? ()
#22 0x00007fff19bea610 in ?? ()
#23 0x0000000041bce200 in ?? ()
#24 0x00007faf6ef71c98 in ?? ()
#25 0x000000006ef71c98 in ?? ()
#26 0x00007fff19bea610 in ?? ()
#27 0x00007faf6ef71c98 in ?? ()
#28 0x00007fff19bea640 in ?? ()
#29 0x0000000000591703 in mono_thread_interruption_checkpoint_request (bypass_abort_protection=431924704) at threads.c:4185
#30 0x00000000404f3177 in ?? ()
#31 0x0000000000000000 in ?? ()

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Aborted
Comment 4 Alex Xu (Hello71) 2012-09-24 19:59:58 UTC
Created attachment 324874 [details]
`emerge -O keepass`
Comment 5 Alex Xu (Hello71) 2012-09-24 20:01:26 UTC
It appears that my prediction was wrong; even with FEATURES="nostrip", the error persists.
Comment 6 Alessandro Di Federico 2012-09-25 00:19:57 UTC
Looks like the AOT compiler behaves differently depending on the supported version of the framework (in particular if 4.0 is supported). We need to put the KeePass.exe.config file in the build directory, so the AOT compiler can see this information in time.

Attached you can find the patch. Stripping doesn't seem to be a problem.
Comment 7 Alessandro Di Federico 2012-09-25 00:22:49 UTC
Created attachment 324896 [details, diff]
Patch to copy the KeePass.exe.config file in the build ouput directory, so the AOT compiler has all the information needed to produce a correct output.
Comment 8 Alex Xu (Hello71) 2012-09-25 00:33:26 UTC
Seems to work fine with an admittedly improper in-place patching of the ebuild.

Thanks!
Comment 9 Michael Palimaka (kensington) gentoo-dev 2012-09-26 13:35:53 UTC
Thanks, fixed in CVS.

+  26 Sep 2012; Michael Palimaka <kensington@gentoo.org> +keepass-2.20-r1.ebuild:
+  Fix crashes when AOT USE flag is enabled, thanks to Alessandro Di Federico
+  <ale@clearmind.me>. Closes bug #435860.