On Thu, 14 Aug 2003, Jan-Henrik Haukeland wrote:
I ran a fast test with efence and managed to reproduce the SIGSEGV (it
may be more). SIGSEGV is thrown in process/common.c:connectchild()
from this line:
parent->children[parent->children_num - 1] = (struct myprocesstree *) child;
From my gdb/efence session:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 1269)]
0x0805b340 in connectchild (parent=0x41143fa0, child=0x41144740)
at process/common.c:232
(gdb) p *parent->children
Cannot access memory at address 0x41365fcc
(gdb) p parent->children[parent->children_num - 1]
Cannot access memory at address 0x41365ffc
I suspect it's caused by trying to access something outside the
array. Maybe Christian can debug this since it's his code :) I'm of to
bed, it's late.
Strange... I just had a look at the code... and it IMHO impossible to
access memory which is not allocated at this position!
I do a xcalloc of parent->children_num entities of pointers and it has to
be possible to access the last one (parent->childen_num - 1)... or? Or is
it being deleted while this happens... somekind of race condition???