<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>malloc causes crash</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/39884/malloc-causes-crash</link><description> 
hi there, 

 
I&amp;#39;m developing a C program for an embedded device in order to use
it as a pad which is able to recognize handwriting. In short, the
program is supposed to extract several features of the signature and
calculate a biometric hash. 

 
Sadly</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: malloc causes crash</title><link>https://community.arm.com/thread/106343?ContentTypeID=1</link><pubDate>Sat, 08 Sep 2012 01:59:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f87f0cae-e5fd-4f29-8810-f491e9fa8a74</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
That is the fundamental problem with dynamic allocation!&lt;/p&gt;

&lt;p&gt;
And it&amp;#39;s a particular difficulty for &lt;b&gt;embedded&lt;/b&gt; systems as
you can&amp;#39;t just put up a user dialogue saying, &amp;quot;out of memory&amp;quot;!&lt;/p&gt;

&lt;p&gt;
This is why dynamic allocation may be best avoided in
&lt;b&gt;embedded&lt;/b&gt; systems...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: malloc causes crash</title><link>https://community.arm.com/thread/80528?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2012 19:34:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:617abc14-fc86-41d8-be48-9ee1b96688d0</guid><dc:creator>William Cofex</dc:creator><description>&lt;p&gt;&lt;p&gt;
awww, yes I configured the heap, just saw that I transposed two
digits -.-&lt;/p&gt;

&lt;p&gt;
Sadly I also realized there are some loops where I reallocate some
memory. This turns out to cause the actual Heap-Overflow.&lt;/p&gt;

&lt;p&gt;
It will be hard to find a workaround, cause I&amp;#39;m using the heap for
dynamic arrays, which seem to be much larger than expected, where all
entries are equally important.&lt;/p&gt;

&lt;p&gt;
Thanks for the hint, after all it wasn&amp;#39;t so hard to find the cause
for the problem.&lt;/p&gt;

&lt;p&gt;
Bye&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: malloc causes crash</title><link>https://community.arm.com/thread/67694?ContentTypeID=1</link><pubDate>Fri, 07 Sep 2012 10:38:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a2dec3fe-1bfa-4e35-87f7-4ecfa3afeea4</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Have you configured a heap for your project?&lt;/p&gt;

&lt;p&gt;
If yes - try and cut away code from your project until you can get
the smallest possible program that still crashes - chances are that
you have an error somewhere that overwrites some critical structure
for the runtime library.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>