Comment 2 for bug 1346952

Revision history for this message
Andreas Pokorny (andreas-pokorny) wrote :

This crash is caused through interleaved register and unregister calls of fds. mirserver unregisters the FD as soon as the surface disappears or when all outstanding input responds have been received. The exception is thrown when the registration of an FD happens before the old FDHandler has been removed.

For this bug to work the following things are necessary:
 * user input is handled and dispatched in multiple threads - i.e. input responds are currently handled in main loop (we discussed about moving that into a separate thread - would be no difference since input is read in a dedicated thread)
 * user input and scene reconfigurations happen in multiple threads - imagine a surface gets removed while a user input event is sent
 * fd registration happens out of order in the callers thread, while the removals happen in main thread.

I am tempted to make fd registration like the removal, it would solve that issue but that might not guarantee the right order and have different side effects.