Crash due to SIGABRT on Linux C++ PowerPC
<p>My program crashes in string assign. I cannot corner down the exact cause of it. Multiple threads execute the same code.</p>

<p>This is my code.</p>

<pre><code> char* cTemp = new char[5];
    memset(cTemp,'\0', 5);
    snprintf(cTemp , 5 , "%04x" , iParameter);
    string sVar1 = cTemp;
    delete[] cTemp;
    if(sVar1 == "0")
    sVar1 = "0000";
    pSharedLib-&gt;setVar1(sVar1);
</code></pre>

<p>The set Function(in shared library)</p>

<pre><code> bool A::setVar1(CString&amp; temp)
    {   
    m_sVar1= temp;
    return true;
    }
</code></pre>

<p>The crash bt shows the error as </p>

<pre><code>#0 0x48194444 in raise () from /lib/libc.so.6
#0 0x48194444 in raise () from /lib/libc.so.6
No symbol table info available.
#1 0x48199694 in abort () from /lib/libc.so.6
No symbol table info available.
#2 0x481d4ecc in ?? () from /lib/libc.so.6
No symbol table info available.
#3 0x481e14d4 in ?? () from /lib/libc.so.6
No symbol table info available.
#4 0x481e32b0 in free () from /lib/libc.so.6
No symbol table info available.
#5 0x480df8b8 in operator delete(void*) () from /usr/lib/libstdc++.so.6
No symbol table info available.
#6 0x480b136c in std::string::_Rep::_M_destroy(std::allocator&lt;char&gt; const&amp;)
() from /usr/lib/libstdc++.so.6
No symbol table info available.
#7 0x480b35f4 in std::string::assign(std::string const&amp;) ()
from /usr/lib/libstdc++.so.6
No symbol table info available.
</code></pre>
