Exceptions are raised in a compositing thread and not handled
Bug #1285084 reported by
Alan Griffiths
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Allowing an exception to propagate out of the thread that throws it results in terminate being called (which can loses most of the diagnostic information[1]).
If the condition being reported is truly fatal an exception is the wrong way to report it.
If the condition is not fatal then the exception should be handled.
[1] bug 1237332 "Fatal exceptions raised in a compositing thread have no usable stack trace"
Related branches
lp:~alan-griffiths/mir/fatal-error
- PS Jenkins bot (community): Approve (continuous-integration)
- Daniel van Vugt: Disapprove
- Robert Carr (community): Approve
- Cemil Azizoglu (community): Approve
- Kevin DuBois (community): Approve
- Alexandros Frantzis (community): Approve
-
Diff: 527 lines (+292/-39)10 files modifiedinclude/platform/mir/fatal.h (+76/-0)
src/platform/CMakeLists.txt (+2/-0)
src/platform/fatal/CMakeLists.txt (+3/-0)
src/platform/fatal/fatal.cpp (+58/-0)
src/platform/graphics/mesa/CMakeLists.txt (+1/-2)
src/platform/graphics/mesa/display_buffer.cpp (+9/-8)
src/platform/graphics/mesa/real_kms_output.cpp (+18/-29)
tests/acceptance-tests/test_server_shutdown.cpp (+65/-0)
tests/unit-tests/CMakeLists.txt (+1/-0)
tests/unit-tests/test_fatal.cpp (+59/-0)
To post a comment you must log in.
Interesting: "If the condition being reported is truly fatal an exception is the wrong way to report it."
I think an abort() is most useful for generating clean core files with the greatest chance of being debuggable.
I'm not aware of any uncaught exceptions in the compositing threads that are themselves logically recoverable. As such, this bug might be invalid and/or should not be fixed. The more you try to handle exceptions, the less readable the core file and stack trace becomes, hindering post-mortem analysis in Launchpad. A clean core file and stack trace provides the greatest chance of fully understanding the root cause and fixing the bug.
Remember it's not just the location of the error you need, but full stack trace and the ability to examine variable values, memory regions, as well as other threads running concurrently at the time of the crash. Only a core file gives you all this.