Merge lp:~raof/mir/mir-module-throw-exception into lp:mir
Status: | Work in progress |
---|---|
Proposed branch: | lp:~raof/mir/mir-module-throw-exception |
Merge into: | lp:mir |
Diff against target: |
364 lines (+267/-11) 7 files modified
include/test/mir/test/doubles/null_platform.h (+0/-5) src/common/sharedlibrary/CMakeLists.txt (+4/-1) src/common/sharedlibrary/module_throw_exception.cpp (+94/-0) src/common/symbols.map (+1/-0) src/include/common/mir/module_throw_exception.h (+69/-0) tests/acceptance-tests/test_server_shutdown.cpp (+15/-1) tests/mir_test_framework/platform_graphics_throw.cpp (+84/-4) |
To merge this branch: | bzr merge lp:~raof/mir/mir-module-throw-exception |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mir CI Bot | continuous-integration | Needs Fixing | |
Mir development team | Pending | ||
Review via email: mp+292467@code.launchpad.net |
Commit message
Add MIR_MODULE_
This is like BOOST_THROW_
that contains the throwing code is not unloaded before exception processing finishes.
This prevents annoying-to-debug SIGSEGVs when throwing an exception from a platform module
and stack unwinding causes the mir::UniqueModu
before the catch {} attempts to access code (such as destructors) or data (such as
static strings) from the now-unloaded DSO with hilarious consequences!
Description of the change
Add MIR_MODULE_
This is like BOOST_THROW_
that contains the throwing code is not unloaded before exception processing finishes.
This prevents annoying-to-debug SIGSEGVs when throwing an exception from a platform module
and stack unwinding causes the mir::UniqueModu
before the catch {} attempts to access code (such as destructors) or data (such as
static strings) from the now-unloaded DSO with hilarious consequences!
Part of the infrastructure required to fix https:/
I ran into this with graphics-eglstream. This, not anything the nvidia driver was doing, was the reason that all my exceptions caused SIGSEGV within libstdc++!
Unmerged revisions
- 3470. By Chris Halse Rogers
-
Babysit g++5 by explicitly using std::hash<
uint32_ t>. I don't really know why g++5 can't handle std::unordered_
map<MyEnumClass , bool> while g++6 can,
but that's apparently the case.Make life easier on poor little g++5
- 3469. By Chris Halse Rogers
-
Use MIR_MODULE_
THROW_EXCEPTION in graphics-throw.so - 3468. By Chris Halse Rogers
-
Add MIR_MODULE_
THROW_EXCEPTION . This is like BOOST_THROW_
EXCEPTION, but it additionally ensures that the dynamic library
that contains the throwing code is not unloaded before exception processing finishes.This prevents annoying-to-debug SIGSEGVs when throwing an exception from a platform module
and stack unwinding causes the mir::UniqueModulePtr to be destroyed (and the DSO unloaded)
before the catch {} attempts to access code (such as destructors) or data (such as
static strings) from the now-unloaded DSO with hilarious consequences! - 3467. By Chris Halse Rogers
-
Test exception-safety of all mg::Platform methods.
Spoiler: only the constructor is exception-safe. All other methods SIGSEGV trying to run
code or load data found in the DSO that's just been unloaded...
FAILED: Continuous integration, rev:3469 /mir-jenkins. ubuntu. com/job/ mir-ci/ 879/ /mir-jenkins. ubuntu. com/job/ build-mir/ 904/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/941 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 932 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 932 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= clang,platform= mesa,release= vivid+overlay/ 914/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= amd64,compiler= gcc,platform= mesa,release= xenial/ 914/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= cross-armhf, compiler= gcc,platform= android, release= vivid+overlay/ 914/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= android, release= vivid+overlay/ 914/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- mir/arch= i386,compiler= gcc,platform= mesa,release= xenial/ 914/console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ mir-ci/ 879/rebuild
https:/