Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Vaurine
Beginner
256 Views

Heap memory corruption during calling enclave code from C#.

Jump to solution

I need to call some sgx methods in my C# code. I have found simple example with C# SGX integration on this page: https://software.intel.com/content/www/us/en/develop/articles/csharp-application-with-intel-software.... I try to rewrite it on my personal project, and everything builds fine, but when I run I have such error:

Exception thrown at 0x00007FFC598B9229 (ntdll.dll) in HttpClient.exe: 0xC0000374: Heap Memory corruption (parameters: 0x00007FFC599227F0).

What can be the issue of that? Moreover when I continue debugging, it returns valid data from enclave(I have included sceen), which makes it really difficult to me to diagnoze. It even run properly without exception approximately one time  in six times.

Exception is thrown in "retValve = native->enclaveString(pString);" line in LinkManaged.cpp class:

String^ SigningEnclaveLinkManaged::enclaveString(String^ s)
{
string retValve;
char* pString = (char*)Marshal::StringToHGlobalAnsi(s).ToPointer();
string nativeString(pString); // make your std::string
retValve = native->enclaveString(pString);
String^ clistr = gcnew String(retValve.c_str()); // make your System::String^
return clistr;
}

Tags (4)
0 Kudos
1 Solution
JesusG_Intel
Moderator
247 Views

Hello Vaurine,

 

Unfortunately, that C# sample is outdated and no longer supported. It has not been updated for modern SGX SDKs or .NET frameworks.


Microsoft’s OpenEnclave documentation may have advice on interacting with .NET languages.


View solution in original post

2 Replies
JesusG_Intel
Moderator
248 Views

Hello Vaurine,

 

Unfortunately, that C# sample is outdated and no longer supported. It has not been updated for modern SGX SDKs or .NET frameworks.


Microsoft’s OpenEnclave documentation may have advice on interacting with .NET languages.


View solution in original post

JesusG_Intel
Moderator
233 Views

Intel is no longer monitoring this thread. If you want a response from Intel in a follow-up question, please open a new thread.


Reply