Bug 2124810

Summary: the motif libraries are not compiled with the LONG_BIT being set
Product: Red Hat Enterprise Linux 8 Reporter: Francisco Peralta <fperalta>
Component: motifAssignee: Olivier Fourdan <ofourdan>
Status: CLOSED ERRATA QA Contact: Tomas Pelka <tpelka>
Severity: high Docs Contact:
Priority: high    
Version: 8.4CC: ndegraef, ofourdan, sbarcomb, tpelka
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: All   
Whiteboard:
Fixed In Version: motif-2.3.4-19.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2125560 (view as bug list) Environment:
Last Closed: 2023-05-16 08:16: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:    
Bug Blocks: 2125560    

Description Francisco Peralta 2022-09-07 07:29:56 UTC
Description of problem:
Currently compiled and RPM packaged in RHEL 8 and RHEL 9 Motif libraries have the problem of LONG_BIT not being defined.
For instance /lib64/libXm.so is a 64-bit shared library but it seems not to be built with LONG_BIT == 64.

The problem is with Motif code (upstream) actually.

Even with "#include <limits.h>" added, LONG_BIT is still not defined *unless* you add -D_XOPEN_SOURCE to the build command line.

But if you do so, the build fails because caddr_t (an old BSD'ism) is not defined. So to build properly, we need two things:

1. Define _XOPEN_SOURCE where LONG_BIT is used
2. Replace caddr_t 

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

Motif-library (/lib64/libXm.so.4.0.4)
In motif-2.3.4-16.el8.x86_64.rpm etc.

How reproducible:

Always

Steps to Reproduce:

The error message on RHEL 7 and 8 was: _XtGetStringValues: bad size 8
Tracing it back in the Motif source we found::
static void _XtGetStringValues(Widget w, Arg *warg, int numargs)
{
    ...
    switch (res->resource_size)
    {
        case 1:
        ...
        case 2:
        ...
        case 4:
        ...
#if (LONG_BIT == 64)
        case 8:
        ...
#endif
        default:
           fprintf(stderr, "_XtGetStringValues: bad size %d\n", res->resource_size);
            string = "bad size";
            ...
    }
}


Expected results:

Libraries to be compiled with LONG_BIT set to 64.

Additional info:

Customer Case NR: 03305642
SO discussion: https://stackoverflow.com/questions/15817380/long-bit-in-limits-h

Comment 3 Olivier Fourdan 2022-09-09 10:10:39 UTC
Awaiting confirmation that the proposed fix addresses the issue.

Comment 11 errata-xmlrpc 2023-05-16 08:16: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 (motif 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-2023:2756