1834183 Members
2621 Online
110064 Solutions
New Discussion

Re: debugging problems

 
Thomas Matelich
Occasional Contributor

debugging problems

11i, C8000, gcc 3.2.3, various debuggers.

Everytime my app halts for what ever reason (assert, exception, etc) while in a debugger, it can not give me a stack trace. gdb (5.3 and 6.3) says "ttrace: bad address."

adb says "can't unwind -- no_entry" when I try to do a $c command.

wdb 5.3 runs out of memory. I have a feeling this may all be a memory issue, but all my fiddling with kernel params doesn't seem to have helped.

In scanning what I've written, there's not really anything to give you much of a clue, but hopefully you've seen ttrace: Bad address before and can solve my troubles :)

thanks,
tom
3 REPLIES 3
Muthukumar_5
Honored Contributor

Re: debugging problems

ttrace: bad address. means.. debugger is unable to get informations from that address bcas application debugging is completed. You have to setup proper break point during debugging..

Better check memory usage as,

1) UNIX95=1 ps -ef -o sz,vsz,pid,comm
2) top
3) swapinfo -tam
4) Get informations for maxssiz,maxdsiz related setting.


--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: debugging problems

Hi Tom,

You can use "tusc".

http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Thomas Matelich
Occasional Contributor

Re: debugging problems

I went away from this for a while, I've been using Insure++, at least it gives me a stack trace. However, eventually it runs out of memory too!

I made a little testapp to just keep malloc'ing until it fails, using decreasing amounts of memory each time.

I guess I only get one attachment, so I'll put the code in here, with my results, swapinfo, ps info, and kernel params in the attachment.

Thanks for any pointers.


#include

int main()
{
unsigned long long amount_allocated = 0;
unsigned long amount_to_allocate = 10000000;
while(true)
{
if(malloc(amount_to_allocate) != 0)
{
amount_allocated += amount_to_allocate;
}
else
{
std::cerr << "Failed to allocate " << amount_to_allocate << " bytes." << std::endl;
std::cerr << "Currently using " << amount_allocated << std::endl;
if(amount_to_allocate > 1)
amount_to_allocate /= 10;
else
{
break;
}
}
}
std::cerr << "That's all she wrote. Press any key and enter to exit." << std::endl;
char c;
std::cin >> c;
return 0;
}