SIGSEGV : 11 error

P

Patricia

Hi,
I ran my C++ application on UNIX and got the SIGSEGV: 11 error. dbx
reads the core like below:

0x7f741f10: _malloc_unlocked+0x021c: ld [%o0 + 8], %o1
Current function is std::allocator said:
::allocate
389 void * tmp = _RWSTD_STATIC_CAST(void*,:):eek:perator
new(_RWSTD_STATIC_CAST(size_t,(n)))));

[1] _malloc_unlocked(0x7f7c2858, 0x1bbfa8, 0x7f7bc008, 0x2008,
0x1bc040, 0x0),at 0x7f741f10
[2] malloc(0x2008, 0x0, 0x7fbdc0c0, 0x7fbdc790, 0x7fb40b60,
0x7fbded84), at 0x7f741cd8
[3] _filbuf(0x142238, 0x1, 0x7f7bc008, 0x0, 0x2000, 0x1), at
0x7f78edf8
[4] _doprnt(0x0, 0xffbedf68, 0x142238, 0x7f7bc008, 0x40, 0x11cf6c),
at 0x7f784afc
[5] printf(0x11cf6c, 0x142228, 0x7f7c3a54, 0x0, 0x2, 0x0), at
0x7f788154
[6] p4_error(0x139048, 0xb, 0xb, 0x0, 0x0, 0x0), at 0xfe7d0
[7] sig_err_handler(0xb, 0x0, 0xffbee0e0, 0x7f7bc008, 0x0, 0x0), at
0xfea14
[8] _setpgid(0xb, 0x0, 0xffbee0e0, 0x7f7c284c, 0x7f7c2848, 0x0), at
0x7f79ebc4
[9] _malloc_unlocked(0x7f7c2858, 0x1bbfa8, 0x7f7bc008, 0xb8,
0x1bc040, 0x0), at 0x7f741ea0
[10] malloc(0xb4, 0xffbee8c3, 0x0, 0xffbee8c2, 0x2234c, 0x7f741ce4),
at 0x7f741cd8
[11] operator new(0xb4, 0xffbee8c3, 0x13740, 0xffbeee38, 0x7fa4a8d4,
0xb4), at 0x7fa371b8
=>[12] std::allocator said:
::allocate(this = 0xffbee5ff, n = 180U, _ARG3 = (nil)), line 389 in "memory"
[13] std::allocator_interface<std::allocator<std::pair<const
int,ProcessState> >,__rwstd::__rb_tree<int,std::pair<const
int,ProcessState>,__rwstd::__select1st <std::pair<const
int,ProcessState>,int>,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::__rb_tree_node>::allocate(this = 0xffbee5ff, n =
1U, p = (nil)), line 488 in "memory"
[14] __rwstd::__rb_tree<int,std::pair<const
int,ProcessState>,__rwstd::__select1st<std::pair<const
int,ProcessState>,int>,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::__add_new_buffer(this = 0x1b9c28), line 167 in
"tree"
[15] __rwstd::__rb_tree<int,std::pair<const
int,ProcessState>,__rwstd::__select1st<std::pair<const
int,ProcessState>,int>,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::__get_link(this = 0x1b9c28), line 189 in "tree"
[16] __rwstd::__rb_tree<int,std::pair<const
int,ProcessState>,__rwstd::__select1st<std::pair<const
int,ProcessState>,int>,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::__get_node(this = 0x1b9c28), line 223 in "tree"
[17] __rwstd::__rb_tree<int,std::pair<const
int,ProcessState>,__rwstd::__select1st<std::pair<const
int,ProcessState>,int>,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::init(this = 0x1b9c28), line 483 in "tree"
[18] __rwstd::__rb_tree<int,std::pair<const
int,ProcessState>,__rwstd::__select1st<std::pair<const
int,ProcessState>,int>,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::__rb_tree(this = 0x1b9c28, _RWSTD_COMP = STRUCT,
always = false, alloc = CLASS), line 499 in "tree"
[19]
std::map<int,ProcessState,std::less<int>,std::allocator<std::pair<const
int,ProcessState> > >::map(this = 0x1b9c28, comp = STRUCT, alloc =
CLASS), line 148 in "map"
[20] ContContrlState::ContContrlState(this = 0x1b9c00), line 18 in
"ContContrlState.hh"
[21] ContContrlObject::allocateState(this = 0x1b3c20), line 804 in
"ContContrlObject.cc"
[22] StateManager::saveState(this = 0x1b3e78), line 126 in
"StateManager.cc"
[23] TimeWarp::saveState(this = 0x1b3c20), line 429 in "TimeWarp.cc"
[24] TimeWarp::executeSimulation(this = 0x1b3c20), line 325 in
"TimeWarp.cc"
[25] LTSFScheduler::runProcesses(this = 0xffbef270), line 50 in
"LTSFScheduler.cc"
[26] LogicalProcess::simulate(this = 0xffbeee90, _ARG2 = 2147483647),
line 885 in "LogicalProcess.cc"
[27] main(argc = 1, argv = 0x16a420), line 299 in "main.cc"

Could anyone give me some hints about this?

Patricia
 
J

John Harrison

Patricia said:
Hi,
I ran my C++ application on UNIX and got the SIGSEGV: 11 error. dbx
reads the core like below:

0x7f741f10: _malloc_unlocked+0x021c: ld [%o0 + 8], %o1
Current function is std::allocator said:
::allocate

I'd guess that your heap is corrupt. You could be in for a long
debugging session to track it down, because with problems like this the
error often happens a long time before the program crashes.

john
 
J

John Harrison

Patricia said:
Is there a way to make the program crash as soon as the heap is
corrupted ?

There are various tools that can help track down this sort of bug, by
warning about heap corruption and similar problems when they occur. They
tend to be compiler and/or operating system specific so you should ask
about these tools on a group for programming Unix, comp.unix.programmer
perhaps.

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,241
Latest member
Lisa1997

Latest Threads

Top