<?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 Possible kernel memory corruption in eglSwapBuffers for frame bufffer device. in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427464#M64860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are running a yocto build on an imx6 system based around the Wandboard module with a custom carrier board.&lt;/P&gt;&lt;P&gt;Using openGL with a framebuffer device (no X), imx-gpu-viv-1_5.0.11.p4.5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am seeing is that when we issue an eglSwapBuffers call, 0's are being written several hundred bytes past the end of the framebuffer, into the next memory page.&lt;/P&gt;&lt;P&gt;In this particular case, this page was allocated by the kernel slub allocator, and contains tty driver data structures. This corruption of the kernel data structures eventually leads to a kernel crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else seen any issues like this? Since I don't have source for libEGL-fb.so, I can't debug it any further!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a fix, or a work around for this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Sep 2015 23:36:14 GMT</pubDate>
    <dc:creator>tonydefeo</dc:creator>
    <dc:date>2015-09-04T23:36:14Z</dc:date>
    <item>
      <title>Possible kernel memory corruption in eglSwapBuffers for frame bufffer device.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427464#M64860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We are running a yocto build on an imx6 system based around the Wandboard module with a custom carrier board.&lt;/P&gt;&lt;P&gt;Using openGL with a framebuffer device (no X), imx-gpu-viv-1_5.0.11.p4.5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I am seeing is that when we issue an eglSwapBuffers call, 0's are being written several hundred bytes past the end of the framebuffer, into the next memory page.&lt;/P&gt;&lt;P&gt;In this particular case, this page was allocated by the kernel slub allocator, and contains tty driver data structures. This corruption of the kernel data structures eventually leads to a kernel crash.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else seen any issues like this? Since I don't have source for libEGL-fb.so, I can't debug it any further!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need a fix, or a work around for this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2015 23:36:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427464#M64860</guid>
      <dc:creator>tonydefeo</dc:creator>
      <dc:date>2015-09-04T23:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Possible kernel memory corruption in eglSwapBuffers for frame bufffer device.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427465#M64861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anthony,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If eglSwapbuffers is writting bytes on the next memory page this should be a bug in the vivante driver, rendering activity for one frame has very clearly defined demarcation of what is one frame and what is the next.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;However in case of your issue, this is not reproducible in the Yocto BSP that Freescale provides, Please provide a sample code to reproduce in our side and get the fix from the developers team, GPU drivers are propietary and are just provided in binary form. or please send a email to support team: &lt;/SPAN&gt;&lt;A class="jive-link-email-small" href="mailto:support@freescale.com"&gt;support@freescale.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 16:09:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427465#M64861</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2015-09-08T16:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: Possible kernel memory corruption in eglSwapBuffers for frame bufffer device.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427466#M64862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response. I have further narrowed down the cause of the problem, and can now work around it.&lt;/P&gt;&lt;P&gt;I will give you the details of what I have found, and include a simple test program that should reproduce the problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem only arises when creating a full screen window with fbCreateWindow(), and specifying a Y position that is NOT a multiple of 4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, if the screen resolution is 1360x768:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fbCreateWindow(native_display, 0, 0, 1360, 768); // OK&lt;/P&gt;&lt;P&gt;fbCreateWindow(native_display, 0, 1, 1360, 768); // PROBLEM&lt;/P&gt;&lt;P&gt;fbCreateWindow(native_display, 0, 2, 1360, 768); // PROBLEM&lt;/P&gt;&lt;P&gt;fbCreateWindow(native_display, 0, 3, 1360, 768); // PROBLEM&lt;/P&gt;&lt;P&gt;fbCreateWindow(native_display, 0, 4, 1360, 768); // OK&lt;/P&gt;&lt;P&gt;etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you set up the window this way, you don't even need to render anything, just calling eglSwapBuffers() will cause a write beyond the end of the allocated frame buffer. The overwrite is a multiple of SCREEN WIDTH bytes beyond the end of the buffer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my case, I was (unnecessarily) specifying a y offset of 1. I am now specifying a y offset of 0 and all is well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So this really appears to be a fringe case, but, in my opinion, the driver should never write beyond the end of the allocated frame buffer regardless of what the application tells it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Depending on what (kernel allocated) memory is mapped past the end of the frame buffer, the failure mode will vary, but sooner or later a kernel panic will occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tony&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Sep 2015 20:06:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Possible-kernel-memory-corruption-in-eglSwapBuffers-for-frame/m-p/427466#M64862</guid>
      <dc:creator>tonydefeo</dc:creator>
      <dc:date>2015-09-08T20:06:17Z</dc:date>
    </item>
  </channel>
</rss>

