Bug 1072645 - missing socket.h include in uapi/rdma/rdma_user_cm.h breaks systemtap
Summary: missing socket.h include in uapi/rdma/rdma_user_cm.h breaks systemtap
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: rdma
Version: 19
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Doug Ledford
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-05 01:13 UTC by Clem Dickey
Modified: 2014-07-17 14:24 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-17 14:24:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Systemtap script to reproduce RDMA header compile bug (175 bytes, text/plain)
2014-03-05 01:13 UTC, Clem Dickey
no flags Details

Description Clem Dickey 2014-03-05 01:13:59 UTC
Created attachment 870709 [details]
Systemtap script to reproduce RDMA header compile bug

Description of problem:


Version-Release number of selected component (if applicable):
Fedora 19 and RHEL 

How reproducible:


Steps to Reproduce:
1. Install systemtap-devel, kernel-headers and kernel-debuginfo packages.
2. Create a systemtap script (attached) which references an rdma user structure.
3. Run the script with the following "verbose" flags.
  $ stap --vp 04 foo.stp

Actual results:

stap exits with an error. The output includes this message:

In file included from <command-line>:0:0:
include/uapi/rdma/rdma_user_cm.h:112:26: error: field ‘addr’ has incomplete type
  struct sockaddr_storage addr;
                          ^
Expected results:

stap starts without error. (use Ctrl-C to stop it.)

Additional info:

The error occurs because include/uapi/rdma/rdma_user_cm.h does not include linux/socket.h, which defines struct sockaddr_storage. The error is also present in RHEL 6.5 (RPM kernel-headers-2.6.32-431.3.1.el6.x86_64, file include/rdma/rdma_user_cm.h). The immediate problem can be fixed by adding the include.

The more general problem is this: No process verifies that include files (with some exceptions) compile by themselves (or equivalently, are included as the first non-whitespace in a file which compiles.) If there were such a process, it would have caught the bug.

Comment 1 Clem Dickey 2014-03-05 02:21:18 UTC
Further, for user-mode use, instances of instances of "struct sockaddr_storage" should change to "struct __kernel_sockaddr_storage". That is the name exposed in include/uapi/linux/socket.h.

Comment 2 Doug Ledford 2014-07-17 14:24:46 UTC
A patch for the include file has been sent upstream and should be picked up and eventually make its way back into the Fedora kernels.


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