[PATCH] mscoree: Implement VTable fixup for x86_64 architecture.

Paul Gofman gofmanp at gmail.com
Fri Jan 22 11:42:32 CST 2016


On 01/22/2016 08:15 PM, Vincent Povirk wrote:
>> 3. It looks like ReallyFixupVTableEntry has potential thread safety
>> issue. I mean the case when multiple vtable entries are present within
>> one fixup. I could possibly fix that but I think should be an extremely
>> rare case to occur, as application should start calling methods in
>> parallel right from start of module usage at the first place. So I am
>> not sure if it worth doing it.
> What's the issue? It should be OK for multiple threads to run it at once.
>
I think threads may go marshal the same methods for the same vtable
entries with mono_marshal_get_vtfixup_ftnptr (fixup->done is set in the
very end only, it is a long time to for some other thread to join),
overwriting each others result in vtable. Even if mono is perfectly
thread safe attempting init stuff in parallel for a given assembly, I
suppose this could lead to loosing the references to the marshalled
interfaces and not releasing all of them on DLL unload (though this
cleanup might be not implemented yet?). At very most there is a
*potential* issue on non-locked multicpu access to fixup->done, though
this probably does not worth saying as hitting this in real life is a
sort of fantastic.

Even if I am not mistaken with this, I still not sure that it is really
important as it is very uncommon for the real app to start working with
some class multithreaded before calling just any initialization in it.




More information about the wine-devel mailing list