Skip to content

Commit

Permalink
Add OPAL_ABORT() macro to wrap abort().
Browse files Browse the repository at this point in the history
This will prevent the generation of core files on abort() when run
with '--mca opal_enable_assert_core 1'

Signed-off-by: Austen Lauria <[email protected]>
  • Loading branch information
awlauria committed Mar 5, 2021
1 parent 1c3fd01 commit 76c43ca
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion ompi/mca/osc/rdma/osc_rdma_lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static inline int ompi_osc_rdma_lock_release_exclusive (ompi_osc_rdma_module_t *
ret = ompi_osc_rdma_lock_btl_op (module, peer, lock, MCA_BTL_ATOMIC_ADD, -OMPI_OSC_RDMA_LOCK_EXCLUSIVE,
false);
if (OMPI_SUCCESS != ret) {
abort ();
OPAL_ABORT();
}
} else {
ompi_osc_rdma_unlock_local ((ompi_osc_rdma_atomic_lock_t *)(intptr_t) lock);
Expand Down
2 changes: 1 addition & 1 deletion ompi/proc/proc.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static inline void ompi_proc_mark_as_failed(ompi_proc_t *proc) {
if( proc == ompi_proc_local() ) {
opal_output(0, "%s %s: I have been reported dead by someone else. This is abnormal: since the current rank is executing this code, the failure detector made a mistake. The root cause may be that this rank missed its heartbeat send deadlines, or that the observer process got very slow. One way to resolve such issues is to increase the detector timeout, or enable the threaded detector. This is abnormal; Aborting.",
OMPI_NAME_PRINT(OMPI_PROC_MY_NAME), __func__);
abort();
OPAL_ABORT();
}
proc->proc_active = false;
}
Expand Down
2 changes: 1 addition & 1 deletion opal/class/opal_list.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static inline size_t opal_list_get_size(opal_list_t* list)
if (check_len != list->opal_list_length) {
fprintf(stderr," Error :: opal_list_get_size - opal_list_length does not match actual list length\n");
fflush(stderr);
abort();
OPAL_ABORT();
}
#endif

Expand Down
6 changes: 3 additions & 3 deletions opal/datatype/opal_datatype_cuda.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ void *opal_cuda_memcpy(void *dest, const void *src, size_t size, opal_convertor_
if (res != 0) {
opal_output(0, "CUDA: Error in cuMemcpy: res=%d, dest=%p, src=%p, size=%d",
res, dest, src, (int)size);
abort();
OPAL_ABORT();
} else {
return dest;
}
Expand All @@ -153,7 +153,7 @@ void *opal_cuda_memcpy_sync(void *dest, const void *src, size_t size)
if (res != 0) {
opal_output(0, "CUDA: Error in cuMemcpy: res=%d, dest=%p, src=%p, size=%d",
res, dest, src, (int)size);
abort();
OPAL_ABORT();
} else {
return dest;
}
Expand All @@ -171,7 +171,7 @@ void *opal_cuda_memmove(void *dest, void *src, size_t size)
if(res != 0){
opal_output(0, "CUDA: Error in gpu memmove: res=%d, dest=%p, src=%p, size=%d",
res, dest, src, (int)size);
abort();
OPAL_ABORT();
}
return dest;
}
Expand Down
16 changes: 8 additions & 8 deletions opal/include/opal/sys/atomic_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ OPAL_ATOMIC_DEFINE_CMPXCG_OP(int64_t, 64, -, sub)
return opal_atomic_compare_exchange_strong_64 ((opal_atomic_int64_t *) addr, \
(int64_t *) oldval, (int64_t) newval); \
} \
abort(); \
OPAL_ABORT(); \
}
#elif OPAL_HAVE_ATOMIC_COMPARE_EXCHANGE_32
#define OPAL_ATOMIC_DEFINE_CMPXCG_XX(semantics) \
Expand All @@ -259,7 +259,7 @@ OPAL_ATOMIC_DEFINE_CMPXCG_OP(int64_t, 64, -, sub)
return opal_atomic_compare_exchange_strong_32 ((opal_atomic_int32_t *) addr, \
(int32_t *) oldval, (int32_t) newval); \
} \
abort(); \
OPAL_ABORT(); \
}
#else
#error "Platform does not have required atomic compare-and-swap functionality"
Expand Down Expand Up @@ -324,7 +324,7 @@ static inline void
default:
/* This should never happen, so deliberately abort (hopefully
leaving a corefile for analysis) */
abort();
OPAL_ABORT();
}
}

