<?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: Kernel panic in eglGetDisplay in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407583#M60745</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JohnDoe1z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I think this is an issue with mlockall function in this kernel version, since when given the MCL_FUTURE flag, is supposed to cause all future memory allocations in that process to become wired. However, memory obtained from the mmap() function was not being wired correctly after using mlockall(). This results in low performance from the mmap memory pages.&amp;nbsp; This function should be use only on small processes, because all memory pages of the process will be locked into memory&amp;nbsp; code, data and libraries, i guess this is the reason of kernel panic. I do not suggest to be used with GPU driver, if you like to swap contexts you can use eglswapbuffers or any egl functions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Dec 2015 16:29:06 GMT</pubDate>
    <dc:creator>Bio_TICFSL</dc:creator>
    <dc:date>2015-12-01T16:29:06Z</dc:date>
    <item>
      <title>Kernel panic in eglGetDisplay</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407581#M60743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the iMX6 SoloX SABRE board with Framebuffer backend (no X11) and encountered an issue during developing an EGL application.&lt;/P&gt;&lt;P&gt;The following, rather simple, test-application crashes (see attached eglinitialize-bug.c for full source) with a kernel panic (see attached kernel-panic.txt).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;int main(int argc, char **argv)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EGLNativeWindowType&amp;nbsp; native_window;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EGLNativeDisplayType native_display;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mlockall(MCL_CURRENT | MCL_FUTURE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; native_display =&amp;nbsp; fbGetDisplayByIndex(0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; native_window = fbCreateWindow(native_display, 0, 0, 0, 0);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Before eglGetDisplay\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The following call produces kernel panic if mlockall(MCL_FUTURE) has been called&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; eglGetDisplay(native_display);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("After eglGetDisplay\n");&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"&gt;Excerpt of the kernel panic:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;[&amp;lt;800b8054&amp;gt;] (remap_pfn_range) from [&amp;lt;80018928&amp;gt;] (arm_dma_mmap+0xc8/0xcc)&lt;/P&gt;&lt;P&gt;[&amp;lt;80018928&amp;gt;] (arm_dma_mmap) from [&amp;lt;804b3938&amp;gt;] (gckOS_MapMemory+0x18c/0x224)&lt;/P&gt;&lt;P&gt;[&amp;lt;804b3938&amp;gt;] (gckOS_MapMemory) from [&amp;lt;804b93b8&amp;gt;] (drv_open+0xb4/0x158)&lt;/P&gt;&lt;P&gt;[&amp;lt;804b93b8&amp;gt;] (drv_open) from [&amp;lt;800d8a5c&amp;gt;] (chrdev_open+0xa4/0x178)&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I remove the call of mlockall in the application, the kernel panic does not happen. Unfortunately, in my real use-case, the function mlockall is called by a close-sourced framework we are using, i.e. I cannot modify that. According to the stack trace, the Vivante driver seems to be the culprit, or is at least involved.&lt;/P&gt;&lt;P&gt;Is this intended or a known bug? Why does the Vivante GPU-driver crash or cause a crash in this situation?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using 3.14.28 and also have tried with 3.14.38.&lt;/P&gt;&lt;P&gt;I'm cross-compiling (with Yocto toolchain) the .c file with:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; font-size: 10pt;"&gt;$(CC) -o eglinitialize-bug eglinitialize-bug.c -DLINUX -DEGL_API_FB&amp;nbsp; -lc -lEGL &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336924"&gt;eglinitialize-bug.c.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-336924"&gt;kernel-panic.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 14:15:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407581#M60743</guid>
      <dc:creator>JohnDoe1z</dc:creator>
      <dc:date>2015-11-13T14:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel panic in eglGetDisplay</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407582#M60744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any suggestions by Freescale or a Vivante GPU expert on this bug?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2015 09:22:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407582#M60744</guid>
      <dc:creator>JohnDoe1z</dc:creator>
      <dc:date>2015-11-25T09:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel panic in eglGetDisplay</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407583#M60745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JohnDoe1z&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I think this is an issue with mlockall function in this kernel version, since when given the MCL_FUTURE flag, is supposed to cause all future memory allocations in that process to become wired. However, memory obtained from the mmap() function was not being wired correctly after using mlockall(). This results in low performance from the mmap memory pages.&amp;nbsp; This function should be use only on small processes, because all memory pages of the process will be locked into memory&amp;nbsp; code, data and libraries, i guess this is the reason of kernel panic. I do not suggest to be used with GPU driver, if you like to swap contexts you can use eglswapbuffers or any egl functions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Dec 2015 16:29:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Kernel-panic-in-eglGetDisplay/m-p/407583#M60745</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2015-12-01T16:29:06Z</dc:date>
    </item>
  </channel>
</rss>

