From 8068cc3231d05e9e69f1ab4e0bdd735621ca9786 Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Fri, 24 Sep 2021 18:19:16 +0100 Subject: [PATCH] Trap segmentation faults in map_handle::write() and report and no disc space. --- include/llfio/v2.0/detail/impl/posix/map_handle.ipp | 2 +- include/llfio/v2.0/detail/impl/windows/map_handle.ipp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/llfio/v2.0/detail/impl/posix/map_handle.ipp b/include/llfio/v2.0/detail/impl/posix/map_handle.ipp index d83d5d7c4..5caec3a80 100644 --- a/include/llfio/v2.0/detail/impl/posix/map_handle.ipp +++ b/include/llfio/v2.0/detail/impl/posix/map_handle.ipp @@ -739,7 +739,7 @@ map_handle::io_result map_handle::_do_write(io_r byte *addr = _addr + reqs.offset; size_type togo = reqs.offset < _length ? static_cast(_length - reqs.offset) : 0; if(QUICKCPPLIB_NAMESPACE::signal_guard::signal_guard( - QUICKCPPLIB_NAMESPACE::signal_guard::signalc_set::undefined_memory_access, + QUICKCPPLIB_NAMESPACE::signal_guard::signalc_set::undefined_memory_access | QUICKCPPLIB_NAMESPACE::signal_guard::signalc_set::segmentation_fault, [&] { for(size_t i = 0; i < reqs.buffers.size(); i++) { diff --git a/include/llfio/v2.0/detail/impl/windows/map_handle.ipp b/include/llfio/v2.0/detail/impl/windows/map_handle.ipp index 2ee3e5e39..258221cba 100644 --- a/include/llfio/v2.0/detail/impl/windows/map_handle.ipp +++ b/include/llfio/v2.0/detail/impl/windows/map_handle.ipp @@ -1000,7 +1000,7 @@ map_handle::io_result map_handle::_do_write(io_r byte *addr = _addr + reqs.offset; size_type togo = reqs.offset < _length ? static_cast(_length - reqs.offset) : 0; if(QUICKCPPLIB_NAMESPACE::signal_guard::signal_guard( - QUICKCPPLIB_NAMESPACE::signal_guard::signalc_set::undefined_memory_access, + QUICKCPPLIB_NAMESPACE::signal_guard::signalc_set::undefined_memory_access | QUICKCPPLIB_NAMESPACE::signal_guard::signalc_set::segmentation_fault, [&] { for(size_t i = 0; i < reqs.buffers.size(); i++) {