Bug 45728 - NRE in System.Runtime.Remoting.ObjRef.get_ServerType on getting app domain
Summary: NRE in System.Runtime.Remoting.ObjRef.get_ServerType on getting app domain
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: mscorlib (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-10-20 10:43 UTC by Leonid Shalupov
Modified: 2016-12-05 08:18 UTC (History)
3 users (show)

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


Attachments
repro.cs (796 bytes, text/plain)
2016-10-20 10:43 UTC, Leonid Shalupov
Details


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 for Bug 45728 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Leonid Shalupov 2016-10-20 10:43:37 UTC
Created attachment 18132 [details]
repro.cs

Looks like some threading issue.
Attached program fails with the following stack trace every couple of runs (not always):

Server stack trace:
  at System.Runtime.Remoting.ObjRef.get_ServerType () [0x00011] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef, System.Boolean fRefine) [0x00006] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef) [0x00000] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Runtime.Remoting.RemotingServices.GetDomainProxy (System.AppDomain domain) [0x0005e] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.AppDomain.get_DefaultDomain () [0x00026] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.AppDomain.IsDefaultAppDomain () [0x00000] in <f7aaa673a4cb46db963d3c7434716125>:0
  at (wrapper remoting-invoke-with-check) System.AppDomain:IsDefaultAppDomain ()
  at ConsoleApplication.Program.Main (System.String[] args) [0x00012] in <20993866b7d647f489f94537728c8091>:0
  at (wrapper managed-to-native) System.AppDomain:ExecuteAssembly (System.AppDomain,System.Reflection.Assembly,string[])
  at System.AppDomain.ExecuteAssemblyInternal (System.Reflection.Assembly a, System.String[] args) [0x0002c] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.AppDomain.ExecuteAssemblyByName (System.String assemblyName, System.String[] args) [0x00008] in <f7aaa673a4cb46db963d3c7434716125>:0
  at (wrapper remoting-invoke-with-check) System.AppDomain:ExecuteAssemblyByName (string,string[])
  at (wrapper xdomain-dispatch) System.AppDomain:ExecuteAssemblyByName (object,byte[]&,byte[]&,string,string[])

Exception rethrown at [0]:
  at (wrapper xdomain-invoke) System.AppDomain:ExecuteAssemblyByName (string,string[])
  at (wrapper remoting-invoke-with-check) System.AppDomain:ExecuteAssemblyByName (string,string[])
  at ConsoleApplication.Program+<Main>c__AnonStorey0.<>m__0 () [0x00028] in <20993866b7d647f489f94537728c8091>:0
  at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00017] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x0008d] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00031] in <f7aaa673a4cb46db963d3c7434716125>:0
  at System.Threading.ThreadHelper.ThreadStart () [0x0000b] in <f7aaa673a4cb46db963d3c7434716125>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object