CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: what may cause this error?

  1. #1
    Join Date
    Jun 2007
    Posts
    14

    Question what may cause this error?

    I am working on a simulation program, which simulates a complex dynamic environment with lots of class construction and destructions. I used <vector> to store pointers to these classes.

    The program showed some error message after running for about 40 minutes. (This is very frustrating, each time I put some message into the code to locate the error, I have to wait for 40 min to see the message show up. If anybody knows a better way of debuging this kind of error, please let me know!)

    If I run the exe directly, then the program shows some error(not mentioning any specific information about the error, no error report at all), then no matter what my choice is(retry, ignore, abort), the program break down.

    If I run the program under F5 mode, then It show message "Unhandled exception in simulation.exe(KERNEL32.DLL) :0xE06D7363: Microsoft C++ Exception. "Then I clicked OK, then the compiler will showed the assemble language code that caused the error, as shown below:


    7C812A25 test esi,esi
    7C812A27 mov dword ptr [ebp-4Ch],eax
    7C812A2A mov dword ptr [ebp-44h],7C812A09h
    7C812A31 je 7C812AD0
    7C812A37 mov ecx,dword ptr [ebp+10h]
    7C812A3A cmp ecx,0Fh
    7C812A3D ja 7C844790
    7C812A43 test ecx,ecx
    7C812A45 mov dword ptr [ebp-40h],ecx
    7C812A48 je 7C812A51
    7C812A4A push edi
    7C812A4B lea edi,[ebp-3Ch]
    7C812A4E rep movs dword ptr [edi],dword ptr [esi]
    7C812A50 pop edi
    7C812A51 lea eax,[ebp-50h]
    7C812A54 push eax
    7C812A55 call dword ptr ds:[7C801508h]
    7C812A5B pop esi <<======This is the place where VC stoped!!!
    7C812A5C leave
    7C812A5D ret 10h
    7C812A60 test edi,edi
    7C812A62 jle 7C80BD9E
    7C812A68 mov edx,dword ptr [ebp-4]
    7C812A6B mov dword ptr [ebp+0Ch],edx
    7C812A6E movzx edx,word ptr [esi]
    7C812A71 mov edi,dword ptr [ebp-8]
    7C812A74 mov dl,byte ptr [edx+edi]
    7C812A77 mov byte ptr [ecx],dl
    7C812A79 mov edi,dword ptr [eax+0Ch]
    7C812A7C movzx edx,dl
    7C812A7F mov dx,word ptr [edi+edx*2]
    7C812A83 cmp dx,word ptr [esi]
    7C812A86 jne 7C84B42F


    Then I click F5 again, the program just continue to run. (This is also a little weird to me, but last time I had a problem that does not corrupt the program under the debug mode, so I am not too surprised)



    I googled it briefly, I guess it's related with "corrupted stack", but I know nothing about 'assemble language' or 'stack' at all, can anybody help me to analyze what might cause this problem? How can I locate the problematic code more easily?
    Thanks.

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: what may cause this error?

    If you're running your application using a debugger then you should be able to get the stack trace. The stack trace will (normally) show you what part of your code that calls into kernel32.dll and eventually causes the exception.

    The bug might be located somewhere else, but such information might help you track down the real cause.

    - petter

  3. #3
    Join Date
    Jun 2007
    Posts
    14

    Re: what may cause this error?

    I am using Visual C++, can you tell me how to trace the stack using Visual C++?

  4. #4
    Join Date
    Aug 2005
    Location
    The Matrix
    Posts
    159

    Re: what may cause this error?

    Quote Originally Posted by pingpang
    I am using Visual C++, can you tell me how to trace the stack using Visual C++?
    If you are using Visual Studio, just press 'alt + 7' to open the call stack window when running in debug mode. (I'm using VS6, I don't know if its the same for all VS versions though)
    /** The only stupid question is the one you never ask. */

  5. #5
    Join Date
    Feb 2007
    Posts
    141

    Re: what may cause this error?

    Bro. Sarevok your using VS6

    I want to ask one thing regarding VS6

    Can u tell me how to know on which position mouse click event happen.

    I want to capture the mouse position and according to that me have to decide what code I have execute.

    oooppps it's is related to win32 but me also using VS6 hence i ask this question. Hope you ans. my question
    thanks bro.

  6. #6
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

    Re: what may cause this error?

    [ Moved Thread ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)