Segfault in msvcrt

I am getting a strange runtime exception and gdb in pointing to an empty line in my code. The weirdest part, is if I set a breakpoint to the line it's crashing on, it runs fine.

Here is the callstack:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#0 773343B0	ntdll!RtlMultiByteToUnicodeN() (C:\Windows\system32\ntdll.dll:??)
#1 00000000	0x003a0000 in ??() (??:??)
#2 77333587	ntdll!RtlFindClearRuns() (C:\Windows\system32\ntdll.dll:??)
#3 00000000	0x003a0000 in ??() (??:??)
#4 77333472	ntdll!RtlLargeIntegerShiftRight() (C:\Windows\system32\ntdll.dll:??)
#5 00000000	0x003a1960 in ??() (??:??)
#6 773D162E	ntdll!RtlValidateHeap() (C:\Windows\system32\ntdll.dll:??)
#7 00000000	0x003a0000 in ??() (??:??)
#8 7738AB3A	ntdll!AlpcMaxAllowedMessageLength() (C:\Windows\system32\ntdll.dll:??)
#9 00000000	0x003a0000 in ??() (??:??)
#10 77333472	ntdll!RtlLargeIntegerShiftRight() (C:\Windows\system32\ntdll.dll:??)
#11 00000000	0x003a1960 in ??() (??:??)
#12 769998CD	msvcrt!free() (C:\Windows\syswow64\msvcrt.dll:??)
#13 00000000	0x003a0000 in ??() (??:??)
#14 00409F38	::EquationSolve(this=0x28fe70, equation=...) (C:\Users\Richard\Dropbox\Code\\\Solver.cpp:302)
#15 0040B262	::Solve(this=0x28fe70, equation=...) (C:\Users\Richard\Dropbox\Code\\\.cpp:56)
#16 0040AD17	main() (C:\Users\Richard\Dropbox\Code\\\.Test\main.cpp:9) 


The code is way to long to post entirely, but here is the block right before the crash line:
1
2
3
4
5
6
7
8
9
10
11
        if (!nOps)
        {
            for (int i=begins; i<=ends; i++)
            {
                if (GetChunkType(eqParse[i]) != CHUNK_NULL)
                {
                    resultString = eqParse[i];
                    break;
                }
            }
        }
Last edited on
You've corrupted the heap somewhere in your app. It's most probably a buffer overrun. Did you get that with a debug or release build? If it's a debug build, you can use the heap diagnostics to help you.
How do I use that?
Topic archived. No new replies allowed.