Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1980919

Summary: xdrrec_create() function prototype doesn't match documentation, causing compiler error
Product: Red Hat Enterprise Linux 8 Reporter: Andrew Mike <amike>
Component: man-pagesAssignee: Nikola Forró <nforro>
Status: CLOSED ERRATA QA Contact: Dita Stehlikova <dstehlik>
Severity: high Docs Contact:
Priority: high    
Version: 8.4CC: alanm, brclark, casantos, dwysocha, ikent, jkejda, jwright, kwalker, msuchy, nforro, sbarcomb, steved, svaughn, swhiteho, thomas.g.owen, xzhou
Target Milestone: betaKeywords: Reproducer, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: man-pages-4.15-7.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-10 15:31:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2042972    
Bug Blocks:    
Attachments:
Description Flags
Test C code showing the issue none

Description Andrew Mike 2021-07-09 20:41:54 UTC
Created attachment 1800129 [details]
Test C code showing the issue

Description of problem: The xdrrec_create() function of the libtirpc library in RHEL 8 doesn't match what's in the documentation; as such, if the function is utilized as documented, you get a compilation error.

Version-Release number of selected component (if applicable):
1.1.4-4.el8

How reproducible: 100%

Steps to Reproduce:

Compile attached code sample using "g++ `pkg-config --cflags libtirpc` xdrtest.c -o xdrtest".

Actual results: Compilation fails with the following error:

xdrtest.c: In function ‘int main()’:
xdrtest.c:21:19: error: invalid conversion from ‘int (*)(void*, char*, int)’ to ‘int (*)(void*, void*, int)’ [-fpermissive]
                   (int(*)(void*, char*, int))myReadProcCB,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from xdrtest.c:1:
/usr/include/tirpc/rpc/xdr.h:362:8: note:   initializing argument 5 of ‘void xdrrec_create(XDR*, u_int, u_int, void*, int (*)(void*, void*, int), int (*)(void*, void*, int))’
        int (*)(void *, void *, int),
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
xdrtest.c:22:19: error: invalid conversion from ‘int (*)(void*, char*, int)’ to ‘int (*)(void*, void*, int)’ [-fpermissive]
                   (int(*)(void*, char*, int))myWriteProcCB);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from xdrtest.c:1:
/usr/include/tirpc/rpc/xdr.h:363:8: note:   initializing argument 6 of ‘void xdrrec_create(XDR*, u_int, u_int, void*, int (*)(void*, void*, int), int (*)(void*, void*, int))’
        int (*)(void *, void *, int));
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


Expected results: Compilation succeeds.


Additional info:

The man page for xdrrec_create() shows this header:

void xdrrec_create(XDR *xdrs, unsigned int sendsize, 
                          unsigned int recvsize, char *handle,
                          int (*readit) (char *, char *, int),
                          int (*writeit) (char *, char *, int));

But looking in /usr/include/tirpc/rpc/xdr.h, this is what is seen:

extern void   xdrrec_create(XDR *, u_int, u_int, void *, 
                            int (*)(void *, void *, int),
                            int (*)(void *, void *, int));

Unclear whether this is the code's fault or the documentation's.

Comment 2 Thomas Owen 2021-09-03 14:32:31 UTC
(developer who reported the issue here - I've been asked to provide more background/detail on this)

We have a large, distributed, multi process peer-to-peer system written in C++.  This system uses XDR
for intra-process messaging and object streaming.

For the last 10+ years (at least since RHEL 5), the XDR routines have been provided in glibc.  In those
routines, the stream initialization method xdrrec_create has taken read/write callback function 
pointers with a signature of int(*)(char *, char *, int).

In RHEL 8, glibc no longer provides the XDR routines (they went away when rpc was removed).  libtirpc's
version of XDR has some non-compatible changes to method signatures. Notably, xdrrec_create now wants the
read/write callback function pointers to have signature int(*)(void *, void *, int).  There may be other
incompatabilities, but this one causes errors that break our build.

It appears that libtirpc was intended to be a compatible replacement for the glibc version of rpc and XDR.  
If this is so, it would seem beneficial for the existing method signatures to be compatible.  This does seem
to be the intent, as the RHEL 8 man page for XDR still shows the old signature for xdrrec_create.  Writing
code that conforms to the provided documentation fails to compile.

The impact to our system is that our very low level IPC framework no longer compiles, as the callback methods
for use with XDR are no longer compatible with the library, even though they conform to the documentation.  This
means that none of our applications can build, as they all rely on these base classes for communication.

Our current quandry is thus:  The code currently conforms to the provided documentation, but will not compile.
The headers provided as part of libtirpc do not conform to the documentation.  We do not have a clear path forward
until we know which is considered to be in error:  The documentation, or the implementation.  We would prefer 
that the libtirpc methods be made compatible with code written against the glibc versions which they replace.

Comment 4 Steve Dickson 2021-09-07 14:37:04 UTC
Yes it does appear the xdrrec_create(3) man page is not correct.
It is all incorrect in the upstream version of the man-pages package. 
cc-ing the upstream maintainer.

Comment 5 Nikola Forró 2021-09-08 15:36:21 UTC
man-pages project documents the (now deprecated) glibc implementation. libtirpc has its own man pages, in section 3t (man 3t rpc, man 3t rpc_xdr), but it seems xdrrec_* functions are not documented.

Comment 8 Kyle Walker 2021-09-28 20:26:43 UTC
@nforro
Just to fully confirm, the Documentation is incorrect/lacking in this instance.

If you agree, I assume the next steps would be to:

  1 - Create documentation covering this need (xdrrec_* functions) in the upstream libtirpc project.

  2 - Backport that documentation into the man-pages package, thereby removing the glibc-based documentation regarding these functions.


Does that coincide with your estimation?

Comment 9 Nikola Forró 2021-09-29 10:23:38 UTC
(In reply to Kyle Walker from comment #8)
> Just to fully confirm, the Documentation is incorrect/lacking in this
> instance.
> 
> If you agree, I assume the next steps would be to:
> 
>   1 - Create documentation covering this need (xdrrec_* functions) in the
> upstream libtirpc project.

Definitely.

>   2 - Backport that documentation into the man-pages package, thereby
> removing the glibc-based documentation regarding these functions.

We can remove the glibc-based documentation from man-pages package not to confuse users, but libtirpc documentation should be part of libtirpc package (inherited from upstream).

Comment 34 errata-xmlrpc 2022-05-10 15:31:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (man-pages bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2108