Bug 13767 - Assertion: should not be reached at class.c:6253
Summary: Assertion: should not be reached at class.c:6253
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: Reflection ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Zoltan Varga
URL:
Depends on:
Blocks:
 
Reported: 2013-08-05 19:28 UTC by DesDesDes
Modified: 2013-08-20 18:36 UTC (History)
4 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 DesDesDes 2013-08-05 19:28:54 UTC
Run the following unit test:

    [TestFixture]
    public class MyTests
    {
      public enum MyEnum
      {
        MyEnumValue,
      }

      [Test]
      [TestCase("Demo", new[] { MyEnum.MyEnumValue })]
      public void CheckPeriodWithTestCaseData(string attributeName, MyEnum[] options)
      {
           
      }
    }

The test will run perfectly on the microsoft.net framework. On mac osx 10.7.5 running mono 3.2.1 it fails with the exception below.

NUnit-Console version 2.6.1.12217
Copyright (C) 2002-2012 Charlie Poole.
Copyright (C) 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov.
Copyright (C) 2000-2002 Philip Craig.
All Rights Reserved.

Runtime Environment - 
   OS Version: Unix 11.4.2.0
  CLR Version: 2.0.50727.1433 ( Mono 3.5 ( 3.2.1 ((no/f3f789e Tue Jul 30 00:31:23 EDT 2013) ) )

ProcessModel: Default    DomainUsage: Single
Execution Runtime: mono-4.0
mono_class_from_mono_type: implement me 0x55

* Assertion: should not be reached at class.c:6253

Stacktrace:

  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesInternal (System.Reflection.ICustomAttributeProvider,System.Type,bool) <0xffffffff>
  at System.MonoCustomAttrs.GetCustomAttributesBase (System.Reflection.ICustomAttributeProvider,System.Type,bool) <0x0004b>
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider,System.Type,bool) <0x00053>
  at System.MonoCustomAttrs.GetCustomAttributes (System.Reflection.ICustomAttributeProvider,bool) <0x0008b>
  at System.Reflection.MonoMethod.GetCustomAttributes (bool) <0x00017>
  at NUnit.Core.Reflect.GetAttributes (System.Reflection.ICustomAttributeProvider,bool) <0x00020>
  at NUnit.Core.Reflect.HasAttribute (System.Reflection.ICustomAttributeProvider,string,bool) <0x0001b>
  at NUnit.Core.Reflect.GetMethodsWithAttribute (System.Type,string,bool) <0x00083>
  at NUnit.Core.NUnitTestFixture..ctor (System.Type,object[]) <0x00033>
  at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildSingleFixture (System.Type,System.Attribute) <0x00363>
  at NUnit.Core.Builders.NUnitTestFixtureBuilder.BuildFrom (System.Type) <0x000ef>
  at NUnit.Core.Extensibility.SuiteBuilderCollection.BuildFrom (System.Type) <0x00129>
  at NUnit.Core.TestFixtureBuilder.BuildFrom (System.Type) <0x00023>
  at NUnit.Core.Builders.TestAssemblyBuilder.GetFixtures (System.Reflection.Assembly,string) <0x001bb>
  at NUnit.Core.Builders.TestAssemblyBuilder.Build (string,bool) <0x000c7>
  at NUnit.Core.Builders.TestAssemblyBuilder.Build (string,string,bool) <0x0006b>
  at NUnit.Core.TestSuiteBuilder.BuildSingleAssembly (NUnit.Core.TestPackage) <0x000ab>
  at NUnit.Core.TestSuiteBuilder.Build (NUnit.Core.TestPackage) <0x000cb>
  at NUnit.Core.SimpleTestRunner.Load (NUnit.Core.TestPackage) <0x000f7>
  at NUnit.Core.ProxyTestRunner.Load (NUnit.Core.TestPackage) <0x0001c>
  at NUnit.Core.ProxyTestRunner.Load (NUnit.Core.TestPackage) <0x0001c>
  at NUnit.Core.RemoteTestRunner.Load (NUnit.Core.TestPackage) <0x001cf>
  at (wrapper xdomain-dispatch) NUnit.Core.RemoteTestRunner.Load (object,byte[]&,byte[]&) <0xffffffff>
  at (wrapper xdomain-invoke) NUnit.Core.RemoteTestRunner.Load (NUnit.Core.TestPackage) <0xffffffff>
  at NUnit.Util.TestDomain.Load (NUnit.Core.TestPackage) <0x0026f>
  at NUnit.Core.ProxyTestRunner.Load (NUnit.Core.TestPackage) <0x0001c>
  at NUnit.Util.RemoteTestAgent/AgentRunner.Load (NUnit.Core.TestPackage) <0x0003f>
  at (wrapper runtime-invoke) <Module>.runtime_invoke_bool__this___object (object,intptr,intptr,intptr) <0xffffffff>
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Runtime.Remoting.RemotingServices.InternalExecute (System.Reflection.MethodBase,object,object[],object[]&) <0xffffffff>
  at System.Runtime.Remoting.RemotingServices.InternalExecuteMessage (System.MarshalByRefObject,System.Runtime.Remoting.Messaging.IMethodCallMessage) <0x001ff>
  at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x000c7>
  at System.Runtime.Remoting.Messaging.ServerObjectTerminatorSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x00065>
  at System.Runtime.Remoting.Lifetime.LeaseSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x0002d>
  at System.Runtime.Remoting.ClientActivatedIdentity.SyncObjectProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x00096>
  at System.Runtime.Remoting.Messaging.ServerContextTerminatorSink.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x00158>
  at System.Runtime.Remoting.Contexts.CrossContextChannel.SyncProcessMessage (System.Runtime.Remoting.Messaging.IMessage) <0x000d4>
  at System.Runtime.Remoting.Channels.ChannelServices.SyncDispatchMessage (System.Runtime.Remoting.Messaging.IMessage) <0x0003f>
  at System.Runtime.Remoting.Channels.ChannelServices.DispatchMessage (System.Runtime.Remoting.Channels.IServerChannelSinkStack,System.Runtime.Remoting.Messaging.IMessage,System.Runtime.Remoting.Messaging.IMessage&) <0x0001f>
  at System.Runtime.Remoting.Channels.ServerDispatchSink.ProcessMessage (System.Runtime.Remoting.Channels.IServerChannelSinkStack,System.Runtime.Remoting.Messaging.IMessage,System.Runtime.Remoting.Channels.ITransportHeaders,System.IO.Stream,System.Runtime.Remoting.Messaging.IMessage&,System.Runtime.Remoting.Channels.ITransportHeaders&,System.IO.Stream&) <0x0002b>
  at System.Runtime.Remoting.Channels.BinaryServerFormatterSink.ProcessMessage (System.Runtime.Remoting.Channels.IServerChannelSinkStack,System.Runtime.Remoting.Messaging.IMessage,System.Runtime.Remoting.Channels.ITransportHeaders,System.IO.Stream,System.Runtime.Remoting.Messaging.IMessage&,System.Runtime.Remoting.Channels.ITransportHeaders&,System.IO.Stream&) <0x004cf>
  at System.Runtime.Remoting.Channels.Tcp.TcpServerTransportSink.InternalProcessMessage (System.Runtime.Remoting.Channels.Tcp.ClientConnection,System.IO.Stream) <0x00187>
  at System.Runtime.Remoting.Channels.Tcp.ClientConnection.ProcessMessages () <0x000ff>
  at System.Runtime.Remoting.Channels.RemotingThreadPool.PoolThread () <0x001cb>
  at System.Threading.Thread.StartInternal () <0x00057>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

	0   mono                                0x0018c4f4 mono_handle_native_sigsegv + 292
	1   mono                                0x001e1cbd sigabrt_signal_handler + 109
	2   libsystem_c.dylib                   0x98a6b59b _sigtramp + 43
	3   ???                                 0xffffffff 0x0 + 4294967295
	4   libsystem_c.dylib                   0x98a06bdd abort + 167
	5   mono                                0x0033344c monoeg_g_logv + 188
	6   mono                                0x0033347b monoeg_assertion_message + 43
	7   mono                                0x001ee76d mono_class_from_mono_type + 749
	8   mono                                0x002cee2f load_cattr_value + 751
	9   mono                                0x002cf541 mono_custom_attrs_construct_by_type + 545
	10  mono                                0x002cfa17 mono_reflection_get_custom_attrs_by_type + 55
	11  mono                                0x00212103 custom_attrs_get_by_type + 99
	12  ???                                 0x01d23120 0x0 + 30552352
	13  ???                                 0x01d2304c 0x0 + 30552140
	14  ???                                 0x01cde934 0x0 + 30271796
	15  ???                                 0x01d24484 0x0 + 30557316
	16  ???                                 0x01d289b0 0x0 + 30575024
	17  ???                                 0x01d242d9 0x0 + 30556889
	18  ???                                 0x01d24214 0x0 + 30556692
	19  ???                                 0x01d2884c 0x0 + 30574668
	20  ???                                 0x01d27a04 0x0 + 30571012
	21  ???                                 0x01d272bc 0x0 + 30569148
	22  ???                                 0x01d24f90 0x0 + 30560144
	23  ???                                 0x01d24d52 0x0 + 30559570
	24  ???                                 0x01d24be4 0x0 + 30559204
	25  ???                                 0x01d2367c 0x0 + 30553724
	26  ???                                 0x01d192d0 0x0 + 30511824
	27  ???                                 0x01d19014 0x0 + 30511124
	28  ???                                 0x01d18eac 0x0 + 30510764
	29  ???                                 0x01d15304 0x0 + 30495492
	30  ???                                 0x01d15158 0x0 + 30495064
	31  ???                                 0x01d15005 0x0 + 30494725
	32  ???                                 0x01d15005 0x0 + 30494725
	33  ???                                 0x01d12010 0x0 + 30482448
	34  ???                                 0x01d11894 0x0 + 30480532
	35  ???                                 0x01ce813b 0x0 + 30310715
	36  ???                                 0x01c6dbb0 0x0 + 29809584
	37  ???                                 0x01c6d90d 0x0 + 29808909
	38  ???                                 0x01c6d528 0x0 + 29807912
	39  ???                                 0x01c6d5f5 0x0 + 29808117
	40  mono                                0x000f24a5 mono_jit_runtime_invoke + 741
	41  mono                                0x002a96ce mono_runtime_invoke + 126
	42  mono                                0x002b068c mono_runtime_invoke_array + 1596
	43  mono                                0x002197b5 ves_icall_InternalExecute + 629
	44  ???                                 0x01c5343c 0x0 + 29701180
	45  ???                                 0x01c52f00 0x0 + 29699840
	46  ???                                 0x01c52870 0x0 + 29698160
	47  ???                                 0x01c52706 0x0 + 29697798
	48  ???                                 0x01c52576 0x0 + 29697398
	49  ???                                 0x01c52287 0x0 + 29696647
	50  ???                                 0x01c52189 0x0 + 29696393
	51  ???                                 0x01c518b5 0x0 + 29694133
	52  ???                                 0x01c51358 0x0 + 29692760
	53  ???                                 0x01c511e0 0x0 + 29692384
	54  ???                                 0x01c511ac 0x0 + 29692332
	55  ???                                 0x01c4ddd8 0x0 + 29679064
	56  ???                                 0x01c4c8d0 0x0 + 29673680
	57  ???                                 0x01c4c620 0x0 + 29672992
	58  ???                                 0x01c4c4ac 0x0 + 29672620
	59  ???                                 0x01c17330 0x0 + 29455152
	60  ???                                 0x005b2105 0x0 + 5972229
	61  mono                                0x000f24a5 mono_jit_runtime_invoke + 741
	62  mono                                0x002a96ce mono_runtime_invoke + 126
	63  mono                                0x002a983c mono_runtime_delegate_invoke + 140
	64  mono                                0x00279e12 start_wrapper + 514
	65  mono                                0x0031ef1a thread_start_routine + 154
	66  mono                                0x0032f201 inner_start_thread + 65
	67  libsystem_c.dylib                   0x98a13ed9 _pthread_start + 335
	68  libsystem_c.dylib                   0x98a176de thread_start + 34

