Fix error check in dapls_ib_wait_object_create() and dat_evd_alloc.
When attempting to create large number of evd's that exceed
open files limit the error was not propagated up causing
a segfault. Note: there are 3 FD's required for each EVD
2 for pipe, and one for cq event_channel.
Change the error reporting to indicate correct return
code and send to log with non-debug builds.
Signed-off by: Arlin Davis ardavis@ichips.intel.com
((evd_flags & ~ (DAT_EVD_DTO_FLAG|DAT_EVD_RMR_BIND_FLAG)) == 0 ))
{
dapls_ib_wait_object_create (evd_ptr, &evd_ptr->cq_wait_obj_handle);
+ if (evd_ptr->cq_wait_obj_handle == NULL) {
+ dapl_os_free(evd_ptr, sizeof (DAPL_EVD));
+ evd_ptr = NULL;
+ goto bail;
+ }
}
#endif
channel, 0);
if (evd_ptr->ib_cq_handle == IB_INVALID_HANDLE)
- return DAT_INSUFFICIENT_RESOURCES;
+ return(dapl_convert_errno(errno,"create_cq"));
/* arm cq for events */
dapls_set_cq_notify(ia_ptr, evd_ptr);
bail:
dapl_os_free(*p_cq_wait_obj_handle,
sizeof(struct _ib_wait_obj_handle));
-
+ *p_cq_wait_obj_handle = NULL;
return(dapl_convert_errno(errno," wait_object_create"));
}
{
if (!err) return DAT_SUCCESS;
-#if DAPL_DBG
if ((err != EAGAIN) && (err != ETIME) &&
(err != ETIMEDOUT) && (err != EINTR))
- dapl_dbg_log (DAPL_DBG_TYPE_ERR," %s %s\n", str, strerror(err));
-#endif
+ dapl_log (DAPL_DBG_TYPE_ERR," %s %s\n", str, strerror(err));
switch( err )
{