<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:Heap memory corruption during calling enclave code from C#. in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1205027#M3928</link>
    <description>&lt;P&gt;&lt;B&gt;Intel is no longer monitoring this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 28 Aug 2020 16:31:30 GMT</pubDate>
    <dc:creator>JesusG_Intel</dc:creator>
    <dc:date>2020-08-28T16:31:30Z</dc:date>
    <item>
      <title>Heap memory corruption during calling enclave code from C#.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1203195#M3901</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I need to call some sgx methods in my C# code. I have found simple example with C# SGX integration on this page:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://software.intel.com/content/www/us/en/develop/articles/csharp-application-with-intel-software-guard-extensions.html" target="_blank" rel="noopener nofollow noopener noreferrer"&gt;https://software.intel.com/content/www/us/en/develop/articles/csharp-application-with-intel-software...&lt;/A&gt;&lt;SPAN&gt;. I try to rewrite it on my personal project, and everything builds fine, but when I run I have such error:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Exception thrown at 0x00007FFC598B9229 (ntdll.dll) in HttpClient.exe: 0xC0000374: Heap Memory corruption (parameters: 0x00007FFC599227F0).&lt;/P&gt;
&lt;P&gt;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&amp;nbsp; in six times.&lt;/P&gt;
&lt;P&gt;Exception is thrown in "retValve = native-&amp;gt;enclaveString(pString);" line in LinkManaged.cpp class:&lt;/P&gt;
&lt;P&gt;String^ SigningEnclaveLinkManaged::enclaveString(String^ s)&lt;BR /&gt;{&lt;BR /&gt;string retValve;&lt;BR /&gt;char* pString = (char*)Marshal::StringToHGlobalAnsi(s).ToPointer();&lt;BR /&gt;string nativeString(pString); // make your std::string&lt;BR /&gt;&lt;STRONG&gt;retValve = native-&amp;gt;enclaveString(pString);&lt;/STRONG&gt;&lt;BR /&gt;String^ clistr = gcnew String(retValve.c_str()); // make your System::String^&lt;BR /&gt;return clistr;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2020 10:08:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1203195#M3901</guid>
      <dc:creator>Vaurine</dc:creator>
      <dc:date>2020-08-23T10:08:08Z</dc:date>
    </item>
    <item>
      <title>Re:Heap memory corruption during calling enclave code from C#.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1204021#M3916</link>
      <description>&lt;P&gt;Hello Vaurine,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, that C# sample is outdated and no longer supported. It has not been updated for modern SGX SDKs or .NET frameworks.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Microsoft’s OpenEnclave documentation may have advice on interacting with .NET languages.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 25 Aug 2020 17:33:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1204021#M3916</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-08-25T17:33:47Z</dc:date>
    </item>
    <item>
      <title>Re:Heap memory corruption during calling enclave code from C#.</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1205027#M3928</link>
      <description>&lt;P&gt;&lt;B&gt;Intel is no longer monitoring this thread. If you want a response from Intel in a follow-up question, please open a new thread.&lt;/B&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 28 Aug 2020 16:31:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Heap-memory-corruption-during-calling-enclave-code-from-C/m-p/1205027#M3928</guid>
      <dc:creator>JesusG_Intel</dc:creator>
      <dc:date>2020-08-28T16:31:30Z</dc:date>
    </item>
  </channel>
</rss>