Debug info from gdb:


=================================================================
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.
=================================================================

Unhandled Exception:
System.Runtime.Remoting.RemotingException: Connection refused

Server stack trace: 
  at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.CreateConnection () [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.GetConnection () [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.GetConnection (System.String host, Int32 port) [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage (IMessage msg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (IMessage msg) [0x00000] in <filename unknown>:0 

Exception rethrown at [0]: 

  at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.CreateConnection () [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.GetConnection () [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.GetConnection (System.String host, Int32 port) [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage (IMessage msg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000] in <filename unknown>:0 
  at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (IMessage msg) [0x00000] in <filename unknown>:0
Comment 1 Marek Safar 2013-08-06 02:40:36 UTC
Runtime issue, simple repro

using System;

class TestCaseAttribute : Attribute
{
	public TestCaseAttribute (params object[] args)
	{

	}
}

    public class MyTests
    {
      public enum MyEnum
      {
        MyEnumValue,
      }

      [TestCase("Demo", new[] { MyEnum.MyEnumValue })]
      public void CheckPeriodWithTestCaseData(string attributeName, MyEnum[] options)
      {

      }

      public static void Main ()
      {
      	var m = typeof (MyTests).GetMethods ()[0];
      	var attr = m.GetCustomAttributes (false);
		Console.WriteLine (attr.Length);
      	return;
      }
    }
Comment 2 Rodrigo Kumpera 2013-08-20 17:23:08 UTC
Working on it.
Comment 3 Rodrigo Kumpera 2013-08-20 18:36:13 UTC
Fixed on master.