WCE 6.0 app crashes when using the debugger

  • Hello,


    I am developping an WCE application for months, and a couple of days ago it started to crash.
    What I found is that

    • It works fine when I start the application outside Visual Studio. I just do Deploy, and run it from the device.
    • In DCUTermi I can read message starting with Exception 'Prefetch Abort' (3): Thread-Id= ...... when the crash happened.
    • It looks like this issue is known by Microsoft and filed as KB973905

    Now I'm stucked in due to that issue, and I'm wondering how to proceed to implement this fix, if it's the right thing to do.
    Any help would be appreciated.


    Best Regards,
    Robin

  • Hello,
    i don't think the exception come from the article you refer, is you applications memory usage really bigger then 32MB and did you have a look at the CAB?
    Can you locate the occuring of the exception with the debugger, by go step by step?

    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.

  • Hello Christian,


    I've measured the application memory usage with the Remote Performance Monitor, and I got a Peak Bytes Allocated (native + managed) = 10 479 576
    so you're right it doesn't exceed 32MB, except if my measurement is wrong. If wrong, how would you measure it?


    What do you mean by

    Quote

    have a look at the CAB

    ? Wihci file is it? the one generated for my application deployment?


    Quote

    Can you locate the occuring of the exception with the debugger, by go step by step?


    What is strange is when I run every lines of code one by one with the debugger (with the Step Into or Step Over), it doesn't crach. But when I do a "Continue debugging (F5)" then it crashes. It really looks like there is a problem with the debugger.

  • Hello,

    Quote

    Wihci file is it? the one generated for my application deployment?

    ?
    the link you provide abouve talks about "Netcfv35.wce.armv4.cab".


    Quote

    What is strange is when I run every lines of code one by one with the debugger (with the Step Into or Step Over), it doesn't crach. But when I do a "Continue debugging (F5)" then it crashes. It really looks like there is a problem with the Debugger.

    Debugger aligns the commands whithout debugger several threads may running - i assume a timing problem. It is not easy but you have ti check your code line by line:(.


    In c++ you can generate a MAP - file which may helps you to locate the exception (but depends on the serial debug output information, refer msdn)

    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.

  • Hello,


    I can't download the .cab. I thought that this patch is now incorporated in the kernel since it's quite old now. Anyway, I will find a way.
    I will check it line by line.
    Again thank you for your advice.


    Regards

  • Hello,
    you are right, i think Installation of cab i *not* required. But because you sent the link i was interested in if it containts further information (additional to cf35 update).
    You should try to locate the source of the exception.

    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.

  • YIIIIIIHAAAAAAA! I'm so glad because I've found the way to fix it! I finally spent 2 days to find it.


    Explanation are there https://developer.motorolasolutions.com/thread/3000

    From my understanding it is due to the memory limit of 32MB of the stack in debug mode. So my memory measurement was not accurate. You simply need to add this key in the registry to fix it:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework] "JITCodeBufferSizeLimitEnabled"=dword:1
    and it works out.


    I will definitely program all our new NetDCUA5 with this registry key enabled.

  • Hello, thanks for this usefull information.
    I thought it is a safe bet that something is wrong with your code(:

    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.