Bug 1889433

Summary: new strerrorname_np() in glibc2.32/Fedora33Beta returns error string rather than name
Product: [Fedora] Fedora Reporter: Ali Bahrami <ali_redhatbugzilla>
Component: glibcAssignee: Patsy Griffin <pfrankli>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 33CC: ali_redhatbugzilla, aoliva, ashankar, codonell, dj, fweimer, law, mfabian, pfrankli, rth, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Fixed In Version: glibc-2.32-2.fc33 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-14 01:12: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:

Description Ali Bahrami 2020-10-19 16:23:31 UTC
Description of problem:
The new strerrorname_np() function in glibc 3.22 found in Fedora 33 Beta returns error strings rather than error names (i.e. what strerrordesc_np() is expected to return).

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

glibc 2.32, in Fedora 33 Beta, downloaded on Friday Oct. 16.

How reproducible:

1. Call strerrorname_np() with an errno value, and observe that the error string is returned rather than the error name.

    % cat test2.c
    #include <stdio.h>
    #include <string.h>

    main(int argc, char **argv)
            printf("expect EINVAL: %s\n", strerrorname_np(22));

    % gcc -D_GNU_SOURCE test2.c
    % ./a.out
    expect EINVAL: Invalid argument 

Actual results:

   expect EINVAL: Invalid argument 

Expected results:

   expect EINVAL: EINVAL

Additional info:

Comment 1 Carlos O'Donell 2020-10-20 13:49:47 UTC
This is a known issue and I worked with upstream to resolve this.

Fixed upstream with this commit:

commit cef95fdc2e4002ee6357d8d40ef73c8d875720e3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Aug 31 11:53:51 2020 -0300

    string: Fix strerrorname_np return value [BZ #26555]
    It returns the string of the error constant, not its description (as
    strerrordesc_np).  To handle the Hurd error mapping, the ERR_MAP was
    removed from errlist.h to errlist.c.
    Also, the testcase test-strerr (added on 325081b9eb2) was not added
    on the check build neither it builds correctly.  This patch also
    changed it to decouple from errlist.h, the expected return values
    are added explicitly for both both strerrorname_np and strerrordesc_np
    Checked on x86_64-linux-gnu and i686-linux-gnu.  I also run a make
    check for i686-gnu.

Fixed with commit 69beb5cbf85cae1c61fe7432500ac10880dc7b07 on release/2.32/master.

We are currently waiting for the Fedora 33 release to open to allow us to update the glibc release.

Comment 2 Ali Bahrami 2020-10-20 16:43:34 UTC
I apologize for filing a known issue. It did seem too obvious to
not already be known, and I did look, but apparently with the
wrong search terms.

Thanks for pulling the fix back to 2.32. It will be nice not
to have to wait for 2.33.

Comment 7 Fedora Update System 2020-11-11 12:22:41 UTC
FEDORA-2020-dd4d5f2d31 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd4d5f2d31

Comment 8 Fedora Update System 2020-11-12 04:25:06 UTC
FEDORA-2020-dd4d5f2d31 has been pushed to the Fedora 33 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-dd4d5f2d31`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-dd4d5f2d31

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Ali Bahrami 2020-11-13 17:24:01 UTC
I installed this from the testing repository by following the given directions, and can confirm that it addresses the issue. strerrorname_np() now correctly returns the error names. Thank You.

Comment 10 Fedora Update System 2020-11-14 01:12:29 UTC
FEDORA-2020-dd4d5f2d31 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.