<?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: i.MX93 Shared memory access using UIO/mmap crashes (Segfaults) only when debugging with GDB in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141815#M239628</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="rPeykc" data-hveid="CAUQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQo_EKegQIBRAB"&gt;&lt;SPAN data-huuid="13906457124653967581"&gt;you have to fo with Phytec for better reference on this.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967581"&gt;A segmentation fault (segfault) during debugging indicates that the program attempted to access a memory location it was not permitted to access. &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967546"&gt;This typically results in the operating system terminating the program with a SIGSEGV signal. &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967511"&gt;Debugging tools like GDB can help pinpoint the cause.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="rPeykc" data-hveid="CAUQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQo_EKegQIBRAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="rPeykc pyPiTc" data-hveid="CAIQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQo_EKegQIAhAB"&gt;&lt;SPAN data-huuid="13906457124653967441"&gt;Common causes of segmentation faults:&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="c140be1d-44a1-4c9a-b5b6-2a6d7d0126ed" data-uuids="13906457124653967441"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CAMQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIAxAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;&lt;SPAN data-huuid="13906457124653967336"&gt;&lt;STRONG&gt;Dereferencing a null or uninitialized pointer:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967301"&gt;Attempting to access memory through a pointer that does not point to a valid memory location.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="NPrrbc" data-cid="ee59bb17-767f-443d-97aa-cd261d2334fb" data-uuids="13906457124653967336,13906457124653967301"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CAoQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIChAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653967231"&gt;&lt;STRONG&gt;Out-of-bounds array access:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967196"&gt;Accessing an array element beyond its declared size.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="NPrrbc" data-cid="23ef22d2-25ab-4348-aab9-e96d27bedd6e" data-uuids="13906457124653967231,13906457124653967196"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CBQQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIFBAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653967126"&gt;&lt;STRONG&gt;Stack overflow:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967091"&gt;Excessive recursion or large local variables consuming all available stack space.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653967021"&gt;&lt;STRONG&gt;Writing to read-only memory:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653966986"&gt;Attempting to modify a memory segment designated as read-only, such as the code segment.&lt;SPAN class="pjBG2e" data-cid="46eaa2e8-b899-40eb-ae04-e8bde35555ca"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653966916"&gt;&lt;STRONG&gt;Use-after-free errors:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653966881"&gt;Accessing memory after it has been deallocated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="NPrrbc" data-cid="83527df3-16eb-41da-b6cd-d4549b4311c9" data-uuids="13906457124653967126,13906457124653967091"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CBIQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIEhAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="NPrrbc" data-cid="46eaa2e8-b899-40eb-ae04-e8bde35555ca" data-uuids="13906457124653967021,13906457124653966986"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CBEQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIERAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="NPrrbc" data-cid="fec234f9-388a-49b9-8c31-2090bd083a7e" data-uuids="13906457124653966916,13906457124653966881"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CA0QAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIDRAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;UL data-hveid="CDAQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQm_YKegQIMBAB"&gt;
&lt;LI&gt;&lt;SPAN data-huuid="3750667719182199476"&gt;&lt;STRONG&gt;Obtain a backtrace:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="3750667719182199131"&gt;Once the segfault occurs, GDB will stop. &lt;/SPAN&gt;&lt;SPAN data-huuid="3750667719182198786"&gt;Use the &lt;CODE class="mv6bHd"&gt;bt&lt;/CODE&gt; (backtrace) command to see the call stack leading up to the crash. &lt;/SPAN&gt;&lt;SPAN data-huuid="3750667719182198441"&gt;This helps identify the function and line of code where the fault occurred.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN data-huuid="3750667719182198441"&gt;I&lt;/SPAN&gt;&lt;SPAN data-huuid="14725625559055708520"&gt;&lt;STRONG&gt;nspect variables and memory:&lt;/STRONG&gt; &lt;/SPAN&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="14725625559055709577"&gt;Navigate through the stack frames using &lt;CODE class="mv6bHd"&gt;frame N&lt;/CODE&gt; (where N is the frame number from the backtrace) and use &lt;CODE class="mv6bHd"&gt;print variable_name&lt;/CODE&gt; to inspect the values of relevant variables, especially pointers, to identify potential issues like null or invalid addresses.&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="51d00bd0-0ae3-4fd7-89a2-8d0fbc6b7e0d" data-uuids="14725625559055708520,14725625559055709577"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CDYQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQINhAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN data-huuid="14725625559055711691"&gt;&lt;STRONG&gt;Use memory analysis tools:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="14725625559055708652"&gt;Can be invaluable for detecting memory errors, including invalid memory accesses, uninitialized memory usage, and memory leaks, which can lead to segfaults.&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="b86e6eb4-d32e-4165-ac1d-3fb2120f97bd" data-uuids="14725625559055711691,14725625559055708652"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CDkQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIORAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="kHtcsd"&gt;Regards&lt;/DIV&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV&gt;
&lt;DIV class="ecCNFc"&gt;
&lt;DIV class="zYSUYd"&gt;
&lt;DIV class="FS7GEb"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Jul 2025 14:31:00 GMT</pubDate>
    <dc:creator>Bio_TICFSL</dc:creator>
    <dc:date>2025-07-28T14:31:00Z</dc:date>
    <item>
      <title>i.MX93 Shared memory access using UIO/mmap crashes (Segfaults) only when debugging with GDB</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141791#M239626</link>
      <description>&lt;P&gt;Hello NXP and forum members,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we are working with the i.MX93 and want to use the shared memory to interact between the M33 and the A55 core(s), using a shared ringbuffer structure in this memory area.&lt;/P&gt;&lt;P&gt;The M33 can access the shared memory without problems, which does basically work on the A55 side, too, BUT: As soon as a connected GDB client tries to print the content of this shared memory, the program crashes with a segmentation fault:&lt;/P&gt;&lt;P&gt;Unable to handle kernel read from unreadable memory at virtual address ffff8000822e7000.&lt;/P&gt;&lt;P&gt;Which is strange, as the base of the shared memory block starts at&amp;nbsp;0x8F600000 and is mapped to virtual memory at FFFFF73E0000.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A bit more in detail:&lt;/P&gt;&lt;P&gt;We wanted to avoid to write a complete kernel driver for our needs, handling the memory access on user-space using the UIO drivers.&lt;/P&gt;&lt;P&gt;For this, we created two according entries in the device tree, defining the memory areas and assigning them to the UIO driver.&lt;/P&gt;&lt;P&gt;After mapping the memory area to a user-space area using mmap(), we can read and write the shared area without problems from both sides when not debugging/printing the memory areas using GDB.&lt;/P&gt;&lt;P&gt;Most IDEs and debugging frontends print local/function-local variables as soon as a breakpoint gets hit, leading to a quite unusable debugger for us, completely blocking our project at the moment &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As described here&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/654393/examining-mmaped-addresses-using-gdb" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/654393/examining-mmaped-addresses-using-gdb&lt;/A&gt;&amp;nbsp;, this problem was solved by adding a .access member to the&amp;nbsp;vm_operations_struct in the according (custom) kernel driver.&lt;/P&gt;&lt;P&gt;But as far as I can tell, the according method seems to be implemented in the UIO driver used by us (CONFIG_HAVE_IOREMAP_PROT is enabled):&amp;nbsp;&lt;A href="https://github.com/phytec/linux-phytec-imx/blob/v6.6.52-2.2.0-phy/drivers/uio/uio.c" target="_self"&gt;https://github.com/phytec/linux-phytec-imx/blob/v6.6.52-2.2.0-phy/drivers/uio/uio.c&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using a SOM board by PHYTEC and are currently using their carrier board hardware "PhyBOARD Nash" until our own hardware is finished. Hence, we mostly use patches as "quick and dirty" in our yocto layer for the moment.&lt;/P&gt;&lt;P&gt;Attached to this post is a archive containing a minimal working app example, and a down-stripped version of our current yocto meta-layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is pretty strange in my opinion, is that there are not much search results on the web about problems with UIO, mmap and gdb, but this seems to be a rather common way for accessing raw memory from user-space.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have an idea, why the GDB seems to access wrong, unmapped/unaccessible memory areas or what could be causing our problems here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance &amp;amp; best regards&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 13:49:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141791#M239626</guid>
      <dc:creator>Drehstromlampe</dc:creator>
      <dc:date>2025-07-28T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX93 Shared memory access using UIO/mmap crashes (Segfaults) only when debugging with GDB</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141815#M239628</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="rPeykc" data-hveid="CAUQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQo_EKegQIBRAB"&gt;&lt;SPAN data-huuid="13906457124653967581"&gt;you have to fo with Phytec for better reference on this.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967581"&gt;A segmentation fault (segfault) during debugging indicates that the program attempted to access a memory location it was not permitted to access. &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967546"&gt;This typically results in the operating system terminating the program with a SIGSEGV signal. &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967511"&gt;Debugging tools like GDB can help pinpoint the cause.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="rPeykc" data-hveid="CAUQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQo_EKegQIBRAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="rPeykc pyPiTc" data-hveid="CAIQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQo_EKegQIAhAB"&gt;&lt;SPAN data-huuid="13906457124653967441"&gt;Common causes of segmentation faults:&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="c140be1d-44a1-4c9a-b5b6-2a6d7d0126ed" data-uuids="13906457124653967441"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CAMQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIAxAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;&lt;SPAN data-huuid="13906457124653967336"&gt;&lt;STRONG&gt;Dereferencing a null or uninitialized pointer:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967301"&gt;Attempting to access memory through a pointer that does not point to a valid memory location.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV class="NPrrbc" data-cid="ee59bb17-767f-443d-97aa-cd261d2334fb" data-uuids="13906457124653967336,13906457124653967301"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CAoQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIChAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653967231"&gt;&lt;STRONG&gt;Out-of-bounds array access:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967196"&gt;Accessing an array element beyond its declared size.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="NPrrbc" data-cid="23ef22d2-25ab-4348-aab9-e96d27bedd6e" data-uuids="13906457124653967231,13906457124653967196"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CBQQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIFBAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653967126"&gt;&lt;STRONG&gt;Stack overflow:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653967091"&gt;Excessive recursion or large local variables consuming all available stack space.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653967021"&gt;&lt;STRONG&gt;Writing to read-only memory:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653966986"&gt;Attempting to modify a memory segment designated as read-only, such as the code segment.&lt;SPAN class="pjBG2e" data-cid="46eaa2e8-b899-40eb-ae04-e8bde35555ca"&gt;&lt;SPAN class="UV3uM"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-huuid="13906457124653966916"&gt;&lt;STRONG&gt;Use-after-free errors:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="13906457124653966881"&gt;Accessing memory after it has been deallocated.&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="NPrrbc" data-cid="83527df3-16eb-41da-b6cd-d4549b4311c9" data-uuids="13906457124653967126,13906457124653967091"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CBIQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIEhAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="NPrrbc" data-cid="46eaa2e8-b899-40eb-ae04-e8bde35555ca" data-uuids="13906457124653967021,13906457124653966986"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CBEQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIERAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="NPrrbc" data-cid="fec234f9-388a-49b9-8c31-2090bd083a7e" data-uuids="13906457124653966916,13906457124653966881"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CA0QAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIDRAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;UL data-hveid="CDAQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQm_YKegQIMBAB"&gt;
