Announcement

Collapse
No announcement yet.

Program Crash - Windows Event Viewer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Program Crash - Windows Event Viewer

    I have a customer who is reporting that my application crashes, but the same application running in numerous other locations does not appear to suffer the same problem. When the crash occurs the Windows Event Log records
    Exception code: 0xc0000005
    Fault offset: 0x00023a72

    I believe exception code '0xc0000005' is an access violation, pointer looking somewhere it shouldn't for example, but given the fault offset, is there anyway to debug the program to locate the offending code?

    Any help would be appreciated
    Richard

  • #2
    I had a program that some times it would not load showed it compile at times it would chrash
    you can add at the start
    #DEBUG DISPLAY ON
    #DEBUG ERROR ON
    jellyfish ide csed ide powerbasic ide all have a compile and debug.

    i added to %wm_destroy
    ExitProcess(0)
    DestroyWindow hdlg
    PostQuitMessage 0
    CLOSE
    Dialog end cbhndl
    deleted all font all brushed
    IF hFont THEN DeleteObject SelectObject(@Lpdis.hDC, hFont)
    DeleteObject(hBrush)
    DeleteObject(hBrushPrev)
    DeleteOBJECT(hButton)

    hope this gives you some ideals
    in one case change from using drawtext to textout api
    in other basic i used to set an error routine pb help shows how

    Comment


    • #3
      Hi James,
      Thanks for the pointers, I could add #DEBUG DISPLAY ON, but I don’t really want to have my customer reporting back what he “thinks” is displayed. As the problem only appears to occur on his PC which is over 100 miles from my location, remote debugging is difficult.

      What I was hoping to find is a utility of some description which would allow you to enter the error offset and give you a clue as to the area of the source that caused it.

      I believe if memory serves correctly, that the old PB for DOS used have something similar built in.
      Richard

      Comment


      • #4
        Howdy, Richard!

        James comment is very appropriate. With that in your code, can your customer simply take a picture of the error message with their phone, then text that to you? My customers do that with me all the time.

        Comment


        • #5
          What I do many times is create my apps with debug logging to a file built in, but disabled unless a specific environment variable or command line-parameter exists.

          Widows error message will be far less useful than logging you can do within your own app.
          <b>George W. Bleck</b>
          <img src='http://www.blecktech.com/myemail.gif'>

          Comment


          • #6
            In this sort of situation, it's quite common to produce a separate "debugging" version of the application which that one client can use in that location.

            Comment


            • #7
              Thanks guys, looks like it's going to be #DEBUG DISPLAY ON then, maybe a future project to locate errors logged by Windows, although this would require some in depth knowledge of how the compiler optimises code?
              Richard

              Comment


              • #8
                What I was hoping to find is a utility of some description which would allow you to enter the error offset and give you a clue as to the area of the source that caused it.
                Your real problem here is, the point ("offset") where the program fails is not necessarily where the programming error occurred..Although it will tell you where "something" tried to use an invalid address, the invalid address was almost certainly stored by you much earlier in the program.

                Search here (or at Microsoft but here is a little more to the point) for "Structured Exception Handling." SEH supports essentially writing a debug record at the point where the exception is noticed by Windows (and program fails) . But again... this will only be the point where Windows was asked to USE an invalid address.. not where your program stored the invalid address, .

                On the "utility to relate code offset to source code line" .... I don't know why we don't have one. It certainly is possible to do at compilation time.. it's the same mechanism which allows the stepping debugger to work. You'd have to ask PB why we had this for PB/DOS but not for PB/Windows.

                For all I know, you can probably read the debug file created by the compiler... but you probably don't want to ship your users code compiled for debugging because it contains a :LOT of additional code which will slow the software down.

                [ADDED]
                , but the same application running in numerous other locations does not appear to suffer the same problem.
                Sometimes a newer version of the operating system will generate an exception (and corresponding General Protection Fault error) which an older version does not. But more likely there is something in your program which is expecting some configuration - a file or folder or maybe an executable program - and the 'assumed' feature is not present but your program does not handle it correctly.

                These kinds of errors are OFTEN caused by not checking errors and simply continuing to execute instructions on the assumption no such errors occur.
                [/ADDED]
                Last edited by Michael Mattias; 29 Apr 2021, 02:08 PM.
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  Originally posted by richard robinson1 View Post
                  I have a customer who is reporting that my application crashes, but the same application running in numerous other locations does not appear to suffer the same problem. When the crash occurs the Windows Event Log records
                  Exception code: 0xc0000005
                  Fault offset: 0x00023a72

                  I believe exception code '0xc0000005' is an access violation, pointer looking somewhere it shouldn't for example, but given the fault offset, is there anyway to debug the program to locate the offending code?

                  Any help would be appreciated
                  You're a bit sparse on details. E.g. are those "numerous other locations" at the same client? Or are these running at other clients/sites? And also some general info about what that application does technically, e.g. is it run from or does it access network shares, does it network communication (TCP/IP / UDP). Which local folders does it read from and more important write to...

                  I'd also look into (like Micheal mentioned) other possible scenarios like
                  - OS it's crashing compated to OS it's running fine.
                  - AV software and/or firewall

                  Does it run when started "As Administrator"? If so, you are most likely looking at a permission issue, i.e. the program tries to access and or write to locations to which a normal or restricted user account doesn't have access to.

                  Comment

                  Working...
                  X