Mach7 icon indicating copy to clipboard operation
Mach7 copied to clipboard

Loading/unloading DLL

Open solodon4 opened this issue 9 years ago • 0 comments

Robert suggested a plausible scenario today that might lead to invalid dispatch and should be considered when designing language solution:

  1. Dll A is loaded
  2. Classes from Dll A pass through a type switch and get memoized there
  3. Dll A is unloaded
  4. Dll B is loaded into the same physical address as Dll A was occupying
  5. Some of v-tables in Dll B might be in the same spots as others from Dll A
  6. If any of these vtbl pointers from Dll B now go through the same typeswitch, the typeswitch will incorrectly assume that it has already seen that vtbl-pointer.

To avoid this in language solution, we might need to remove vtbl-pointers from vtbl-map when Dll A is unloaded. Would also be interesting to see how often this may happen in practice with something like COM.

solodon4 avatar Oct 31 '14 06:10 solodon4