<?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>ColdFire/68K Microcontrollers and Processorsのトピックsh breaks down</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/sh-breaks-down/m-p/161608#M5160</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm developing an application on an MCF54452 processor with an embedded linux port that uses busybox.&lt;/P&gt;&lt;P&gt;When executing my process I am getting this error message after some ENTER or ps or ls in shell and the system hangs up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*** glibc detected *** -sh: free(): invalid pointer: 0x801d22b8 ***&lt;/P&gt;&lt;P&gt;======= Backtrace: =========&lt;/P&gt;&lt;P&gt;/lib/libc.so.6[0x8012fdac]&lt;/P&gt;&lt;P&gt;/lib/libc.so.6[0x80131252]&lt;/P&gt;&lt;P&gt;/lib/libc.so.6(cfree+0xa2)[0x801313a4]&lt;/P&gt;&lt;P&gt;-sh[0x8004eebc]&lt;/P&gt;&lt;P&gt;======= Memory map: ========&lt;/P&gt;&lt;P&gt;80000000-8007c000 r-xp 00000000 1f:0ï¿½&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I remarked that when I declare a global buffer of more than 60KB the problem vanished !!!! Here is a trace of the shared memory buffers (allocated with shmget() and shmatt() ), you can see that the wrong pointer address is in the range of allocated buffers!!&lt;/P&gt;&lt;P&gt;Can anyone give me an explanation of that ? sh code space isn't protected from other processes ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----&amp;gt; with buffer&lt;/P&gt;&lt;P&gt;========&amp;gt; 232 - 0x801D4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 231 - 0x801D8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 250 - 0x801DC000&lt;/P&gt;&lt;P&gt;========&amp;gt; 230 - 0x801DE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 229 - 0x801E0000&lt;/P&gt;&lt;P&gt;========&amp;gt; 242 - 0x801E2000&lt;/P&gt;&lt;P&gt;========&amp;gt; 228 - 0x801E4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 245 - 0x801E6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 247 - 0x801F4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 224 - 0x801F6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 223 - 0x801F8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 251 - 0x801FA000&lt;/P&gt;&lt;P&gt;========&amp;gt; 79 - 0x801FC000&lt;/P&gt;&lt;P&gt;========&amp;gt; 78 - 0x801FE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 77 - 0x80200000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&amp;gt; Without buffer&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE8 - 0x801C6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE7 - 0x801CA000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xFA - 0x801CE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE6 - 0x801D0000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE5 - 0x801D2000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xF2 - 0x801D4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE4 - 0x801D6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xF5 - 0x801D8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xF7 - 0x801E6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE0 - 0x801E8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xDF - 0x801EA000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xFB - 0x801EC000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0x4F - 0x801EE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0x4E - 0x801F0000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0x4D - 0x801F2000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Dec 2009 21:57:51 GMT</pubDate>
    <dc:creator>MFM</dc:creator>
    <dc:date>2009-12-15T21:57:51Z</dc:date>
    <item>
      <title>sh breaks down</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/sh-breaks-down/m-p/161608#M5160</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm developing an application on an MCF54452 processor with an embedded linux port that uses busybox.&lt;/P&gt;&lt;P&gt;When executing my process I am getting this error message after some ENTER or ps or ls in shell and the system hangs up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;*** glibc detected *** -sh: free(): invalid pointer: 0x801d22b8 ***&lt;/P&gt;&lt;P&gt;======= Backtrace: =========&lt;/P&gt;&lt;P&gt;/lib/libc.so.6[0x8012fdac]&lt;/P&gt;&lt;P&gt;/lib/libc.so.6[0x80131252]&lt;/P&gt;&lt;P&gt;/lib/libc.so.6(cfree+0xa2)[0x801313a4]&lt;/P&gt;&lt;P&gt;-sh[0x8004eebc]&lt;/P&gt;&lt;P&gt;======= Memory map: ========&lt;/P&gt;&lt;P&gt;80000000-8007c000 r-xp 00000000 1f:0ï¿½&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I remarked that when I declare a global buffer of more than 60KB the problem vanished !!!! Here is a trace of the shared memory buffers (allocated with shmget() and shmatt() ), you can see that the wrong pointer address is in the range of allocated buffers!!&lt;/P&gt;&lt;P&gt;Can anyone give me an explanation of that ? sh code space isn't protected from other processes ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----&amp;gt; with buffer&lt;/P&gt;&lt;P&gt;========&amp;gt; 232 - 0x801D4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 231 - 0x801D8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 250 - 0x801DC000&lt;/P&gt;&lt;P&gt;========&amp;gt; 230 - 0x801DE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 229 - 0x801E0000&lt;/P&gt;&lt;P&gt;========&amp;gt; 242 - 0x801E2000&lt;/P&gt;&lt;P&gt;========&amp;gt; 228 - 0x801E4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 245 - 0x801E6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 247 - 0x801F4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 224 - 0x801F6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 223 - 0x801F8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 251 - 0x801FA000&lt;/P&gt;&lt;P&gt;========&amp;gt; 79 - 0x801FC000&lt;/P&gt;&lt;P&gt;========&amp;gt; 78 - 0x801FE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 77 - 0x80200000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;----&amp;gt; Without buffer&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE8 - 0x801C6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE7 - 0x801CA000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xFA - 0x801CE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE6 - 0x801D0000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE5 - 0x801D2000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xF2 - 0x801D4000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE4 - 0x801D6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xF5 - 0x801D8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xF7 - 0x801E6000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xE0 - 0x801E8000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xDF - 0x801EA000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0xFB - 0x801EC000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0x4F - 0x801EE000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0x4E - 0x801F0000&lt;/P&gt;&lt;P&gt;========&amp;gt; 0x4D - 0x801F2000&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Dec 2009 21:57:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/sh-breaks-down/m-p/161608#M5160</guid>
      <dc:creator>MFM</dc:creator>
      <dc:date>2009-12-15T21:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: sh breaks down</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/sh-breaks-down/m-p/161609#M5161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Here is the output of /proc/PID/maps:&lt;BR /&gt;/ # cat /proc/465/maps&lt;BR /&gt;80000000-80036000 r-xp 00000000 00:0d 203 /home/itlapp/modules/busmanager&lt;BR /&gt;80036000-8003a000 rw-p 00034000 00:0d 203 /home/itlapp/modules/busmanager&lt;BR /&gt;8003a000-80054000 rwxp 8003a000 00:00 0 [heap]&lt;BR /&gt;80054000-8006a000 r-xp 00000000 1f:04 325 /lib/ld-2.5.so&lt;BR /&gt;8006a000-8006e000 rw-p 00014000 1f:04 325 /lib/ld-2.5.so&lt;BR /&gt;8006e000-80076000 r-xp 00000000 1f:04 365 /lib/librt-2.5.so&lt;BR /&gt;80076000-80078000 rw-p 00006000 1f:04 365 /lib/librt-2.5.so&lt;BR /&gt;80078000-80082000 rw-p 80078000 00:00 0&lt;BR /&gt;80082000-80178000 r-xp 00000000 1f:04 334 /lib/libc-2.5.so&lt;BR /&gt;80178000-80180000 rw-p 000f4000 1f:04 334 /lib/libc-2.5.so&lt;BR /&gt;80180000-80182000 rw-p 80180000 00:00 0&lt;BR /&gt;80182000-80190000 r-xp 00000000 1f:04 361 /lib/libpthread-0.10.so&lt;BR /&gt;80190000-80192000 rw-p 0000c000 1f:04 361 /lib/libpthread-0.10.so&lt;BR /&gt;&lt;FONT color="Red"&gt;80192000-801d4000 rw-p 80192000 00:00 0&lt;/FONT&gt; &lt;BR /&gt;bfd82000-bfdac000 rwxp bffd6000 00:00 0 [stack]&lt;BR /&gt;&lt;BR /&gt;and for sh:&lt;BR /&gt;/ # cat /proc/477/maps&lt;BR /&gt;80000000-8007c000 r-xp 00000000 1f:04 21 /bin/busybox&lt;BR /&gt;8007c000-80080000 rw-p 0007a000 1f:04 21 /bin/busybox&lt;BR /&gt;80080000-8008a000 rwxp 80080000 00:00 0 [heap]&lt;BR /&gt;8008a000-800a0000 r-xp 00000000 1f:04 325 /lib/ld-2.5.so&lt;BR /&gt;800a0000-800a4000 rw-p 00014000 1f:04 325 /lib/ld-2.5.so&lt;BR /&gt;800a4000-800aa000 r-xp 00000000 1f:04 338 /lib/libcrypt-2.5.so&lt;BR /&gt;800aa000-800ac000 rw-p 00004000 1f:04 338 /lib/libcrypt-2.5.so&lt;BR /&gt;800ac000-800d2000 rw-p 800ac000 00:00 0&lt;BR /&gt;800d2000-801c8000 r-xp 00000000 1f:04 334 /lib/libc-2.5.so&lt;BR /&gt;801c8000-801d0000 rw-p 000f4000 1f:04 334 /lib/libc-2.5.so&lt;BR /&gt;&lt;FONT color="Red"&gt;801d0000-802d4000 rw-p 801d0000 00:00 0&lt;/FONT&gt;&lt;BR /&gt;bfb20000-bfb4a000 rwxp bffd6000 00:00 0 [stack]&lt;BR /&gt;&lt;BR /&gt;When I added a declaration of a global buffer of almost 60KB I remarked that the overlapping happens no more and all is ok&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:09:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/sh-breaks-down/m-p/161609#M5161</guid>
      <dc:creator>MFM</dc:creator>
      <dc:date>2009-12-16T16:09:42Z</dc:date>
    </item>
  </channel>
</rss>

