Bug 1261596

Summary: xdrstdio_create buffers do not output encoded values on ppc
Product: Red Hat Enterprise Linux 6 Reporter: Michael Meseke <michael.meseke>
Component: libtirpcAssignee: Steve Dickson <steved>
Status: CLOSED WONTFIX QA Contact: Filesystem QE <fs-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.5CC: pgtoennies, tgummels, woodard, xzhou
Target Milestone: rc   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1261738 (view as bug list) Environment:
Last Closed: 2017-12-06 12:09:16 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:    
Bug Blocks: 1261738    
Attachments:
Description Flags
Reproducer none

Description Michael Meseke 2015-09-09 18:21:31 UTC
Created attachment 1071892 [details]
Reproducer

Description of problem:
Using xdrstdio_create to encode buffers does not work on PPC

Version-Release number of selected component (if applicable):
tirpc 0.2.1-10

How reproducible:
Every time.

Steps to Reproduce:
1. Compile the common example programs described in with tirpc: 

https://www-01.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.progcomc/xdr_justif_ex.htm 

Actual results:

$ ./writer-tirpc | ./reader-tirpc
942013120 942013120 942013120 942013120 942013120 942013120 942013120 942013120 

with a version compiled without tirpc it works okay:

$ ./writer | ./reader
0 1 2 3 4 5 6 7 

The non-tirpc writer output looks like:
$ ./writer | hexdump
0000000 0000 0000 0000 0001 0000 0002 0000 0003
0000010 0000 0004 0000 0005 0000 0006 0000 0007
0000020

The tirpc writer output looks like:
$ ./writer\-tirpc  | hexdump
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0000020

on x86, the tirpc writer output looks like:
$ ./writer-tirpc | hexdump
0000000 0000 0000 0000 0100 0000 0200 0000 0300
0000010 0000 0400 0000 0500 0000 0600 0000 0700
0000020

Expected results:

$ ./writer-tirpc | ./reader-tirpc
0 1 2 3 4 5 6 7 

Additional info:

Initially found while testing with with 0.2.1-5.  Upgraded to 0.2.1-10 to no avail.

Comment 2 Murphy Zhou 2015-09-10 05:37:04 UTC
		ppc64	s390	x86_64	i386
RHEL-7.2Snap1   fail    fail    pass     x
RHEL-6.7	fail	fail	pass	pass

cloning to rhel7.

Comment 4 Steve Dickson 2015-10-26 14:35:51 UTC
The only difference in the code is:

glibc:

bool_t
xdr_long (XDR *xdrs, long *lp)
{

  if (xdrs->x_op == XDR_ENCODE
      && (sizeof (int32_t) == sizeof (long)
      || (int32_t) *lp == *lp))
    return XDR_PUTLONG (xdrs, lp);

  if (xdrs->x_op == XDR_DECODE)
    return XDR_GETLONG (xdrs, lp);

  if (xdrs->x_op == XDR_FREE)
    return TRUE;

  return FALSE;
}

libtirpc:

bool_t
xdr_long(xdrs, lp)
    XDR *xdrs;
    long *lp;
{   
    switch (xdrs->x_op) {
    case XDR_ENCODE:
        return (XDR_PUTLONG(xdrs, lp));
    case XDR_DECODE:
        return (XDR_GETLONG(xdrs, lp));
    case XDR_FREE:
        return (TRUE);
    }
    /* NOTREACHED */
    return (FALSE);
}


So this extra checking was added on write side

  if (xdrs->x_op == XDR_ENCODE
      && (sizeof (int32_t) == sizeof (long)
      || (int32_t) *lp == *lp))
    return XDR_PUTLONG (xdrs, lp);

Its not clear what that check is for and how it is different
for PPC...

Comment 6 Jan Kurik 2017-12-06 12:09:16 UTC
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.

The official life cycle policy can be reviewed here:

http://redhat.com/rhel/lifecycle

This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:

https://access.redhat.com/