&lt;LI&gt;&lt;SPAN data-huuid="3750667719182199476"&gt;&lt;STRONG&gt;Obtain a backtrace:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;SPAN data-huuid="3750667719182199131"&gt;Once the segfault occurs, GDB will stop. &lt;/SPAN&gt;&lt;SPAN data-huuid="3750667719182198786"&gt;Use the &lt;CODE class="mv6bHd"&gt;bt&lt;/CODE&gt; (backtrace) command to see the call stack leading up to the crash. &lt;/SPAN&gt;&lt;SPAN data-huuid="3750667719182198441"&gt;This helps identify the function and line of code where the fault occurred.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN data-huuid="3750667719182198441"&gt;I&lt;/SPAN&gt;&lt;SPAN data-huuid="14725625559055708520"&gt;&lt;STRONG&gt;nspect variables and memory:&lt;/STRONG&gt; &lt;/SPAN&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="14725625559055709577"&gt;Navigate through the stack frames using &lt;CODE class="mv6bHd"&gt;frame N&lt;/CODE&gt; (where N is the frame number from the backtrace) and use &lt;CODE class="mv6bHd"&gt;print variable_name&lt;/CODE&gt; to inspect the values of relevant variables, especially pointers, to identify potential issues like null or invalid addresses.&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="51d00bd0-0ae3-4fd7-89a2-8d0fbc6b7e0d" data-uuids="14725625559055708520,14725625559055709577"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CDYQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQINhAB"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV data-crb-p=""&gt;
&lt;DIV class="xFTqob"&gt;
&lt;DIV class="Gur8Ad"&gt;&lt;SPAN data-huuid="14725625559055711691"&gt;&lt;STRONG&gt;Use memory analysis tools:&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="vM0jzc"&gt;&lt;SPAN data-huuid="14725625559055708652"&gt;Can be invaluable for detecting memory errors, including invalid memory accesses, uninitialized memory usage, and memory leaks, which can lead to segfaults.&lt;/SPAN&gt;
&lt;DIV class="NPrrbc" data-cid="b86e6eb4-d32e-4165-ac1d-3fb2120f97bd" data-uuids="14725625559055711691,14725625559055708652"&gt;
&lt;DIV class="BMebGe btku5b fCrZyc LwdV0e FR7ZSc qVhvac OJeuxf" tabindex="0" role="button" aria-label="Ver vínculos relacionados" data-hveid="CDkQAQ" data-ved="2ahUKEwjWyNzA4d-OAxUI8MkDHazJGZEQ3fYKegQIORAB"&gt;
&lt;DIV class="niO4u"&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="kHtcsd"&gt;Regards&lt;/DIV&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="kHtcsd"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;
&lt;DIV&gt;
&lt;DIV class="ecCNFc"&gt;
&lt;DIV class="zYSUYd"&gt;
&lt;DIV class="FS7GEb"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="WaaZC"&gt;
&lt;DIV class="RJPOee EIJn2" style="animation: none !important;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 14:31:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141815#M239628</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2025-07-28T14:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX93 Shared memory access using UIO/mmap crashes (Segfaults) only when debugging with GDB</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141863#M239630</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/34846"&gt;@Bio_TICFSL&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;thank you for your fast response.&lt;/P&gt;&lt;P&gt;Yes I am aware how a memory access fault could happen and the examples/causes you mentioned and described.&lt;/P&gt;&lt;P&gt;The GDB client itself seems to execute the wrong memory-read and causing the SIGSEGV crash, so this would not help us debug this issue, but seems to be causing it.&lt;/P&gt;&lt;P&gt;Perhaps you can you tell me, if in theory GDB should be able to access handled memory like we do (UIO + mmap)?&lt;/P&gt;&lt;P&gt;As unfortunately we can't test here at the moment with a "vanilla"/mainline kernel tree, as we are on the PHYTEC carrier board, we cannot check by ourselves if this is a PHYTEC branch or general (mainline) problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jul 2025 15:14:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX93-Shared-memory-access-using-UIO-mmap-crashes-Segfaults/m-p/2141863#M239630</guid>
      <dc:creator>Drehstromlampe</dc:creator>
      <dc:date>2025-07-28T15:14:16Z</dc:date>
    </item>
  </channel>
</rss>

