Invictus
Invictus

Reputation: 4328

How to trace from where i am getting ct_cmd_alloc error thrown in my application

I have an application Where I am running a process. while this process runs I get a ct_cmd_alloc error saying malloc failed . I understand that this error is thrown when the allocation of memory space fails . But I want to know if there is any other reason Where i should concenterate to find this error .

My most important concern is How can i actually pin point where and what in my code is resulting into this error. can i use gdb ,mdb or say d-Trace to pin pointy the location and if so How can i proceed for that.

Upvotes: 0

Views: 274

Answers (2)

edA-qa mort-ora-y
edA-qa mort-ora-y

Reputation: 31871

In gdb you can put a catchpoint on the throw command. This will interrupt anytime an exception is thrown:

(gdb) catch throw

Upvotes: 1

Collin
Collin

Reputation: 12287

If you run your program in gdb and cause the exception to happen, you can type the command where to get a stack trace.

Make sure to compile your program with debug flags enabled (-g)

Upvotes: 1

Related Questions