Mir

Comment 2 for bug 1482274

Revision history for this message
Alberto Aguirre (albaguirre) wrote :

It seems like the issue is related to code using identical lambdas.

Both GLibMainLoopTest, propagates_exception_from_server_action and GLibMainLoopTest.can_be_rerun_after_exception (test_glib_main_loop.cpp) use the same definition:

    ml.enqueue(this, [] { throw std::runtime_error("server action error"); });

And when a definition is identical, the exception handler is not called for some reason. It seems as if the compiler registers the wrong info in the exception handler table.

Using a different message for the runtime_error exception in the lambda forces the compiler to produce a different implementation and the exception is then able to be caught as expected.