Expanding the OBJ_CONSTRUCT_INTERAL macro with its definition in
opal/class/opal_object.h, one finds that the illegal
instruction is
((opal_object_t *) (item))->obj_class = (flist->fl_elem_class);
I modified the openmpi source to print out the argument to malloc, the returned
pointer,
and the address of the above variable. Here is a modified source snippet of
opal_free_list_grow,
annotated with the output of the debugging printouts:
fprintf(stderr, "mpidebug: allocating %d\n", (num_elements *
flist->fl_elem_size) + sizeof(opal_list_item_t) + CACHE_LINE_SIZE);
alloc_ptr = (unsigned char *)malloc(1 * ((num_elements *
flist->fl_elem_size) +
sizeof(opal_list_item_t) +
CACHE_LINE_SIZE));
fprintf(stderr, "mpidebug: allocated at memory address %p\n", alloc_ptr);
mpidebug: allocating 216
mpidebug: allocated at memory address 0xb62bdf28
for(i=0; i<num_elements; i++) {
opal_free_list_item_t* item = (opal_free_list_item_t*)ptr;
if (NULL != flist->fl_elem_class) {
do {
if (0 == (flist->fl_elem_class)->cls_initialized) {
opal_class_initialize((flist->fl_elem_class));
}
fprintf(stderr, "mpidebug: accessing address %p\n",
&((opal_object_t *) (item))->obj_class);
((opal_object_t *) (item))->obj_class = (flist->fl_elem_class);
fprintf(stderr, "mpidebug: accessing address %p\n",
&((opal_object_t *) (item))->obj_reference_count);
((opal_object_t *) (item))->obj_reference_count = 1;
opal_obj_run_constructors((opal_object_t *) (item));
} while (0);
}
opal_list_append(&(flist->super), &(item->super));
ptr += flist->fl_elem_size;
}
mpidebug: accessing address 0xb62be000
As can be seen, the instruction
((opal_object_t *) (item))->obj_class = (flist->fl_elem_class)
access memory at alloc_ptr + 216, but alloc_ptr was allocated
to be of size 216.
--
libopenmpi segfaults when electric fence is enabled
https://bugs.launchpad.net/bugs/260027
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs