[Mono-dev] NRE building from head

Neale Ferguson neale at sinenomine.net
Mon Mar 9 20:39:16 UTC 2015


I am still trying to track down the build NRE for s390x.

I put in a couple of displays in GetHashCode() and in the method that sets
the ns and name variables. I found that the crash is occurring as the
WindowsRuntimeProjection constructor is running. It gets to the point of:

projections.Add(new TypeName("Windows.Foundation",
"EventRegistrationToken"), new
Mapping(ProjectionAssembly.System_Runtime_InteropServices_WindowsRuntime,
"System.Runtime.InteropServices.WindowsRuntime",
"EventRegistrationToken"));


Note when TypeName(ns, name) is invoked it shows these strings:
ns: Windows.Foundation name: EventRegistrationToken

However, when we get to GetHashCode() I attempt to display the values ns
and name again. I had to simply do a null test for name as if I attempt to
use its value I get an NRE (again, this only happens for this invocation):

ns: Windows.Foundation
name: not null

Interestingly, if I add this to WindowsRuntimeProjection()

Console.Error.WriteLine("WindowsRuntimeProjection - {0} {1} {2}",
ProjectionAssembly.System_Runtime,
ProjectionAssembly.System_Runtime_InteropServices_WindowsRuntime,
ProjectionAssembly.Count);


I get:

WindowsRuntimeProjection - System_Runtime 1 5


Seeing this, I changed the order of projection.Add statements such that
the Interop one happened after an add of System_Runtime_WindowsRuntime,
and the crash then occurred when it encountered the first of these. That
is, everything with ProjectionAssembly.System_Runtime is successfully
added but the first time a non-System_Runtime is encountered the crash
occurs.

So I changed the order of things in the enum ProjectionAssembly and only
the one declared first in the enum gets printed out as a name and not an
integer. For example, I made System_Runtime the third entry and then got:

WindowsRuntimeProjection - 2 System_Runtime_InteropServices_WindowsRuntime
5


I do not know the significance of this, but it also results in a crash
when the first projection.Add of a System_Runtime entry is processed.
Which source file contains the Dictionary Add processing? I wonder if
there is some little endian/big endian issue here as 0 index would never
be a problem but non-zero would.

Here is the original exception message (without my above changes:

Unhandled Exception:
Mono.CSharp.InternalErrorException:
Microsoft.Win32/RegistryKeyPermissionCheck.cs(31,21): Microsoft.Win32 --->
Mono.CSharp.InternalErrorException:
Microsoft.Win32/RegistryKeyPermissionCheck.cs(33,14):
Microsoft.Win32.RegistryKeyPermissionCheck --->
System.TypeInitializationException: An exception was thrown by the type
initializer for IKVM.Reflection.WindowsRuntimeProjection --->
System.NullReferenceException: Object reference not set to an instance of
an object
  at IKVM.Reflection.TypeName.GetHashCode () [0x00000] in <filename
unknown>:0 
  at 
System.Collections.Generic.GenericEqualityComparer`1[IKVM.Reflection.TypeNa
me].GetHashCode (TypeName obj) [0x00000] in <filename unknown>:0
  at 
System.Collections.Generic.Dictionary`2[IKVM.Reflection.TypeName,IKVM.Refle
ction.WindowsRuntimeProjection+Mapping].Insert (TypeName key,
IKVM.Reflection.Mapping value, Boolean add) [0x00000] in <filename
unknown>:0 
  at 
System.Collections.Generic.Dictionary`2[IKVM.Reflection.TypeName,IKVM.Refle
ction.WindowsRuntimeProjection+Mapping].Add (TypeName key,
IKVM.Reflection.Mapping value) [0x00000] in <filename unknown>:0
  at IKVM.Reflection.WindowsRuntimeProjection..cctor () [0x00000] in
<filename unknown>:0



On 3/5/15, 10:28 AM, "Neale Ferguson" <neale at sinenomine.net> wrote:

>I cloned from head yesterday and am now crashing in
>IKVM.Reflection.TypeName.GetHashCode with a NRE. Does this look familiar?
>Before the clone, the copy I was using was up to date as of Monday and it
>was working. I recloned just to have a clean slate after Atushi committed
>my endian fixes for the reference sources.



More information about the Mono-devel-list mailing list