Bug 316835 (MONO71110) - [PATCH] AppDomain.Evidence call crashes.
Summary: [PATCH] AppDomain.Evidence call crashes.
Status: RESOLVED FIXED
Alias: MONO71110
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Sebastien Pouliot
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-09 01:44 UTC by Miguel de Icaza
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
AppDomain.diff (1.19 KB, patch)
2005-01-09 02:45 UTC, Thomas Wiest
Details | Diff
metadata.diff (2.22 KB, patch)
2005-01-09 02:48 UTC, Thomas Wiest
Details | Diff

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


---- Reported by miguel@ximian.com 2005-01-08 18:44:33 MST ----

Calling AppDomain.Evidence crashes on a newly created AppDomain, the
following program should return 0, currently crashes:

using System;

class D {
	public static int Main ()
	{
		AppDomain ad;
		
			ad = AppDomain.CreateDomain ("CreateDomain_String");
			if (ad == null)
				return 1;
			if (ad.Evidence == null)
				return 2;
			return 0;
	}
}

This is part of the regression test suite, one of the errors that fails.

The problem seems to be that AppDomain.DefaultDomain returns null, so 
the next derefence to Evidence in AppDomain.cs, line 141 crashes.

Am assigning to Sebastien, as svn annotate puts the code on his area.



---- Additional Comments From miguel@ximian.com 2005-01-08 18:45:42 MST ----

A fix for this would fix another three regressions in the mscorlib
test suite.



---- Additional Comments From grompf@sublimeintervention.com 2005-01-08 19:19:24 MST ----

I cannot replicate this on SVN HEAD (PPC)

-kangaroo




---- Additional Comments From sebastien@ximian.com 2005-01-08 19:35:28 MST ----

I can replicate on x86. It seems my assumption that appdomain #0 was
the root domain is no longer (or not always) true. I'll change the
icall to return the root appdomain (as it doesn't seems we can get an
AppDomain by it's Id anyway).



---- Additional Comments From sebastien@ximian.com 2005-01-08 19:44:33 MST ----

Here's two patches, one for metadata and one for AppDomain.cs.

They fix the previous test case and 3 unit tests failures:
- System.AppDomainTest.CreateDomain_String	
- System.AppDomainTest.CreateDomain_StringEvidenceNull	
- System.AppDomainTest.CreateDomain_StringEvidenceNullAppDomainSetup

Note: as this changes (removal/add) an icall we'll need to bump
corlib's version when applying the patch.



---- Additional Comments From sebastien@ximian.com 2005-01-08 19:45:04 MST ----

Created an attachment (id=167233)
AppDomain.diff




---- Additional Comments From sebastien@ximian.com 2005-01-08 19:48:15 MST ----

Created an attachment (id=167234)
metadata.diff




---- Additional Comments From sebastien@ximian.com 2005-01-08 20:24:34 MST ----

Reviewed by Zoltan.
Fixed in SVN (bumping corlib's version wasn't required).

Imported an attachment (id=167233)
Imported an attachment (id=167234)

Unknown operating system unknown. Setting to default OS "Other".