diff options
author | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-06-22 20:56:34 +0300 |
---|---|---|
committer | Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com> | 2018-06-22 20:56:34 +0300 |
commit | c95d49034e7c24eda5c6d3dea04fcd7463ff8457 (patch) | |
tree | ae296fa8a1f7168df79709bca4f600ba7263143a | |
parent | 89a8e406d040cd96fc952b8bba51bfb8c9fdaf19 (diff) |
Move signal reraising code into quickcpplib::signal_guard.
Disabled CI on MacOS until Apple gets their act together.
-rw-r--r-- | .travis.yml | 16 | ||||
-rw-r--r-- | Readme.md | 2 | ||||
-rw-r--r-- | include/afio/revision.hpp | 6 | ||||
-rw-r--r-- | include/afio/v2.0/detail/impl/posix/map_handle.ipp | 35 | ||||
-rw-r--r-- | include/afio/v2.0/detail/impl/windows/map_handle.ipp | 14 | ||||
m--------- | include/afio/v2.0/outcome | 0 | ||||
m--------- | include/afio/v2.0/quickcpplib | 0 | ||||
-rw-r--r-- | release_notes.md | 2 | ||||
m--------- | test/kerneltest | 0 |
9 files changed, 21 insertions, 54 deletions
diff --git a/.travis.yml b/.travis.yml index 03ece0d7..4440340c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ compiler: sudo: false os: - linux - - osx +# - osx osx_image: xcode9.2 branches: only: @@ -36,7 +36,7 @@ env: matrix: - __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS= - __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON - - __="cmake tests" NAME=TravisOSXWorker +# - __="cmake tests" NAME=TravisOSXWorker - __="Documentation" NAME=TravisDocumentation - __="Programs" @@ -44,12 +44,12 @@ matrix: exclude: # - os: osx # compiler: g++ - - os: osx - env: __="Documentation" NAME=TravisDocumentation - - os: osx - env: __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS= - - os: osx - env: __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON +# - os: osx +# env: __="Documentation" NAME=TravisDocumentation +# - os: osx +# env: __="cmake tests (error_code)" NAME=TravisLinuxWorkerEC CMAKE_CONFIGURE_OPTIONS= +# - os: osx +# env: __="cmake tests (status_code)" NAME=TravisLinuxWorkerSC CMAKE_CONFIGURE_OPTIONS=-DAFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE=ON - os: linux compiler: g++ env: __="Documentation" NAME=TravisDocumentation @@ -5,7 +5,7 @@ This is the post-peer-review AFIO v2 rewrite. You can view its documentation at Tarballs of source and prebuilt binaries for Linux x64, MacOS x64 and Windows x64: - https://dedi5.nedprod.com/static/files/afio-v2.0-source-latest.tar.xz - https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-linux64-latest.tgz -- https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-darwin64-latest.tgz +- https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-darwin64-latest.tgz (disabled pending XCode supporting Filesystem TS) - https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-win64-latest.zip diff --git a/include/afio/revision.hpp b/include/afio/revision.hpp index 85ce45a0..bda40a77 100644 --- a/include/afio/revision.hpp +++ b/include/afio/revision.hpp @@ -1,4 +1,4 @@ // Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time -#define AFIO_PREVIOUS_COMMIT_REF ad941bdb9efdae75a872129fd5c834e8554d5412 -#define AFIO_PREVIOUS_COMMIT_DATE "2018-06-20 08:47:11 +00:00" -#define AFIO_PREVIOUS_COMMIT_UNIQUE ad941bdb +#define AFIO_PREVIOUS_COMMIT_REF 89a8e406d040cd96fc952b8bba51bfb8c9fdaf19 +#define AFIO_PREVIOUS_COMMIT_DATE "2018-06-21 20:33:59 +00:00" +#define AFIO_PREVIOUS_COMMIT_UNIQUE 89a8e406 diff --git a/include/afio/v2.0/detail/impl/posix/map_handle.ipp b/include/afio/v2.0/detail/impl/posix/map_handle.ipp index aace6f35..0c4944d1 100644 --- a/include/afio/v2.0/detail/impl/posix/map_handle.ipp +++ b/include/afio/v2.0/detail/impl/posix/map_handle.ipp @@ -576,40 +576,13 @@ map_handle::io_result<map_handle::const_buffers_type> map_handle::write(io_reque } return false; }, - [&](QUICKCPPLIB_NAMESPACE::signal_guard::signalc signo, const void *_info, const void *_context) { - (void) signo; - assert(signo == QUICKCPPLIB_NAMESPACE::signal_guard::signalc::undefined_memory_access); - const auto *info = (const siginfo_t *) _info; - assert(info->si_signo == SIGBUS); - auto *causingaddr = (byte *) info->si_addr; + [&](const QUICKCPPLIB_NAMESPACE::signal_guard::raised_signal_info &_info) { + auto &info = const_cast<QUICKCPPLIB_NAMESPACE::signal_guard::raised_signal_info &>(_info); + auto *causingaddr = (byte *) info.address(); if(causingaddr < _addr || causingaddr >= (_addr + _length)) { // Not caused by this map - struct sigaction sa; - sigaction(SIGBUS, nullptr, &sa); - if(sa.sa_flags & SA_SIGINFO) - { - sa.sa_sigaction(SIGBUS, (siginfo_t *) info, (void *) _context); - } - else if(sa.sa_handler != SIG_IGN) - { - if(sa.sa_handler != SIG_DFL) - { - sa.sa_handler(SIGBUS); - } - // Painful ... - struct sigaction myformer, def; - memset(&def, 0, sizeof(def)); - def.sa_handler = SIG_DFL; - sigaction(SIGBUS, &def, &myformer); - sigset_t myformer2; - sigset_t def2; - sigemptyset(&def2); - sigaddset(&def2, SIGBUS); - pthread_sigmask(SIG_UNBLOCK, &def2, &myformer2); - pthread_kill(pthread_self(), SIGBUS); - sigaction(SIGBUS, &myformer, nullptr); - } + QUICKCPPLIB_NAMESPACE::signal_guard::thread_local_raise_signal(info.signal(), info.raw_info(), info.raw_context()); abort(); } return true; diff --git a/include/afio/v2.0/detail/impl/windows/map_handle.ipp b/include/afio/v2.0/detail/impl/windows/map_handle.ipp index 744f8d82..ef7b7a56 100644 --- a/include/afio/v2.0/detail/impl/windows/map_handle.ipp +++ b/include/afio/v2.0/detail/impl/windows/map_handle.ipp @@ -845,19 +845,13 @@ map_handle::io_result<map_handle::const_buffers_type> map_handle::write(io_reque } return false; }, - [&](QUICKCPPLIB_NAMESPACE::signal_guard::signalc signo, const void *_info, const void * /*unused*/) { - (void)signo; - assert(signo == QUICKCPPLIB_NAMESPACE::signal_guard::signalc::undefined_memory_access); - const auto *info = (const _EXCEPTION_RECORD *) _info; - assert(info->ExceptionCode == EXCEPTION_IN_PAGE_ERROR); - // info->ExceptionInformation[0] = 0=read 1=write 8=DEP - // info->ExceptionInformation[1] = causing address - // info->ExceptionInformation[2] = NTSTATUS causing exception - auto *causingaddr = (byte *) info->ExceptionInformation[1]; + [&](const QUICKCPPLIB_NAMESPACE::signal_guard::raised_signal_info &_info) { + auto &info = const_cast<QUICKCPPLIB_NAMESPACE::signal_guard::raised_signal_info &>(_info); + auto *causingaddr = (byte *) info.address(); if(causingaddr < _addr || causingaddr >= (_addr + _length)) { // Not caused by this map - RaiseException(info->ExceptionCode, info->ExceptionFlags, info->NumberParameters, info->ExceptionInformation); + QUICKCPPLIB_NAMESPACE::signal_guard::thread_local_raise_signal(info.signal(), info.raw_info(), info.raw_context()); } return true; })) diff --git a/include/afio/v2.0/outcome b/include/afio/v2.0/outcome -Subproject b1ff9f2a28f0fe60ebb9bb6eeaad8349b3d0f86 +Subproject d949bc40d4b15a56956162d4a4246e358b781e4 diff --git a/include/afio/v2.0/quickcpplib b/include/afio/v2.0/quickcpplib -Subproject 80715b3493b0a4a5f0e2bd263c92739541a4120 +Subproject 49aa5cdddad9770521f98182af96a01478df706 diff --git a/release_notes.md b/release_notes.md index b8cc8c70..697fb680 100644 --- a/release_notes.md +++ b/release_notes.md @@ -6,7 +6,7 @@ <td align="center"> <a href="https://ci.appveyor.com/project/ned14/afio/branch/master">Windows CI:</a><img src="https://ci.appveyor.com/api/projects/status/680b1pt9srnoprs3/branch/master?svg=true"/> </td> <td align="center"> <a href="https://dedi5.nedprod.com/static/files/afio-v2.0-source-latest.tar.xz">Latest stable</a><br><a href="https://dedi5.nedprod.com/static/files/afio-v2.0-source-latest.tar.xz">sources</a> </td> <td align="center"> <a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-linux64-latest.tgz">Latest stable</a><br><a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-linux64-latest.tgz">Linux x64 prebuilt</a> </td> -<td align="center"> <a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-darwin-latest.tgz">Latest stable</a><br><a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-darwin64-latest.tgz">OS X x64 prebuilt</a> </td> +<td align="center"> <!--<a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-darwin-latest.tgz">Latest stable</a><br><a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-darwin64-latest.tgz">OS X x64 prebuilt</a>--> </td> <td align="center"> <a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-win64-latest.zip">Latest stable</a><br/><a href="https://dedi5.nedprod.com/static/files/afio-v2.0-binaries-win64-latest.zip">VS2017 x64 prebuilt</a> </td> </tr> </table></center> diff --git a/test/kerneltest b/test/kerneltest -Subproject c3be07865d0f85847e5500b6947638be896fed1 +Subproject 80a2998ccbf56d39cad56f293ff7a7e6ddacd18 |