[ofiwg] Libfabric and defensive programming

Doug Oucharek doucharek at cray.com
Fri Jun 8 10:27:05 PDT 2018


Out of curiosity:

Why does there appear to be little to no defensive programming in libfabric?  Was this a conscious decision?

For example, I am not seeing any checks for NULL object pointers in the libfabric interface functions.  They just dereference the object to get the provider function pointer.  If NULL does get passed in, the process crashes.  Because these are inline functions, they do not show up in a traceback which makes things very confusing to debug for anyone not fully familiar with libfabric source code.

Would it not be better to at least check for NULL object parameters in these “front-end” function and return FI-EINVAL?

Doug


More information about the ofiwg mailing list