Bug 55511 - Crash in mini-amd64.c
Summary: Crash in mini-amd64.c
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Runtime
Classification: Mono
Component: Remoting ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2017-04-24 11:32 UTC by andy
Modified: 2017-04-25 16:03 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description andy 2017-04-24 11:32:18 UTC
Hi I have come across this issue:


For context, this occurs when I attempt to run the monocov profiler in mono v4.6.2 on linux ubuntu 17.04. Although I also get a similar crash with the latest version of mono.

i.e.

mono --profile=monocov ./packages/NUnit.ConsoleRunner.3.6.1/tools/nunit3-console.exe --inprocess MyTests.dll


Note that if I remove the --inprocess then the crash does not occur. Similarly if I remove --profile=monocov it does not occur. 

Also I notice a similar issue https://bugzilla.xamarin.com/show_bug.cgi?id=17944

Despite monocov being legacy, I still should expect the mono runtime to crash right?

Ive classified this bug with remoting as this appears in the call stack.


My crash output is as follows :

mono: mini-amd64.c:207: amd64_patch: Assertion `0' failed.
Stacktrace:

  at <unknown> <0xffffffff>
  at string.Equals (string,string) <0x00232>
  at string.op_Equality (string,string) <0x0006f>
  at System.Globalization.TextInfo.get_IsAsciiCasingSameAsInvariant () <0x0019e>
  at System.Globalization.TextInfo.ToUpper (char) <0x000b5>
  at char.ToUpper (char,System.Globalization.CultureInfo) <0x000bf>
  at char.ToUpperInvariant (char) <0x00072>
  at System.Globalization.TextInfo.GetInvariantCaseInsensitiveHashCode (string) <0x00283>
  at System.Globalization.TextInfo.GetCaseInsensitiveHashCode (string,bool,long) <0x00116>
  at System.Globalization.TextInfo.GetHashCodeOrdinalIgnoreCase (string,bool,long) <0x000ae>
  at System.Globalization.TextInfo.GetHashCodeOrdinalIgnoreCase (string) <0x0008b>
  at System.OrdinalComparer.GetHashCode (string) <0x000e4>
  at System.Collections.Generic.Dictionary`2<TKey_REF, TValue_REF>.Insert (TKey_REF,TValue_REF,bool) <0x001eb>
  at System.Collections.Generic.Dictionary`2<TKey_REF, TValue_REF>.Add (TKey_REF,TValue_REF) <0x000a0>
  at System.Security.Cryptography.CryptoConfig.Initialize () <0x00122>
  at System.Security.Cryptography.CryptoConfig.CreateFromName (string,object[]) <0x001a2>
  at System.Security.Cryptography.CryptoConfig.CreateFromName (string) <0x00067>
  at System.Security.Cryptography.RandomNumberGenerator.Create (string) <0x00056>
  at System.Security.Cryptography.RandomNumberGenerator.Create () <0x00056>
  at System.Guid.NewGuid () <0x001a5>
  at System.Runtime.Remoting.RemotingServices.NewUri () <0x0019d>
  at System.Runtime.Remoting.RemotingServices.Marshal (System.MarshalByRefObject,string,System.Type) <0x0085b>
  at System.AppDomain.GetMarshalledDomainObjRef () <0x0008a>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_object__this__ (object,intptr,intptr,intptr) <0x00377>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0x00122>
  at System.AppDomain.InvokeInDomain (System.AppDomain,System.Reflection.MethodInfo,object,object[]) <0x0009e>
  at System.Runtime.Remoting.RemotingServices.GetDomainProxy (System.AppDomain) <0x00055>
  at System.AppDomain.CreateDomain (string,System.Security.Policy.Evidence,System.AppDomainSetup) <0x001e1>
  at NUnit.Engine.Services.DomainManager.CreateDomain (NUnit.Engine.TestPackage) <0x00741>
  at NUnit.Engine.Runners.TestDomainRunner.LoadPackage () <0x0009f>
  at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded () <0x000ba>
  at NUnit.Engine.Runners.DirectTestRunner.RunTests (NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter) <0x0008b>
  at NUnit.Engine.Runners.AbstractTestRunner.Run (NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter) <0x00089>
  at NUnit.Engine.Runners.MasterTestRunner.RunTests (NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter) <0x00640>
  at NUnit.Engine.Runners.MasterTestRunner.Run (NUnit.Engine.ITestEventListener,NUnit.Engine.TestFilter) <0x00097>
  at NUnit.ConsoleRunner.ConsoleRunner.RunTests (NUnit.Engine.TestPackage,NUnit.Engine.TestFilter) <0x00a3e>
  at NUnit.ConsoleRunner.ConsoleRunner.Execute () <0x006ef>
  at NUnit.ConsoleRunner.Program.Main (string[]) <0x011c7>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object (object,intptr,intptr,intptr) <0x003d1>

Native stacktrace:

	mono(+0xc8514) [0x556c63845514]
	/lib/x86_64-linux-gnu/libpthread.so.0(+0x11670) [0x7ff94bd4e670]
	/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x9f) [0x7ff94b79477f]
	/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7ff94b79637a]
	/lib/x86_64-linux-gnu/libc.so.6(+0x2db47) [0x7ff94b78cb47]
	/lib/x86_64-linux-gnu/libc.so.6(+0x2dbf2) [0x7ff94b78cbf2]
	mono(+0xfaa0d) [0x556c63877a0d]
	mono(+0x12b3d9) [0x556c638a83d9]
	mono(+0x12c32b) [0x556c638a932b]
	mono(+0x12df39) [0x556c638aaf39]
	mono(+0x3c170) [0x556c637b9170]
	mono(+0xc9ef6) [0x556c63846ef6]
	mono(+0xca83c) [0x556c6384783c]
	[0x40568298]

Debug info from gdb:

[New LWP 1675]
[New LWP 1676]
[New LWP 1677]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007ff94bd4e08a in __waitpid (pid=1678, stat_loc=0x7ffc652687ec, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
29	../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory.
  Id   Target Id         Frame 
* 1    Thread 0x7ff94c868740 (LWP 1674) "Main" 0x00007ff94bd4e08a in __waitpid (pid=1678, stat_loc=0x7ffc652687ec, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
  2    Thread 0x7ff94afff700 (LWP 1675) "SGen worker" pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
  3    Thread 0x7ff947ec6700 (LWP 1676) "Finalizer" 0x00007ff94bd4ca06 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x556c63d29640) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
  4    Thread 0x7ff947097700 (LWP 1677) "Main" 0x00007ff94bd4d93d in accept () at ../sysdeps/unix/syscall-template.S:84

Thread 4 (Thread 0x7ff947097700 (LWP 1677)):
#0  0x00007ff94bd4d93d in accept () at ../sysdeps/unix/syscall-template.S:84
#1  0x0000556c639e46df in ?? ()
#2  0x0000556c6392d806 in ?? ()
#3  0x0000000040a2089b in ?? ()
#4  0x00007ff94b113170 in ?? ()
#5  0x00007ff94b113380 in ?? ()
#6  0x00007ff94b113100 in ?? ()
#7  0x00007ff94b113240 in ?? ()
#8  0x00007ff94b112a98 in ?? ()
#9  0x00007ff938001950 in ?? ()
#10 0x00007ff947096650 in ?? ()
#11 0x00007ff947096750 in ?? ()
#12 0x00007ff9470966b0 in ?? ()
#13 0x0000000040a1f48c in ?? ()
#14 0x0000556c64370e60 in ?? ()
#15 0x0000556c64370e60 in ?? ()
#16 0x0000000000000001 in ?? ()
#17 0x00007ff947096770 in ?? ()
#18 0x00007ff94b112bc8 in ?? ()
#19 0x0000556c64c93a58 in ?? ()
#20 0x0000000040a1f134 in ?? ()
#21 0x0000556c64b3c130 in ?? ()
#22 0xffffffffffffffff in ?? ()
#23 0x0000000040a1f3b0 in ?? ()
#24 0x00007ff947096860 in ?? ()
#25 0x0000000040a1ed80 in ?? ()
#26 0x00007ff94b113100 in ?? ()
#27 0x00007ff94b09d7a0 in ?? ()
#28 0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7ff947ec6700 (LWP 1676)):
#0  0x00007ff94bd4ca06 in futex_abstimed_wait_cancelable (private=0, abstime=0x0, expected=0, futex_word=0x556c63d29640) at ../sysdeps/unix/sysv/linux/futex-internal.h:205
#1  do_futex_wait (sem=sem@entry=0x556c63d29640, abstime=0x0) at sem_waitcommon.c:111
#2  0x00007ff94bd4cab4 in __new_sem_wait_slow (sem=0x556c63d29640, abstime=0x0) at sem_waitcommon.c:181
#3  0x00007ff94bd4cb5a in __new_sem_wait (sem=<optimised out>) at sem_wait.c:29
#4  0x0000556c63961dc9 in ?? ()
#5  0x0000556c6393fbe1 in ?? ()
#6  0x0000556c639ff14a in ?? ()
#7  0x00007ff94bd446da in start_thread (arg=0x7ff947ec6700) at pthread_create.c:456
#8  0x00007ff94b86717f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

Thread 2 (Thread 0x7ff94afff700 (LWP 1675)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x0000556c639cd863 in ?? ()
#2  0x00007ff94bd446da in start_thread (arg=0x7ff94afff700) at pthread_create.c:456
#3  0x00007ff94b86717f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105

Thread 1 (Thread 0x7ff94c868740 (LWP 1674)):
#0  0x00007ff94bd4e08a in __waitpid (pid=1678, stat_loc=0x7ffc652687ec, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x0000556c638455f0 in ?? ()
#2  <signal handler called>
#3  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:58
#4  0x00007ff94b79637a in __GI_abort () at abort.c:89
#5  0x00007ff94b78cb47 in __assert_fail_base (fmt=<optimised out>, assertion=assertion@entry=0x556c63aa05bb "0", file=file@entry=0x556c63a24d82 "mini-amd64.c", line=line@entry=207, function=function@entry=0x556c63a269b0 "amd64_patch") at assert.c:92
#6  0x00007ff94b78cbf2 in __GI___assert_fail (assertion=0x556c63aa05bb "0", file=0x556c63a24d82 "mini-amd64.c", line=207, function=0x556c63a269b0 "amd64_patch") at assert.c:101
#7  0x0000556c63877a0d in ?? ()
#8  0x0000556c638a83d9 in ?? ()
#9  0x0000556c638a932b in ?? ()
#10 0x0000556c638aaf39 in ?? ()
#11 0x0000556c637b9170 in ?? ()
#12 0x0000556c63846ef6 in ?? ()
#13 0x0000556c6384783c in ?? ()
#14 0x0000000040568298 in ?? ()
#15 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 (core dumped)
Comment 1 Zoltan Varga 2017-04-24 20:16:42 UTC
monocov is not supported anymore, its not longer part of recent mono releases.
Comment 2 andy 2017-04-25 10:10:49 UTC
Thanks Zoltan, this is what I feared. 

Do you know the last version that supported monocov?

Is there a replacement coverage tool?
Comment 3 Zoltan Varga 2017-04-25 16:03:14 UTC
The mono logging profiler has a coverage option, i.e. run with --profile=log:coverage, then use the 'mprof-report' tool on the output.mlpd file. Not sure which functionality that has.