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

Threaded View

  1. #7
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Calling MiniDumpWriteDump from the same process that crashed

    Quote Originally Posted by ahmd View Post
    So, Igor, you're confirming "stack overflow, and low memory" conditions, right?
    No. I literally confirmed the quoted: It fails to work in some cases. One time it creates zero size dump file, other time it creates a dump with some meaningless call stack. Unfortunately, our customers run 24/7 systems, so I never was at luxury to be given with time enough to understand the root cause. But most of the times minidump works satisfactorily.

    Just curious, how often can those occur in a modern OS. I mean I haven't looked into the default size of the stack these days, but it should be plenty to cause an overrun. Although, as I think about it, some recursive process can run a muck and cause it pretty easily.
    These days the default stack size remains as it were in old NT days. For properly designed thread 1Mb is more than enough.

    Also any idea how to make a minidump for those situations?
    Sorry, no idea. Frankly saying, I spend lesser and lesser time on Windows C++ projects because of moving to other platforms and languages. No time to research such kind of things.

    Let me give you my initial idea. I thought to run a special designated service to collect app crashes. (And again, it's not that my app crashes all the time, it's that having those .dmp files helps a lot when one occurs.) So in case one of my processes crashes it passes its process ID & thread ID to this crash dump service right from the TopLevelExceptionFilter handler, that the service uses to call MiniDumpWriteDump with. The obvious issue here is passing those IDs to the service. My preferred method is a named pipe, but the question that comes up is whether doing a named pipe communication with the service from a crashed process is actually even possible, or reliable at all? So tell me if I'm going too far with it? It'd be nice to hear your guy's take on it before I jump into coding all this...
    You know, my favorite approach is waiting for event. Which means, the monitor should be aware of the PID beforehand (this just means early registration with the monitor) and waiting on a specially named global event. Besides, while you establish a connection there might be not enough time even to connect to a pipe.
    Last edited by Igor Vartanov; July 14th, 2012 at 03:05 PM.
    Best regards,
    Igor

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured