<?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 Bug in Redlib malloc in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597123#M32145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by udoeb on Wed Nov 05 10:38:26 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using LPC1857 and LPCXpresso 7.4.0 and found a bug in malloc(). Steps to reproduce:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp; void* p = malloc(200);
&amp;nbsp; free(p);
&amp;nbsp; p = malloc(200);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second call to malloc crashes internally with a memory fault exception because the function dereferences a NULL pointer.This exception shows up only if the MPU is enabled and configured so that zero is a protected address. I'm using this MPU setup to detect mistakes in my own code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the MPU is not enabled then malloc does not crash. However, it uses a random value read from address zero then. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to continue using the MPU to detect NULL pointer issues in my own code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Is the source code of Redlib available?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) How can I get a fix for this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Udo Eberhardt&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:39:51 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:39:51Z</dc:date>
    <item>
      <title>Bug in Redlib malloc</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597123#M32145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by udoeb on Wed Nov 05 10:38:26 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using LPC1857 and LPCXpresso 7.4.0 and found a bug in malloc(). Steps to reproduce:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
&amp;nbsp; void* p = malloc(200);
&amp;nbsp; free(p);
&amp;nbsp; p = malloc(200);
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second call to malloc crashes internally with a memory fault exception because the function dereferences a NULL pointer.This exception shows up only if the MPU is enabled and configured so that zero is a protected address. I'm using this MPU setup to detect mistakes in my own code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If the MPU is not enabled then malloc does not crash. However, it uses a random value read from address zero then. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to continue using the MPU to detect NULL pointer issues in my own code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Is the source code of Redlib available?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) How can I get a fix for this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Udo Eberhardt&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:39:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597123#M32145</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in Redlib malloc</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597124#M32146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Wed Nov 05 10:46:14 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for reporting this issue. This problem is fixed in the next release of LPCXpresso (which will be released very shortly).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:39:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597124#M32146</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in Redlib malloc</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597125#M32147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Thu Nov 06 06:26:19 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: lpcxpresso-support&lt;/STRONG&gt;&lt;BR /&gt;Thanks for reporting this issue. This problem is fixed in the next release of LPCXpresso (which will be released very shortly).&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso 7.5.0 is now available and should fix this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:39:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597125#M32147</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bug in Redlib malloc</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597126#M32148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by udoeb on Tue Nov 11 07:37:50 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Dear LPCXpresso Support,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I confirm that in v7.5.0 this issue is fixed. Thank you very much!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Udo&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:39:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Bug-in-Redlib-malloc/m-p/597126#M32148</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:39:53Z</dc:date>
    </item>
  </channel>
</rss>

