Application stops unwanted

  • I have a problem and have no further ideas what to do. May be you can give some remarks. The application I am talking about is in written in C# and is using p/invokes a lot. It is talking with another application via UDP over the ethernet. It is running on a PICOCOM4 WCE6.0R3 with Kernel NKPC4_PRO_CF35_111123


    Application runs as it should, as long as I want without problems, but when I am using the windows taskbar, let´s say to switch from application to a control panel, or whatever, then it happens from time to time, let´s say every 50th button pressing, that the application stops without any exeption or any warning, like if I would really close the program. I checked sources already if it would be a unwanted program stop, but there is nothing like that(actually the program never needs to stop)


    Beside this behaviour there is, from time to time and with no relation to any interaction, some output on the debug interface:


    +OALIoCtlHalGetHWEntropy
    +OALIoCtlHalGetHWEntropy


    Exception 'Data Abort' (4): Thread-Id=05e6009e(pth=83dfc6c0), Proc-Id=050f007e(pprc=831b673c) 'Application.exe', VM-active=050f007e(pprc=831b673c) 'Application.exe' PC=400302c0(coredll.dll+0x000202c0) RA=00040000(???+0x00040000) SP=0071fc2c, BVA=00b40018


    No idea what that means but feeling says this is related to my attached problem. When I debug with Visual studio via Ethernet connection, and the application is stopping, there comes the messages that the connection to the device is broken, as if one unplugs the Ethernet connection. When I run the application (started from device), and the application is stopping, it just stops and the window disappears. I already activated all exceptions in Visual studio, but nothing happens. Is there anything I can do to find this ?

  • Try to narrow the error. For example add some messages that are written to a log file. Close the file after each write, so that it is not open anymore if the program crashes. Then when the program stops responding, check the log file to see what the last action was. By doing this you can narrow the region where to search for the error.


    About the entropy: are you using random numbers in some way?

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • I do not use random numbers.


    Can you not say anything about this? ->>


    Exception 'Data Abort' (4): Thread-Id=05e6009e(pth=83dfc6c0), Proc-Id=050f007e(pprc=831b673c) 'Application.exe', VM-active=050f007e(pprc=831b673c) 'Application.exe' PC=400302c0(coredll.dll+0x000202c0) RA=00040000(???+0x00040000) SP=0071fc2c, BVA=00b40018


    Is there no way to use this information to start a basic narrowing? If I use iterative narrowing, don´t know how long this would take.

  • Your application seems to crash in coredll function at offset 0x0001f2c0 (0x000202c0 - offset 0x1000) which might by the function EnumerateHeapItems() ?!


    Here is an abstract of the coredll map file

    Quote


    0001:0001ea04 xxx_CeRegGetInfo 1001fa04 f coredll_ALL:twinreg.obj
    0001:0001ea6c xxx_CeRegGetNotificationInfo 1001fa6c f coredll_ALL:twinreg.obj
    0001:0001f578 EnumerateHeapItems 10020578 f coredll_ALL:rheap.obj
    0001:0001f738 RHeapFree 10020738 f coredll_ALL:rheap.obj


    Other resoureces:
    <!-- m --><a class="postlink" href="http://geekswithblogs.net/BruceEitman/archive/2008/05/19/windows-ce--finding-the-cause-of-a-data-abort.aspx">http://geekswithblogs.net/BruceEitman/a ... abort.aspx</a><!-- m -->

    Software developer, F&amp;S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • This info seems to have helped me(where can I get such map files?). I did some change in LocalFree(), what seems corresponding to your mentioned RHeapFree (is this true?) and the messages disappeared. Unfortunately the problem that the application stops is not gone.
    But what I have seen, when disabling one debug message in my code (Debug.WriteLine("yxz...")) the problem now arrives more often, and additionally, what was not before, there are new system messages, when deploying and starting the application:
    ETH: TX UNDERRUN
    ETH: Error Overrun
    ETH: TX UNDERRUN
    After program start(and do not hit a button) these messages do not arrive anymore.
    By the way I use now a Picocom2(herefore I have a user kernel) and nomore a Picocom4.


    Any help appreciated.

  • I found now the reason for unexpected closing. With a remote tool (NetCFLogging.exe, from the powertoys set) I could log that it(probably Windows itself) is out of memory. Windows CE seems to be allowed to close application in this case without explicit warning.
    (Although I have already seen such OOM warnings on the screen in other cases, when I had bad software design and the volatile memory was insufficient). Ok I do not know the reason why this is not displayed in ths certain case but anyhow, the more strange thing is that my application runs without any problem and with some MB reserve in memory, as long as I do not press any button in the Windows task bar, let´s say the "Start" button. Then the appplication stops(or let´s say disappears) with a logged string "OutOfMemory".


    Has anyone an comment how this can be? I always thought that Windows is protected against any "bad" application, but never knew that I need to protect my app against windows. Do you have another idea?