[Mono-dev] NullReferenceException on a callvirt... with a non-null reference? (please help!)

Brian Crowell mono-devel at fluggo.com
Fri Jun 16 05:29:28 EDT 2006


Zoltan Varga wrote:
>  The fact that new appdomains have all assemblies loaded is clearly a 
> bug, but
> it can't be fixed easily because certain parts of the runtime, most 
> notably the
> remoting infrastructure seem to depend on this broken behaviour.

Yeah, I'm noticing that, too. But, at least in my case, it has to be fixed. :P

Although, I can't really think of anything outside of this particular case that 
might also need to be fixed. Only in-process cross-domain calls would try to 
take advantage of having the same assembly in both AppDomains. If it's in the 
same domain, it *is* the same assembly, and if it's not in the same process, 
then you can't take the shortcut anyways. What other areas can you think of that 
might also need to be fixed?

I find it odd that the author took pains to call the correct method, but failed 
to see that late-loading the method's pointer (the apparent function of 
CEE_MONO_LDPTR) does no good if you assume you're working with the same 
assembly-- you'll just get the same pointer again.

In fact, it may be as simple as introducing a late-binding mechanism into the 
emitted methods.

Thoughts? Suggestions?

--Brian



More information about the Mono-devel-list mailing list