[Mono-list] Seemingly impossible null reference exception running managed code with embedded Mono on Linux

Jean-Michel.Perraud at csiro.au Jean-Michel.Perraud at csiro.au
Thu Mar 14 09:13:07 UTC 2013


Weeble.
Thanks for pointing to the implementation of Type.GetMethod; I was taking the error message at face value indeed.
And agreed on where to look for an issue; I phrased my concern with the error message very poorly, and naturally Mono's GC as such is a long way down the list of things to look at.
Looking at the C# code only, neither the array nor its elements can possibly be null, but combining your remarks with Ian Norton's hint at a modified closure... that could be it.

Thanks

From: Weeble [mailto:clockworksaint at gmail.com]
Sent: Thursday, 14 March 2013 6:50 PM
To: Perraud, Jean-Michel (CLW, Black Mountain)
Cc: mono-list at lists.ximian.com
Subject: Re: [Mono-list] Seemingly impossible null reference exception running managed code with embedded Mono on Linux


On 14 Mar 2013 02:34, <Jean-Michel.Perraud at csiro.au<mailto:Jean-Michel.Perraud at csiro.au>> wrote:
> If anything I can only suspect an incorrect garbage collection on the variable 'Type[] types', unlikely as it is.

That strikes me as improbable. Such a bug would be very likely to have been observed before. Have a look at System.Types.GetMethod - it throws that exception not just when types == null, but also when any element in types is null. I think a more likely source of the bug is an access to uninitialized memory, a use-after-free or an array overflow somewhere in the native code of the R to CLR library, leading to a null value in the array. I would try to rule that out long before looking at the garbage collector.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130314/c7187a20/attachment.html>


More information about the Mono-list mailing list