Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Mysterious application crash

Mysterious application crash

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpsharepointdotnetwinformscom
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RajeshGuptha
    wrote on last edited by
    #1

    Dear all, My .Net WinForms Application quietly closes off without a warning and I am unable to understand the root cause of the problem, as it happens sporadically. I am working with .Net Framework 1.1 on Windows XP (tested on both SP 1 and 2). I tried the following: - Having a try/catch cover on all the important event handlers (OnPaint, OnMouse..., etc) and in the static Main() method (Application.Run(...)) - Set an UnhandledException handler for the present App domain. - Earlier, I was creating and releasing a COM object in a method that was being called many times. Now, I moved the creation into the class constructor and the releasing into the Dispose(). Yet, none of these options have either stopped the crash or have given me a clue. Is there a way in which I can get hold of any low level API's or tools that will be able to execute my application in a shell, which will give me a greater control on locating the cause of the crash. Any ideas will be greatly appreciated. Thanks for reading. -Rajesh.

    C R D 3 Replies Last reply
    0
    • R RajeshGuptha

      Dear all, My .Net WinForms Application quietly closes off without a warning and I am unable to understand the root cause of the problem, as it happens sporadically. I am working with .Net Framework 1.1 on Windows XP (tested on both SP 1 and 2). I tried the following: - Having a try/catch cover on all the important event handlers (OnPaint, OnMouse..., etc) and in the static Main() method (Application.Run(...)) - Set an UnhandledException handler for the present App domain. - Earlier, I was creating and releasing a COM object in a method that was being called many times. Now, I moved the creation into the class constructor and the releasing into the Dispose(). Yet, none of these options have either stopped the crash or have given me a clue. Is there a way in which I can get hold of any low level API's or tools that will be able to execute my application in a shell, which will give me a greater control on locating the cause of the crash. Any ideas will be greatly appreciated. Thanks for reading. -Rajesh.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Put a try/catch inside your static void main so you can catch the error and get a stack trace. Christian Graus - Microsoft MVP - C++

      R 1 Reply Last reply
      0
      • C Christian Graus

        Put a try/catch inside your static void main so you can catch the error and get a stack trace. Christian Graus - Microsoft MVP - C++

        R Offline
        R Offline
        Ray Cassick
        wrote on last edited by
        #3

        Seems to me if he was getting an unhandled exception that was causing the application to 'crash' the he would be seeing some type of exception dialog box before the app 'closes off' though. If this can be seen under some type of controlled circumstances perhaps running the app in the debugger a while might shed some light on things. At very least he might get to 'see' it happen and maybe get some debug info that way. When chasing things like this I usually start by gathering some statistics as to what the application was doing at the time it 'goes away' so I can get a better idea where to instrument things a bit. I then add some debug print statements and run the app with something like debugview running to get an idea as to what code was being executed last when the error happened.


        George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
        My Blog[^]


        R 1 Reply Last reply
        0
        • R Ray Cassick

          Seems to me if he was getting an unhandled exception that was causing the application to 'crash' the he would be seeing some type of exception dialog box before the app 'closes off' though. If this can be seen under some type of controlled circumstances perhaps running the app in the debugger a while might shed some light on things. At very least he might get to 'see' it happen and maybe get some debug info that way. When chasing things like this I usually start by gathering some statistics as to what the application was doing at the time it 'goes away' so I can get a better idea where to instrument things a bit. I then add some debug print statements and run the app with something like debugview running to get an idea as to what code was being executed last when the error happened.


          George Carlin wrote: "Don't sweat the petty things, and don't pet the sweaty things." Jörgen Sigvardsson wrote: If the physicists find a universal theory describing the laws of universe, I'm sure the asshole constant will be an integral part of that theory.
          My Blog[^]


          R Offline
          R Offline
          RajeshGuptha
          wrote on last edited by
          #4

          As i said in the beginning itself that i have a try catch block in main also, but that is of no use, when it crashes. It still crashs without informing anything... And i have tried to monitor the crashing procedure, but there is no similarity among the different occurances. I could only suspect on the Out of Memory Exception, for which i have made sure from two memory profilers that all the objects which i create, am also disposing them when they go out of scope.. I think that the problem might be at some lower level(OS level) which iam not able to get it right!! Thanks for your suggestions. Regards, Rajesh

          1 Reply Last reply
          0
          • R RajeshGuptha

            Dear all, My .Net WinForms Application quietly closes off without a warning and I am unable to understand the root cause of the problem, as it happens sporadically. I am working with .Net Framework 1.1 on Windows XP (tested on both SP 1 and 2). I tried the following: - Having a try/catch cover on all the important event handlers (OnPaint, OnMouse..., etc) and in the static Main() method (Application.Run(...)) - Set an UnhandledException handler for the present App domain. - Earlier, I was creating and releasing a COM object in a method that was being called many times. Now, I moved the creation into the class constructor and the releasing into the Dispose(). Yet, none of these options have either stopped the crash or have given me a clue. Is there a way in which I can get hold of any low level API's or tools that will be able to execute my application in a shell, which will give me a greater control on locating the cause of the crash. Any ideas will be greatly appreciated. Thanks for reading. -Rajesh.

            R Offline
            R Offline
            Robert Rohde
            wrote on last edited by
            #5

            Try hooking into the System.Windows.Forms.Application.ThreadException event. Other than that I have no idea :((. Normally at least an error dialog should be displayed.

            1 Reply Last reply
            0
            • R RajeshGuptha

              Dear all, My .Net WinForms Application quietly closes off without a warning and I am unable to understand the root cause of the problem, as it happens sporadically. I am working with .Net Framework 1.1 on Windows XP (tested on both SP 1 and 2). I tried the following: - Having a try/catch cover on all the important event handlers (OnPaint, OnMouse..., etc) and in the static Main() method (Application.Run(...)) - Set an UnhandledException handler for the present App domain. - Earlier, I was creating and releasing a COM object in a method that was being called many times. Now, I moved the creation into the class constructor and the releasing into the Dispose(). Yet, none of these options have either stopped the crash or have given me a clue. Is there a way in which I can get hold of any low level API's or tools that will be able to execute my application in a shell, which will give me a greater control on locating the cause of the crash. Any ideas will be greatly appreciated. Thanks for reading. -Rajesh.

              D Offline
              D Offline
              Daniel Turini
              wrote on last edited by
              #6

              RajeshGuptha wrote: - Earlier, I was creating and releasing a COM object in a method that was being called many times. Now, I moved the creation into the class constructor and the releasing into the Dispose(). If this COM object, or any other Interop call you do, call the ExitProcess() API, you'll see the behavior you described: the program closes silently, without any exception. To try isolating the problem, try to remove the COM object and any interop call, even if your program does not work, and see if still closes. If it does not close anymore, try adding each interop call you do until you find what is the culprit. I see dead pixels Yes, even I am blogging now!

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups