Mir

Code review comment for lp:~vanvugt/mir/fix-1527449

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, I switched to mir::make_module_ptr<> and got an ugly crash on shutdown. But thank you, because that led me to understand why earlier experiments over the past couple of weeks got the same crash.

The reason is that the act of constructing a mesa platform from mesa.so.4 :
   mir::make_module_ptr<mclm::ClientPlatform>(
makes the compiler instantiate that UniqueModulePtr template and its destructor inside mesa.so.4.

So indeed make_module_ptr delays the unload of mesa.so.4 a little to a safer time, it's not safe enough. Because after unloading mesa.so.4 it has to try and destroy the UniqueModulePtr whose template instance was in mesa.so.4 but was unmapped from memory just before we need to call it. Hence *crash* when using make_module_ptr.

This seems to be a fundamental flaw in make_module_ptr and might explain bug 1528135 too. But suffice to say make_module_ptr doesn't work, and will cause crashes. Whereas mir::Plugin does work without crashing.

« Back to merge proposal