Bug 2047784 - ib_user_ioctl_verbs.h in rdma-core-devel vs in kernel-headers can cause compilation failures
Summary: ib_user_ioctl_verbs.h in rdma-core-devel vs in kernel-headers can cause compi...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rdma-core
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Kamal Heib
QA Contact: Infiniband QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-28 14:28 UTC by Adam Goldman
Modified: 2023-07-28 07:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-28 07:28:13 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-110217 0 None None None 2022-01-28 14:32:30 UTC

Description Adam Goldman 2022-01-28 14:28:44 UTC
Description of problem:

Attempting to include both headers with the same ifdef ("IB_USER_IOCTL_VERBS_H") wrapper can produce a failure depending on order of include, as the files are not identical.

Problem headers:
  /usr/include/rdma/ib_user_ioctl_verbs.h 
  /usr/include/infiniband/ib_user_ioctl_verbs.h


Version-Release number of selected component (if applicable):
  /usr/include/infiniband/ib_user_ioctl_verbs.h rdma-core-devel-32.0-4.el8.x86_64
  /usr/include/rdma/ib_user_ioctl_verbs.h       kernel-headers-4.18.0-305.el8.x86_64

There appear to be differences in other RHEL versions, though not the same fields.

How reproducible:

Compile simple c file with different defines.

Simple c file:
====
#ifdef BAD_ORDER
# include <rdma/ib_user_ioctl_verbs.h>
# include <infiniband/ib_user_ioctl_verbs.h>
#else
# include <infiniband/ib_user_ioctl_verbs.h>
# include <rdma/ib_user_ioctl_verbs.h>
#endif
int main(int argc, char **argv) {
    enum ib_uverbs_gid_type type = IB_UVERBS_GID_TYPE_IB;
    (void)type;
    return 0;
}
====
Steps to Reproduce:
1. gcc -DBAD_ORDER rdma.c


Actual results:
Compile this with "-DBAD_ORDER":

rdma.c: In function 'main':
rdma.c:11:7: error: variable 'type' has initializer but incomplete type
  enum ib_uverbs_gid_type type = IB_UVERBS_GID_TYPE_IB;
       ^~~~~~~~~~~~~~~~~~
rdma.c:11:33: error: 'IB_UVERBS_GID_TYPE_IB' undeclared (first use in this function); did you mean 'IB_UVERBS_PCF_TRAP_SUP'?
  enum ib_uverbs_gid_type type = IB_UVERBS_GID_TYPE_IB;
                                 ^~~~~~~~~~~~~~~~~~~~~
                                 IB_UVERBS_PCF_TRAP_SUP
rdma.c:11:33: note: each undeclared identifier is reported only once for each function it appears in
rdma.c:11:26: error: storage size of 'type' isn't known
  enum ib_uverbs_gid_type type = IB_UVERBS_GID_TYPE_IB;
                          ^~~~

Expected results:
No error

Additional info:
These files can de indirectly included from higher-level includes like verbs.h, etc.

Comment 3 RHEL Program Management 2023-07-28 07:28:13 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.


Note You need to log in before you can comment on or make changes to this bug.