C++ Program crashes when string and int pointer are used together as function arguments
<p>I have a super weird problem with glibc on Ubuntu.</p>

<p>Sample program test.cpp:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;

using namespace std;

bool abc(string unitstr,int *data)
{        

}

int main(int argc,char *argv[])
{

  int *dd3 = new int(8); 
  dd3[0]=1;dd3[1]=2;dd3[2]=3;dd3[3]=4;
  dd3[4]=5;dd3[5]=6;dd3[6]=7;dd3[7]=8;
  abc("sss",dd3);

  return 1;
}
</code></pre>

<p>Compile and run:</p>

<pre><code>g++ test.cpp
a.out
</code></pre>

<p>Result:</p>

<pre><code>a.out: malloc.c:2451: sYSMALLOc: Assertion `(old_top == (((mbinptr) (((char *) &amp;((av)-&gt;bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) &amp;&amp; old_size == 0) || ((unsigned long) (old_size) &gt;= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) &amp; ~((2 * (sizeof(size_t))) - 1))) &amp;&amp; ((old_top)-&gt;size &amp; 0x1) &amp;&amp; ((unsigned long)old_end &amp; pagemask) == 0)' failed.
Abort (core dumped)
</code></pre>
