<?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: Crash when using dynamic_cast&amp;lt;&amp;gt; in Intel® Software Guard Extensions (Intel® SGX)</title>
    <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1423736#M5519</link>
    <description>&lt;P&gt;Hi Jean-Jacques,&lt;/P&gt;
&lt;P&gt;This was a bug that has been fixed and will be part of the next release.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sincerely,&lt;/P&gt;
&lt;P&gt;Sahira&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 17:33:21 GMT</pubDate>
    <dc:creator>Sahira_Intel</dc:creator>
    <dc:date>2022-10-20T17:33:21Z</dc:date>
    <item>
      <title>Crash when using dynamic_cast&lt;&gt;</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1420335#M5491</link>
      <description>&lt;P&gt;The C++ runtime from the Windows SDK seems to have a problem with multiple inheritance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a minimal reproduction :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;struct Base1 {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; int N1{};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; virtual ~Base1() = default;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;struct Base2 {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; int N2{};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; virtual ~Base2() = default;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;struct Derived : public Base1, public Base2 {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; int D{};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; virtual ~Derived() = default;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;};&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;void test()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; Base1* foo1 = new Derived;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; Base1* bar1 = dynamic_cast&amp;lt;Base1*&amp;gt;(foo1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; Base2* baz1 = dynamic_cast&amp;lt;Base2*&amp;gt;(foo1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; Base2* foo2 = new Derived;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; Base2* baz2 = dynamic_cast&amp;lt;Base2*&amp;gt;(foo2);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp; Base1* bar2 = dynamic_cast&amp;lt;Base1*&amp;gt;(foo2); // =&amp;gt; only this one crashes, only on windows with the sgx runtime&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The call-stack at the crash is :&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;enclave.signed.dll!abort() Line 1054 (c:\SGXWindows\src_Release\windows-trunk\sdk\trts\win\trts_pic.asm:1054)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;enclave.signed.dll!__assert(const char * file, int line, const char * func, const char * failedexpr) Line 50 (c:\SGXWindows\src_Release\windows-trunk\sdk\tlibc\gen\assert.c:50)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;enclave.signed.dll!get_cross_cast_result(const _rtti_base_descriptor * ptarget_type_bcd, const _rtti_base_descriptor * psrc_type_bcd) Line 71 (c:\SGXWindows\src_Release\windows-trunk\sdk\cpprt\win\rtti\rtti.cpp:71)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;enclave.signed.dll!get_multiple_inheritance_bcd(const void * pcomplete_object, const _rtti_complete_object_locator * pcomplete_object_locator, const _rtti_type_descriptor * psrc_type_id, __int64 inptr_delta, const _rtti_type_descriptor * ptarget_type_id) Line 201 (c:\SGXWindows\src_Release\windows-trunk\sdk\cpprt\win\rtti\rtti.cpp:201)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;enclave.signed.dll!__RTDynamicCast(void * inptr, long vf_delta, void * src_type, void * target_type, int is_reference) Line 390 (c:\SGXWindows\src_Release\windows-trunk\sdk\cpprt\win\rtti\rtti.cpp:390)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that this works on Linux, and when the inheritance is virtual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By the way, is there a reason why the SDK is open-source on Linux and not on Windows ? My guess is that with the actual sources mentioned in the call-stack, a fix and a pull-request might have been possible.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 15:39:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1420335#M5491</guid>
      <dc:creator>Jean-Jacques</dc:creator>
      <dc:date>2022-10-07T15:39:52Z</dc:date>
    </item>
    <item>
      <title>Re:Crash when using dynamic_cast&lt;&gt;</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1421160#M5497</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am looking into this and will get back to you shortly.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Sahira &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Oct 2022 19:32:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1421160#M5497</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2022-10-11T19:32:20Z</dc:date>
    </item>
    <item>
      <title>Re:Crash when using dynamic_cast&lt;&gt;</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1423348#M5516</link>
      <description>&lt;P&gt;Hi Jean-Jacques,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for your patience, I've escalated this issue to engineering to look at. I will let you know when I have more information.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Sincerely,&lt;/P&gt;&lt;P&gt;Sahira &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Oct 2022 15:00:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1423348#M5516</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2022-10-19T15:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: Crash when using dynamic_cast&lt;&gt;</title>
      <link>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1423736#M5519</link>
      <description>&lt;P&gt;Hi Jean-Jacques,&lt;/P&gt;
&lt;P&gt;This was a bug that has been fixed and will be part of the next release.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sincerely,&lt;/P&gt;
&lt;P&gt;Sahira&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 17:33:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Software-Guard-Extensions/Crash-when-using-dynamic-cast-lt-gt/m-p/1423736#M5519</guid>
      <dc:creator>Sahira_Intel</dc:creator>
      <dc:date>2022-10-20T17:33:21Z</dc:date>
    </item>
  </channel>
</rss>

