×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    10

    Memory leak debugging

    What is the best way to find memory leaks in CW 3.0, without having the S60 source code or symbols? The emulator displays an ALLOC message at closing time, so what can one do about it?

    All my old methods do not work anymore:

    MS VS:
    - note memory region from ALLOC message
    - conditional breakpoint on ALLOC, look for register EAX value of address
    - rerun App
    - triggers on all allocs with wanted address

    CW 2.5:
    - note memory region from ALLOC message
    - set memory watch on the region
    - rerun app
    - it breaks on all allocs with same address

    Could CW not just record all alloc addresses and matching source code line numbers of a thread, so in case of a panic, one could search the list of allocs with the same address? There are gigabytes of memory lying around anyway...

  2. #2
    Nokia Developer Expert
    Join Date
    Oct 2004
    Location
    Austin, TX USA
    Posts
    271
    Without symbolics this is very difficult to do. Our experience has been that it looks like the address usually changes in WINSCW, so the watchpoint approach doesn't appear to be that workable. This is definitely something we want to address, and engineering is investigating it, but I'm afraid there will be no easy or quick solution.

    Regards,

    Matt Pinsonneault
    Nokia Developer Support

  3. #3
    Registered User
    Join Date
    Mar 2003
    Posts
    10
    So, in the short term, is there a way to get the symbolics for a Nokia SDK then? I hear the UIQ SDKs have them, so what is the problem with releasing them for S60 SDKs?

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    15
    Of course there is a quick solution.

    Release a dll with the symbolics in it. Probably euser.dll.

    I actually had this problem. I want to share the posts I had with the support team of Codewarrior.

    It seems that the only solution right now is to use uiq, that is the only one that ships symbolics.

    This is the answer I got from codewarrior about this:

    Series 60 SDK's ship with no symbolics in emulator binaries, so you will not be able to use badCell with it. The UIQ SDK's do however, so assuming you can debug the same app on UIQ, you should be able to use this technique.

    Once there one can just change the type of badCell to CBase or similar and guess what the content of it is. Based from that it should be easy to track the leak.

    However I have seen also that with Codewarrior 3.0, even if one cannot debug leaks anymore (sniff) some panics that before were not handled are handled now and are easier to fix (in other words: it breaks on the code when it panics with a USER panic)
    Last edited by svieira; 2005-02-03 at 13:54.

  5. #5
    Nokia Developer Expert
    Join Date
    Oct 2004
    Location
    Austin, TX USA
    Posts
    271
    The CodeWarrior tools group's mission is to work with all Symbian developers, including Nokia's competitors. Why should it seem strange that we recommend using the UIQ SDK as a workaround in this case? It has the symbolics you need, and at the moment the S60 SDK does not.

    We will continue working with the Series 60 SDK group to get the symbolics released, but this will not happen immediately; it will take time.

    Also, it is poor form to post e-mails to a public forum without permission. I will leave your post there but I have edited it to remove some Metrowerks contact information that should not have been posted.

    Regards,

    Matt Pinsonneault
    Nokia Developer Support

  6. #6
    Registered User
    Join Date
    Mar 2003
    Posts
    15
    Thanks for the hint. I removed the chain of emails and posted the most important bits. The suport I got from Metrowerks was great and very fast. However it did not solve all my problems.

    Is there planned for the near future some basic things that would make Symbiand and Codewarrior rocks?

    a) Memory leaks: Say what and when and where the leak was created.
    b) Panics: Show where the panic comes from (USER and EUser-CBase are the most common ones)
    c) Be able to put conditional breakpoints anywhere, even on registers, like Visual Studio does.


    If those two issues are fixed that would make many symbian programmers happy.

  7. #7
    Nokia Developer Expert
    Join Date
    Oct 2004
    Location
    Austin, TX USA
    Posts
    271
    All of these are excellent suggestions. I have logged them in our database as feature requests and we will try to incorporate them into a future version.

    Regards,

    Matt Pinsonneault
    Nokia Developer Support
    Last edited by mpinsonneault; 2005-02-04 at 21:27.

Posting Permissions

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