Bug 17987 - * Assertion at mini.c:4167, condition `code' not met
Summary: * Assertion at mini.c:4167, condition `code' not met
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-02-25 07:57 UTC by Alexandre Faria
Modified: 2014-02-27 13:34 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 FIXED

Description Alexandre Faria 2014-02-25 07:57:49 UTC
Mono crashes consistently with this sample:

using System;
using System.Threading;
using System.Threading.Tasks;

public class Example
{
  public static void Main()
  {
    Parallel.For(0, 10000, i =>
    {
      System.Console.WriteLine("\n\nIteration " + i);
      AppDomain ad = AppDomain.CreateDomain("ChildDomain");
      AppDomain.Unload(ad);
    });
  }
}

ubuntu 13.10
Mono JIT compiler version 3.4.0 (master/d28e7b7 Ter Fev 25 10:40:51 WET 2014)
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:          yes(3.4svn-mono-mono/e656cac)
	GC:            sgen


* Assertion at mini.c:4167, condition `code' not met

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) <0xffffffff>
  at System.Reflection.MonoCMethod.InternalInvoke (object,object[]) <0x0003f>
  at System.Reflection.MonoCMethod.DoInvoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x00113>
  at System.Reflection.MonoCMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x0008b>
  at System.Reflection.MethodBase.Invoke (object,object[]) <0x00032>
  at System.Runtime.Serialization.ObjectRecord.LoadData (System.Runtime.Serialization.ObjectManager,System.Runtime.Serialization.ISurrogateSelector,System.Runtime.Serialization.StreamingContext) <0x0031b>
  at System.Runtime.Serialization.ObjectManager.DoFixups () <0x00163>
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadNextObject (System.IO.BinaryReader) <0x00055>
  at System.Runtime.Serialization.Formatters.Binary.ObjectReader.ReadObjectGraph (System.Runtime.Serialization.Formatters.Binary.BinaryElement,System.IO.BinaryReader,bool,object&,System.Runtime.Remoting.Messaging.Header[]&) <0x00113>
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.NoCheckDeserialize (System.IO.Stream,System.Runtime.Remoting.Messaging.HeaderHandler) <0x00153>
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize (System.IO.Stream) <0x0001f>
  at System.Runtime.Remoting.Channels.CADSerializer.DeserializeObject (System.IO.MemoryStream) <0x00097>
  at System.Runtime.Remoting.Messaging.CADMethodCallMessage.GetArguments () <0x00063>
  at System.Runtime.Remoting.Messaging.MethodCall..ctor (System.Runtime.Remoting.Messaging.CADMethodCallMessage) <0x00073>
  at System.AppDomain.ProcessMessageInDomain (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&) <0x0008f>
  at (wrapper remoting-invoke-with-check) System.AppDomain.ProcessMessageInDomain (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&) <0xffffffff>
  at System.Runtime.Remoting.Channels.CrossAppDomainSink.ProcessMessageInDomain (byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage) <0x0005f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_CrossAppDomainSink/ProcessMessageRes_object_object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0xffffffff>
  at System.AppDomain.InvokeInDomainByID (int,System.Reflection.MethodInfo,object,object[]) <0x0009b>
  at System.Runtime.Remoting.Channels.CrossAppDomainSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x00157>
  at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke (System.Runtime.Remoting.Messaging.IMessage) <0x00436>
  at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (System.Runtime.Remoting.Proxies.RealProxy,System.Runtime.Remoting.Messaging.IMessage,System.Exception&,object[]&) <0x0050c>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_object_object_object_intptr&_intptr& (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) object.__icall_wrapper_mono_store_remote_field_new (object,intptr,intptr,object) <0xffffffff>
* Assertion at mini.c:4167, condition `code' not met
  at (wrapper stfld-remote) object.__mono_store_remote_field_new_wrapper (object,intptr,intptr,object) <0xffffffff>

  at System.AppDomain.CreateDomain (string,System.Security.Policy.Evidence,System.AppDomainSetup) <0x0045b>
Comment 1 Zoltan Varga 2014-02-25 17:12:41 UTC
Fixed in 2fed14d6ef5e0f0f5fe71f0f5a18a1146cb1113d. The test itself still fails at the end but that is probably a different problem.
Comment 2 Alexandre Faria 2014-02-27 12:50:33 UTC
I can't reproduce this one any-more.
I moved to testing the 100k version, but I suspect that one will fail for the same reason of the serial version.
Is this still failing for you, or its working now and it can be closed?
Comment 3 Zoltan Varga 2014-02-27 13:34:35 UTC
-> FIXED.