<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[malloc Crash]]></title><description><![CDATA[<p>Hi nochmal,</p>
<p>so, da sich das andere Problem mit _realloc sozusagen selbst aufgelöst hat, hier nun unser neues Problem, gleicher Bauart:</p>
<pre><code class="language-cpp">class CMoooh
{
public:
    CMoooh();

public:
    char* blubb;
};
</code></pre>
<pre><code class="language-cpp">CMoooh::CMoooh()
{
    blubb = NULL;
}

void Test()
{
    CMoooh cif;
    cif.blubb = new char[32000]; // Hier!
}
</code></pre>
<p>Jener Code (sinnwahrend gekürzt) stürzt an mit &quot;Hier!&quot; markierter Stelle ab. Unabhängig davon, wie groß der Puffer ist. Warum? Was ist da falsch? Der Stacktrace verweist zuletzt auf einen malloc-Aufruf.</p>
<p>Danke!</p>
<p>Grüße, Hendrik</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/190261/malloc-crash</link><generator>RSS for Node</generator><lastBuildDate>Sat, 11 Apr 2026 16:55:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/190261.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Aug 2007 09:57:31 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 09:57:31 GMT]]></title><description><![CDATA[<p>Hi nochmal,</p>
<p>so, da sich das andere Problem mit _realloc sozusagen selbst aufgelöst hat, hier nun unser neues Problem, gleicher Bauart:</p>
<pre><code class="language-cpp">class CMoooh
{
public:
    CMoooh();

public:
    char* blubb;
};
</code></pre>
<pre><code class="language-cpp">CMoooh::CMoooh()
{
    blubb = NULL;
}

void Test()
{
    CMoooh cif;
    cif.blubb = new char[32000]; // Hier!
}
</code></pre>
<p>Jener Code (sinnwahrend gekürzt) stürzt an mit &quot;Hier!&quot; markierter Stelle ab. Unabhängig davon, wie groß der Puffer ist. Warum? Was ist da falsch? Der Stacktrace verweist zuletzt auf einen malloc-Aufruf.</p>
<p>Danke!</p>
<p>Grüße, Hendrik</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348838</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348838</guid><dc:creator><![CDATA[SeveQ]]></dc:creator><pubDate>Tue, 21 Aug 2007 09:57:31 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 10:07:49 GMT]]></title><description><![CDATA[<p>Kannst du im Stack mal etwas nach oben gehen, um zu sehen, von wo aus malloc() aufgerufen wird? (auch wenn's nicht erforderlich ist, wird operator new oft auf malloc() zurückgeführt)</p>
<p>PS: Und deine Probleme dürften nicht von der Anweisung (bzw. dem realloc()-Aufruf aus deinem letzten Thread) stammen - du hast dir irgendwo anders mächtig den Heap zerlegt, indem du irgendwo über das Ende des angeforderten Speicherbereiches hinausgeschrieben hast. (im Debug-Modus waren dort vermutlich &quot;nur&quot; Füllbytes als Sicherheitszone, im Release-Modus aber Steuerdaten des Heap-Managers)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348849</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 21 Aug 2007 10:07:49 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 11:10:25 GMT]]></title><description><![CDATA[<p>Ist Dein Heap zu diesem Zeitpunkt evtl. schon zerstört, wenn diese Funktion aufgerufen wird?<br />
Was steht in Der Debug Ausgabe? Wie lautet die ASSERT Zeile?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348885</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 21 Aug 2007 11:10:25 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 11:14:04 GMT]]></title><description><![CDATA[<p>Gibt es nicht 'ne Software, die mir genau dieses über die Heapgrenzen hinaus Schreiben melden kann? Ich meine, mal sowas gehört zu haben.</p>
<p>Wie mache ich einen Stacktrace von einem Fehler, der im Debugger nicht aufzutreten scheint?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348887</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348887</guid><dc:creator><![CDATA[SeveQ]]></dc:creator><pubDate>Tue, 21 Aug 2007 11:14:04 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 11:31:11 GMT]]></title><description><![CDATA[<p>SeveQ schrieb:</p>
<blockquote>
<p>Gibt es nicht 'ne Software, die mir genau dieses über die Heapgrenzen hinaus Schreiben melden kann? Ich meine, mal sowas gehört zu haben.</p>
</blockquote>
<p>Ja, gibt es, mir fällt da ad hoc Boundschecker ein.</p>
<blockquote>
<p>Wie mache ich einen Stacktrace von einem Fehler, der im Debugger nicht aufzutreten scheint?</p>
</blockquote>
<p>Du hast entweder ein Initialisierungsproblem oder schreibst irgendwo mit einem (wahrscheinlich zu weit inkrementierten) Index oder Pointer in Speicherbereiche, die Du nicht allokiert hast.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348893</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Tue, 21 Aug 2007 11:31:11 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 11:46:04 GMT]]></title><description><![CDATA[<p>Okay, also hier mal der Stacktrace des Absturzes beim 'new'. Hoffe, es kann jemand damit was anfangen (Access Violation 0xC0000005 at 0x7C911C20).</p>
<p>Aber ich glaub, wir ham's gleich... Timing Problem zwischen Threads, vermutlich. Das ganze läuft ja in 'nem COM Objekt. Und da wird vermutlich von verschiedenen Seiten gleichzeitig auf den Heap zugegriffen und selbiger dadurch völlig verhunzt. Also unser'n Code alles in 'ne Critical Section... mal sehen, ob das Abhilfe schafft.</p>
<p>Weitere Kommentare sind gern gesehen!</p>
<p>EDIT: Übrigens, zum Thema BoundsChecker... wo findet man den denn? NuMega gibt's ja nun schon 'ne ganze Weile nicht mehr? Wurde der irgendwo weiterentwickelt? Andere Software, die genau in diese Kerbe haut?</p>
<p>Trace:</p>
<pre><code>Stack Frames at EIP: 0x7C911C20 - PID: 3244 TID: 3836
0x7C911C20: ntdll.dll:RtlInitializeCriticalSection + 0x00F3
0x7C91825D: ntdll.dll:RtlReAllocateHeap + 0x0860
0x7C911C76: ntdll.dll:RtlInitializeCriticalSection + 0x0149
0x10212F4C: MSVCR80D.dll!_heap_alloc_base + 0x005C &lt;Void *&gt;
0x1021AE15: MSVCR80D.dll!_heap_alloc_dbg + 0x01F5 &lt;Void *&gt;
0x1021ABA9: MSVCR80D.dll!_nh_malloc_dbg + 0x0019 &lt;Void *&gt;
0x1021AB29: MSVCR80D.dll!malloc + 0x0019 &lt;Void *&gt;
0x1026908F: MSVCR80D.dll!operator new + 0x000F &lt;Void *&gt;
0x034A3739: IDA.DLL!CMMLEvents::OnCommand + 0x00F9 &lt;Hresult&gt;
0x771273D0: OLEAUT32.DLL!DispCallFunc + 0x00C3
0x0349EC35: IDA.DLL!ATL::IDispEventSimpleImpl&lt;1,CMMLEvents,&amp;Ists::DIID_IMMLEvents&gt;::InvokeFromFuncInfo + 0x01B5 &lt;Hresult&gt;
0x0349E585: IDA.DLL!ATL::IDispEventSimpleImpl&lt;1,CMMLEvents,&amp;Ists::DIID_IMMLEvents&gt;::Invoke + 0x00F5 &lt;Hresult&gt;
0x7719BF39: OLEAUT32.DLL!VarDecCmpR8 + 0x125F
0x7719B1BD: OLEAUT32.DLL!VarDecCmpR8 + 0x04E3
0x77EF4047: RPCRT4.DLL!NdrProxyFreeBuffer + 0x00B5
0x77EF3BF3: RPCRT4.DLL!CStdStubBuffer_Invoke + 0x0082
0x7717E5F0: OLEAUT32.DLL!VarMonthName + 0xD050
0x77600C31: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x10439
0x77600BDB: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x103E3
0x7750F237: OLE32.DLL!CoReleaseMarshalData + 0x07DC
0x7750F15C: OLE32.DLL!CoReleaseMarshalData + 0x0701
0x7750FC79: OLE32.DLL!DcomChannelSetHResult + 0x05BA
0x77600E3B: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x10643
0x776009BC: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x101C4
0x77600DF2: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x105FA
0x7750FCB3: OLE32.DLL!DcomChannelSetHResult + 0x05F4
0x7750FAE9: OLE32.DLL!DcomChannelSetHResult + 0x042A
0x77D48734: USER32.DLL!GetDC + 0x006D
0x77D48816: USER32.DLL!GetDC + 0x014F
0x77D489CD: USER32.DLL!GetWindowLongW + 0x0127
0x7750FA56: OLE32.DLL!DcomChannelSetHResult + 0x0397
0x77D48A10: USER32.DLL!DispatchMessageW + 0x000F
0x77512C02: OLE32.DLL!CoImpersonateClient + 0x01D3
0x77512BD2: OLE32.DLL!CoImpersonateClient + 0x01A3
0x77512B76: OLE32.DLL!CoImpersonateClient + 0x0147
0x77512B33: OLE32.DLL!CoImpersonateClient + 0x0104
0x7751235C: OLE32.DLL!CoUnmarshalInterface + 0x1509
0x776017A2: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x10FAA
0x776011B6: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x109BE
0x7760109A: OLE32.DLL!StgGetIFillLockBytesOnFile + 0x108A2
0x77512409: OLE32.DLL!CoUnmarshalInterface + 0x15B6
0x775123B2: OLE32.DLL!CoUnmarshalInterface + 0x155F
0x77510414: OLE32.DLL!DcomChannelSetHResult + 0x0D55
0x77EF3DB5: RPCRT4.DLL!NdrProxySendReceive + 0x0040
0x77EF3EAC: RPCRT4.DLL!NdrProxySendReceive + 0x0137
0x77EF3E42: RPCRT4.DLL!NdrProxySendReceive + 0x00CD
0x77E89AA4: RPCRT4.DLL!NdrComplexArrayMemorySize + 0x0695
0x0349D4AF: IDA.DLL!CISTSConnection::SendMMLCommand + 0x009F &lt;Hresult&gt;
0x0349A8DA: IDA.DLL!CidaRowset::fInitISTS + 0x00AA &lt;Hresult&gt;
0x03459921: IDA.DLL!CidaRowset::Execute + 0x0121 &lt;Hresult&gt;
0x0349C52D: IDA.DLL!ATL::ICommandImpl&lt;CidaCommand,ICommandText&gt;::CreateRowset&lt;CidaRowset&gt; + 0x084D &lt;Hresult&gt;
0x0349A7BE: IDA.DLL!CidaCommand::Execute + 0x003E &lt;Hresult&gt;
0x4DE3062D: msado15.dll!DllCanUnloadNow + 0x6737
0x4DE3AAAE: msado15.dll!DllCanUnloadNow + 0x10BB8
0x4DE1A2B9: msado15.dll!DllGetClassObject + 0x297E
0x4DE1A1C2: msado15.dll!DllGetClassObject + 0x2887
0x4DE19EDB: msado15.dll!DllGetClassObject + 0x25A0
0x4DE2ED72: msado15.dll!DllCanUnloadNow + 0x4E7C
0x6502124A: VBE6.DLL!rtcDoEvents + 0x1622
0x771273D0: OLEAUT32.DLL!DispCallFunc + 0x00C3
0x6509C10E: VBE6.DLL!DllVbeTerm + 0xB948
0x77D48734: USER32.DLL!GetDC + 0x006D
0x650BED01: VBE6.DLL!rtcShell + 0x1EE21
0x650BEC19: VBE6.DLL!rtcShell + 0x1ED39
0x65032E24: VBE6.DLL!VarPtr + 0xA29E
0x651FB534: VBE6.DLL!rtcStrConvVar2 + 0x129A1
0x60012EDD: FM20.DLL!DllGetClassObject + 0x1099D
0x60015E3D: FM20.DLL!DllGetClassObject + 0x138FD
0x77D48734: USER32.DLL!GetDC + 0x006D
0x77D48816: USER32.DLL!GetDC + 0x014F
0x6000D2EF: FM20.DLL!DllGetClassObject + 0xADAF
0x6001AAC4: FM20.DLL!DllGetClassObject + 0x18584
0x6001AEBC: FM20.DLL!DllGetClassObject + 0x1897C
0x60015E3D: FM20.DLL!DllGetClassObject + 0x138FD
0x77D48734: USER32.DLL!GetDC + 0x006D
0x77D48816: USER32.DLL!GetDC + 0x014F
0x77D489CD: USER32.DLL!GetWindowLongW + 0x0127
0x77D48A10: USER32.DLL!DispatchMessageW + 0x000F
0x30022A3F: EXCEL.EXE:Ordinal44 + 0x22A3F
0x30001F67: EXCEL.EXE:Ordinal44 + 0x1F67
0x30001CAB: EXCEL.EXE:Ordinal44 + 0x1CAB
0x7C816FD7: KERNEL32.DLL!RegisterWaitForInputIdle + 0x0049
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1348898</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348898</guid><dc:creator><![CDATA[SeveQ]]></dc:creator><pubDate>Tue, 21 Aug 2007 11:46:04 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 12:16:53 GMT]]></title><description><![CDATA[<p>Der Stack Trace sagt mir so nichts. Vermutlkich ist der Heap schon zerstört.</p>
<p>Man kann auch einfach an einigen Stellen, die oft aufgerufen werden</p>
<pre><code class="language-cpp">ASSERT(AfxCheckMemory());
</code></pre>
<p>Einbauen. Dieser Assert meldet sich sofort wen man Speicher illegal über Grenzen hinweg überschreibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348948</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 21 Aug 2007 12:16:53 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 12:19:39 GMT]]></title><description><![CDATA[<p>Habe ich vergessen:</p>
<p>Man kann auch _CrtSetDbgFlag _CRTDBG_CHECK_ALWAYS_DF verwenden. Dann wird sofort nach jeder Allokation ein Heap Check durchgeführt.<br />
Wurde er in der zwischenzeit zerstört, dann hat man zumindest einen nahen Anhaltspunkt.</p>
<p>_CRTDBG_DELAY_FREE_MEM_DF kann auch noch helfen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348952</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348952</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Tue, 21 Aug 2007 12:19:39 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 12:46:18 GMT]]></title><description><![CDATA[<p>SeveQ schrieb:</p>
<blockquote>
<p>EDIT: Übrigens, zum Thema BoundsChecker... wo findet man den denn?</p>
</blockquote>
<p>gibt da so ne ganz verrückte neue erfindung die heißt suchmaschine. die findet sachen im internet wenn man ihr sagt was man sucht. muss man nur kennen. eine von denen heißt guhgl oder so ähnlich, da hab ich mal &quot;boundschecker&quot; eingegeben und die hat tatsächlich rausgefunden wo es das gibt!!!1 krass, ne?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348983</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348983</guid><dc:creator><![CDATA[medienkompetenz]]></dc:creator><pubDate>Tue, 21 Aug 2007 12:46:18 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Tue, 21 Aug 2007 12:51:24 GMT]]></title><description><![CDATA[<p>medienkompetenz schrieb:</p>
<blockquote>
<p>SeveQ schrieb:</p>
<blockquote>
<p>EDIT: Übrigens, zum Thema BoundsChecker... wo findet man den denn?</p>
</blockquote>
<p>gibt da so ne ganz verrückte neue erfindung die heißt suchmaschine. die findet sachen im internet wenn man ihr sagt was man sucht. muss man nur kennen. eine von denen heißt guhgl oder so ähnlich, da hab ich mal &quot;boundschecker&quot; eingegeben und die hat tatsächlich rausgefunden wo es das gibt!!!1 krass, ne?</p>
</blockquote>
<p>Naja, gaaaaanz doof bin ich auch nicht, nur anscheinend doof genug, daß ich's da nicht finde. Da hab ich nämlich natürlich zuerst geschaut.<br />
Mal wieder klarer Fall von</p>
<p>SeveQ vs. Google... and the Winner is: Google!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1348990</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1348990</guid><dc:creator><![CDATA[SeveQ]]></dc:creator><pubDate>Tue, 21 Aug 2007 12:51:24 GMT</pubDate></item><item><title><![CDATA[Reply to malloc Crash on Wed, 22 Aug 2007 08:08:13 GMT]]></title><description><![CDATA[<p>SeveQ schrieb:</p>
<blockquote>
<p>EDIT: Übrigens, zum Thema BoundsChecker... wo findet man den denn? NuMega gibt's ja nun schon 'ne ganze Weile nicht mehr? Wurde der irgendwo weiterentwickelt? Andere Software, die genau in diese Kerbe haut?</p>
</blockquote>
<p>IIRC dann ist BoundsChecker bei Compuware gelandet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1349556</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1349556</guid><dc:creator><![CDATA[jencas]]></dc:creator><pubDate>Wed, 22 Aug 2007 08:08:13 GMT</pubDate></item></channel></rss>