Expand All @@ -347,7 +347,7 @@ opal_atomic_sub_xx(opal_atomic_intptr_t* addr, int32_t value, size_t length)
default:
/* This should never happen, so deliberately abort (hopefully
leaving a corefile for analysis) */
abort();
OPAL_ABORT();
}
}

Expand Down Expand Up @@ -404,7 +404,7 @@ static inline intptr_t opal_atomic_fetch_add_ptr( opal_atomic_intptr_t* addr,
#elif SIZEOF_VOID_P == 8 && OPAL_HAVE_ATOMIC_ADD_64
return opal_atomic_fetch_add_64((opal_atomic_int64_t*) addr, (unsigned long) delta);
#else
abort ();
OPAL_ABORT();
return 0;
#endif
}
Expand All @@ -417,7 +417,7 @@ static inline intptr_t opal_atomic_add_fetch_ptr( opal_atomic_intptr_t* addr,
#elif SIZEOF_VOID_P == 8 && OPAL_HAVE_ATOMIC_ADD_64
return opal_atomic_add_fetch_64((opal_atomic_int64_t*) addr, (unsigned long) delta);
#else
abort ();
OPAL_ABORT();
return 0;
#endif
}
Expand All @@ -430,7 +430,7 @@ static inline intptr_t opal_atomic_fetch_sub_ptr( opal_atomic_intptr_t* addr,
#elif SIZEOF_VOID_P == 8 && OPAL_HAVE_ATOMIC_SUB_32
return opal_atomic_fetch_sub_64((opal_atomic_int64_t*) addr, (unsigned long) delta);
#else
abort();
OPAL_ABORT();
return 0;
#endif
}
Expand All @@ -443,7 +443,7 @@ static inline intptr_t opal_atomic_sub_fetch_ptr( opal_atomic_intptr_t* addr,
#elif SIZEOF_VOID_P == 8 && OPAL_HAVE_ATOMIC_SUB_32
return opal_atomic_sub_fetch_64((opal_atomic_int64_t*) addr, (unsigned long) delta);
#else
abort();
OPAL_ABORT();
return 0;
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/base/mca_base_var.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static void resolve_relative_paths(char **file_prefix, char *file_path, bool rel
if( OPAL_SUCCESS != fixup_files(file_prefix, file_path, rel_path_search, sep) ) {
#if 0
/* JJH We need to die! */
abort();
OPAL_ABORT();
#else
;
#endif
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/btl/ugni/btl_ugni_component.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ int mca_btl_ugni_progress_datagram (mca_btl_ugni_device_t *device)
/* there is no way to recover from this error so just abort() */
BTL_ERROR(("could not find/allocate a btl endpoint for peer %s",
OPAL_NAME_PRINT(ugni_module->wc_remote_attr.proc_name)));
abort ();
OPAL_ABORT();
return OPAL_ERR_NOT_FOUND;
}
}
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/btl/usnic/btl_usnic_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void opal_btl_usnic_register_test(const char *name,
opal_btl_usnic_test_fn_t test_fn,
void *ctx)
{
abort(); /* never should be called */
OPAL_ABORT(); /* never should be called */
}

void opal_btl_usnic_run_tests(void)
Expand Down
2 changes: 1 addition & 1 deletion opal/mca/btl/usnic/btl_usnic_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ size_t opal_btl_usnic_convertor_pack_peek(
rc = opal_convertor_clone_with_position(conv, &temp, 1, &position);
if (OPAL_UNLIKELY(rc < 0)) {
BTL_ERROR(("unexpected convertor error"));
abort(); /* XXX */
OPAL_ABORT(); /* XXX */
}
OPAL_ASSERT(position >= conv->bConverted);
packable_len = position - conv->bConverted;
Expand Down
10 changes: 5 additions & 5 deletions opal/util/bipartite_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ int opal_bp_graph_clone(const opal_bp_graph_t *g,
if (copy_user_data) {
opal_output(0, "[%s:%d:%s] user data copy requested but not yet supported",
__FILE__, __LINE__, __func__);
abort();
OPAL_ABORT();
return OPAL_ERR_FATAL;
}

Expand Down Expand Up @@ -584,7 +584,7 @@ bool opal_bp_graph_bellman_ford(opal_bp_graph_t *gx,
(dist[u] + e_ptr->cost) < dist[v]) {
opal_output(0, "[%s:%d:%s] negative-weight cycle detected",
__FILE__, __LINE__, __func__);
abort();
OPAL_ABORT();
goto out;
}
}
Expand Down Expand Up @@ -657,7 +657,7 @@ int opal_bp_graph_bipartite_to_flow(opal_bp_graph_t *g)
if (inbound > 0 && outbound > 0) {
opal_output(0, "[%s:%d:%s] graph is not (unidirectionally) bipartite",
__FILE__, __LINE__, __func__);
abort();
OPAL_ABORT();
}
else if (inbound > 0) {
/* "right" side of the graph, create edges to the sink */
Expand Down Expand Up @@ -824,7 +824,7 @@ static int min_cost_flow_ssp(opal_bp_graph_t *gx,
if (OPAL_SUCCESS != err) {
opal_output(0, "[%s:%d:%s] unable to set capacity, missing edge?",
__FILE__, __LINE__, __func__);
abort();
OPAL_ABORT();
}

c = get_capacity(gx, v, u) + cap_f_path;
Expand All @@ -833,7 +833,7 @@ static int min_cost_flow_ssp(opal_bp_graph_t *gx,
if (OPAL_SUCCESS != err) {
opal_output(0, "[%s:%d:%s] unable to set capacity, missing edge?",
__FILE__, __LINE__, __func__);
abort();
OPAL_ABORT();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions opal/util/opal_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ OPAL_DECLSPEC extern bool opal_assert_core_enabled;
abort(); \
} \
else { \
fprintf(stderr, "ERROR: %s:%d: %s: Program aborted.\n", __FILE__, __LINE__, __func__); \
fprintf(stderr, "ERROR: %s:%d: %s(): Program aborted.\n", __FILE__, __LINE__, __func__); \
fprintf(stderr, "WARNING: No core file will be generated.\n"); \
fprintf(stderr, "If you would like to generate a core file, please rerun without: \'--mca opal_enable_assert_core 1\'\n"); \
fprintf(stderr, "If you would like to generate a core file, please rerun with: \'--mca opal_enable_assert_core 1\'\n"); \
fprintf(stderr, "Exiting.\n"); \
fflush(stderr); \
_exit(1); \
Expand Down
4 changes: 2 additions & 2 deletions opal/win32/opal_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static __inline size_t sysconf(int option) {
}
printf( "This functionality is not supported: line: %d\tfile: %s\n",
__LINE__, __FILE__ );
abort();
OPAL_ABORT();
return 0;
}

Expand All @@ -102,7 +102,7 @@ static __inline int fcntl (int fildes, int cmd, ...) {
case F_GETFL: ret = 0;
break;
default: printf("Option not supported: %d %s\n", __LINE__, __FILE__);
abort();
OPAL_ABORT();
};

return ret;
Expand Down

0 comments on commit 76c43ca

Please sign in to comment.