- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following ecall code causes a read access violation during destruction of the msg string during unwinding the stack in the catch block of exceptionTest() (see picture for callstack). The exception is "Unhandled exception thrown: read access violation. fm was 0xFFFFFFFFFFFFFFBF.".
Note that this only happens if build in 64-bit mode. With 32-bit, everything works fine. And it only happens if the std::string in long enough. E.g. with std::string msg( "foo" ); it works without problems.
Is there something in the code not allowed in SGX (e.g. throw in catch block), or anything else wrong with it?
For me it looks like it also could be a problem in the c++ standard library shipped in the SDK for SGX. Is there a better place to report such potential bugs in the SDK than this forum?
Tested with
- SGX SDK 2.3.100.49777
- sgx_tcxx.lib
- VS 2017 with Toolset v140/v141
#include "Enclave_t.h" #include <exception> #include <string> static void exceptionTest() { try { throw std::exception( "foobar" ); } catch ( std::exception& ) { std::string msg( "012345678901234567890123456789" ); throw std::exception( "bar" ); } } void ecall_exceptionTest() { try { exceptionTest(); } catch ( std::exception& ) { } }
Link Copied
![](/skins/images/D3C0B914909A6564BBB97F4AD1ED1973/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page