Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Commented Issue: Android - functions marked noexcept which throw and exception but handle in the function call std::terminate [388]

$
0
0
This appears to have nothing to do with the C++ REST SDK as it reproduces easily on with just a basic NativeActivity with exceptions and C++11 turned on calling the following function:

void foo() noexcept // doesn’t fail if noexcept is commented out….
{
try
{
throw std::invalid_argument("hello");
}
catch (...)
{
}
}

The main reason this causes problems is with std::make_exception_ptr which is a noexcept function implemented with a try/catch like above. We need to marshal exceptions to different threads when errors occur in some cases, for example like a network error with the http_client.

Right now we can try to workaround the issue in the library by compiling with the following macros to avoid having parts of the standard library marked with noexcept:

_GLIBCXX_NOEXCEPT=;_GLIBCXX_USE_NOEXCEPT=;_GLIBCXX_THROW(_EXC)=;

Customers will also need to compile their application with this macro to avoid issues as well.

Steve
Comments: Forgot to include this only happens with ARM, and therefore when running on an actual device.

Viewing all articles
Browse latest Browse all 4845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>