Bug 321622 (MONO78906) - Runtime crashes when working with an array cast to ICollection<>
Summary: Runtime crashes when working with an array cast to ICollection<>
Status: RESOLVED MOVED
Alias: MONO78906
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Blocker
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-20 14:24 UTC by Ladislav Prosek
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:04:11 UTC


---- Reported by ladislav.prosek@matfyz.cz 2006-07-20 07:24:24 MST ----

Description of Problem:
There seems to be a problem related to array covariance and their support
of the ICollection<> interface.

Steps to reproduce the problem:
	class A
	{ }

	class B : A
	{ }

	class Program
	{
		static void Main(string[] args)
		{
			B[] array = new B[0];

			ICollection<A> collection = array;
			IEnumerator<A> enumerator = collection.GetEnumerator();
		}
	}

Actual Results:
System.NullReferenceException is thrown inside GetEnumerator. Sometimes
similar setups yield even this:

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

Expected Results:
It should work. As it does in CLR.

How often does this happen? 
Always.



---- Additional Comments From vargaz@gmail.com 2006-08-15 15:54:44 MST ----



*** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO78847 ***



---- Additional Comments From martin@ximian.com 2006-09-01 13:49:07 MST ----

This is handled in gtest-284.cs


Unknown operating system unknown. Setting to default OS "Other".
This bug was marked DUPLICATE in the database it was moved from.
    Changing resolution to "MOVED"