views:

876

answers:

4

One of the products we develop is a phone app for nokia phones done in C++ and Symbian, we started getting "random" crashes a while a ago with a USER 44 panic.

I am pretty new to the symbian environment so I am looking for tools and recommendations to help finding the root of this bug.

Is there a equivalent of a "stack trace" that I can get? Is there generic panic catching code that could give me some insight into it?

A: 

My vague understanding is that USER 44 and USER 45 panics both have to do with heap problems. The most common problem would be a double deletion. Are you NULL'ing your pointers after deleting them? Are you checking against NULL before deleting them? Where could you be double deleting something?

Doug T.
you don't have to check against NULL when deleting -- it's safe and perfectly legal to call delete on NULL.
Kasprzol
+5  A: 

From http://www.symbian.com/developer/techlib/v9.1docs/doc_source/reference/N10352/UserPanics.html:

This panic is raised by the Free() and FreeZ() member functions of an RHeap.
It is caused when the cell being freed overlaps the next cell on the free
list (i.e. the first cell on the free list with an address higher than the
one being freed).

It means, your calling delete/delete[] (which in turn will call Free()/FreeZ()) with an invalid pointer. When debuging under Carbide the debuger should break on the line that causes the panic and you should be able to see the invalid deletion.

Kasprzol
Hard to track, but it was exactly a double delete ...
webclimber
+1  A: 

As Kasprzol pointed out, stepping through the debugger should let you narrow down to the set of lines or routine causing the panic. You may also want to ensure that you are not trying to delete a heap object whose ownership was transferred to another heap object (probably through a method call which does not clearly document this fact) which has already deleted that object before you are deleting it explicitly. I have been bitten by the latter before.

ayaz
A: 

The easiest choice for debugging is probably to use Carbide 2.0, as it's fully featured and freely available.