[Mono-devel-list] Problems with the new jit and proxies

Lluis Sanchez lluis at ideary.com
Thu May 8 19:49:22 EDT 2003


I've been tracking down a couple of problems that mini has with transparent

1) It crashes when creating a proxy based on an interface. This is because
the method mono_jit_create_remoting_trampoline in mini.c checks if the
provided method is from a marshalbyref or object class. If it is not, it
does not create the remoting trampoline. Since the method is from an
interface, the trampoline is not created and it fails. If I remove the check
it works. In the old jit this check wasn't there, but I guess there is a
good reason for it.

2) When creating a remote object using new, the constructor call does not go
through the proxy. The runtime makes a direct call to the object (which does
not exist, because it is a proxy) and crashes. It is because the method
mono_emit_method_call_spilled for generating the constructor call in the
CEE_NEWOBJ case is invoked with a NULL value in the "this" parameter:

mono_emit_method_call_spilled (cfg, bblock, cmethod, sp, ip, NULL);

Later, mono_emit_method_call should create a remoting wrapper for the
method, but it doesn't do it because "this" is null. Changing NULL to sp[0]
makes it work, but it is just a "guessed" solution :-)

There are other weird problems that I'm still trying to isolate.

- Lluis

More information about the Mono-devel-list mailing list