Regressed by https://github.com/jiixyj/epoll-shim/commit/71af8c103bb4. Not sure which fix is better. src/fabric.c:683:7: error: no member named 'epoll_shim_close' in 'fi_ops' FI_CHECK_OP(info->nic->fid.ops, struct fi_ops, close)) { ^ ~~~~~ ./include/rdma/fabric.h:555:23: note: expanded from macro 'FI_CHECK_OP' (ops && (ops->size > offsetof(opstype, op)) && ops->op) ^ ~~ /usr/include/stddef.h:73:31: note: expanded from macro 'offsetof' #define offsetof(type, field) __offsetof(type, field) ^ ~~~~~ /usr/include/sys/cdefs.h:487:34: note: expanded from macro '__offsetof' #define __offsetof(type, field) __builtin_offsetof(type, field) ^ ~~~~~ src/fabric.c:683:54: error: no member named 'epoll_shim_close' in 'struct fi_ops' FI_CHECK_OP(info->nic->fid.ops, struct fi_ops, close)) { ~~~~~~~~~~~~~~~~~~ ^ /usr/local/include/libepoll-shim/sys/epoll.h:74:15: note: expanded from macro 'close' #define close epoll_shim_close ^ ./include/rdma/fabric.h:555:54: note: expanded from macro 'FI_CHECK_OP' (ops && (ops->size > offsetof(opstype, op)) && ops->op) ~~~ ^ http://beefy9.nyi.freebsd.org/data/113amd64-default/526001/logs/errors/libfabric-1.8.1.log
Created attachment 211623 [details] disable helpers
Created attachment 211624 [details] undef conflicts
Sorry for the breakage. In the latest epoll-shim code, "epoll_create" returns a handle to an internal context object which manages some state, and therefore needs to be closed with "epoll_shim_close". But the worst that can happen with a normal "close" is a memory leak. This may or may not be tolerable, depending on the use case. I guess the most robust workaround is something like this: +#ifdef SHIM_SYS_SHIM_HELPERS +#undef close +#endif return fid->ops->close(fid); +#ifdef SHIM_SYS_SHIM_HELPERS +#define close epoll_shim_close +#endif ... i.e. redefining "close" after a problematic line back to "epoll_shim_close". Is it possible to script something like this in the post-patch section with REINPLACE_CMD maybe?
Created attachment 211633 [details] ignore (fix for bug 244087) (In reply to Jan Kokemüller from comment #3) > Is it possible to script something like this? I did so in attachment 211624 [details] but accidentally applied to non-C files as well.
Comment on attachment 211623 [details] disable helpers As described in comment 3 this version may cause a memory leak.
Created attachment 211634 [details] undef conflicts Oops, previous version was for a different bug.
When I apply the patch, I get results like: @@ -495,6 +495,9 @@ struct fi_ops { size_t size; +#ifdef SHIM_SYS_SHIM_HELPERS +#undef close +#endif int (*close)(struct fid *fid); int (*bind)(struct fid *fid, struct fid *bfid, uint64_t flags); int (*control)(struct fid *fid, int command, void *arg); ...but the redefinition is missing. Something like: @@ -495,6 +495,9 @@ struct fi_ops { size_t size; +#ifdef SHIM_SYS_SHIM_HELPERS +#undef close +#endif int (*close)(struct fid *fid); +#ifdef SHIM_SYS_SHIM_HELPERS +#define close epoll_shim_close +#endif int (*bind)(struct fid *fid, struct fid *bfid, uint64_t flags); int (*control)(struct fid *fid, int command, void *arg); So that each problematic close gets both the undef and the redefine.
Landed in ports r526106. I've mistyped bug number.