Bug 1333945

Summary: glibc: dlerror () returns NULL after dlsym (RTLD_NEXT) of a non-existent symbol
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: arjun.is, codonell, dj, fweimer, jakub, law, mfabian, pfrankli, siddhesh
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1300049 Environment:
Last Closed: 2017-07-27 11:09:23 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: 1336691, 1336699    
Bug Blocks: 1300049    

Description Florian Weimer 2016-05-06 18:18:23 UTC
These upstream fixes should be backported:

commit e91bd7465816f474617dcb4bbfe72f3594c5783c
Author: Adhemerval Zanella <adhemerval.zanella>
Date:   Thu Mar 31 10:51:51 2016 -0300

    Fix tst-dlsym-error build
    
    This patch fixes the new test tst-dlsym-error build on aarch64
    (and possible other architectures as well) due missing strchrnul
    definition.
    
        * elf/tst-dlsym-error.c: Include <string.h> for strchrnul.

commit 7d45c163d00c88d5875a112343c4ea3e61349e6b
Author: Florian Weimer <fweimer>
Date:   Thu Mar 31 11:26:55 2016 +0200

    Report dlsym, dlvsym lookup errors using dlerror [BZ #19509]
    
        * elf/dl-lookup.c (_dl_lookup_symbol_x): Report error even if
        skip_map != NULL.
        * elf/tst-dlsym-error.c: New file.
        * elf/Makefile (tests): Add tst-dlsym-error.
        (tst-dlsym-error): Link against libdl.

Comment 1 Fedora Update System 2016-05-07 17:19:45 UTC
glibc-2.22-15.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-68abc0be35

Comment 2 Fedora Update System 2016-05-08 16:25:35 UTC
glibc-2.22-15.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-68abc0be35

Comment 3 Florian Weimer 2016-05-09 10:48:27 UTC
Fixed for 2.23 with these new backports:

commit a824d609581d5ee7544aabcbbc70e8da44b2b5b6
Author: Adhemerval Zanella <adhemerval.zanella>
Date:   Thu Mar 31 10:51:51 2016 -0300

    Fix tst-dlsym-error build
    
    This patch fixes the new test tst-dlsym-error build on aarch64
    (and possible other architectures as well) due missing strchrnul
    definition.
    
        * elf/tst-dlsym-error.c: Include <string.h> for strchrnul.
    
    (cherry picked from commit e91bd7465816f474617dcb4bbfe72f3594c5783c)

commit 80f87443eed17838fe453f1f5406ccf5d3698c25
Author: Florian Weimer <fweimer>
Date:   Thu Mar 31 11:26:55 2016 +0200

    Report dlsym, dlvsym lookup errors using dlerror [BZ #19509]
    
        * elf/dl-lookup.c (_dl_lookup_symbol_x): Report error even if
        skip_map != NULL.
        * elf/tst-dlsym-error.c: New file.
        * elf/Makefile (tests): Add tst-dlsym-error.
        (tst-dlsym-error): Link against libdl.
    
    (cherry picked from commit 7d45c163d00c88d5875a112343c4ea3e61349e6b)

Comment 4 Fedora Update System 2016-05-09 14:55:39 UTC
glibc-2.23.1-6.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-b321728d74

Comment 5 Florian Weimer 2016-05-10 11:56:06 UTC
This bug fix breaks Address Sanitizer:

  https://llvm.org/bugs/show_bug.cgi?id=27310

I think it's not really defined what ASAN is doing (you need to have a working malloc when you call dlsym), but the question is if this kind of breakage is worth fixing this bug.

Typical error message:

==10293==AddressSanitizer CHECK failed: ../../../../libsanitizer/asan/asan_rtl.cc:556 "((!asan_init_is_running && "ASan init calls itself!")) != (0)" (0x0, 0x0)
    <empty stack>

Comment 6 Fedora Update System 2016-05-10 17:57:40 UTC
glibc-2.22-15.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2016-05-10 20:29:35 UTC
glibc-2.23.1-6.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-b321728d74

Comment 8 Florian Weimer 2016-05-11 09:52:33 UTC
Patch had to be reverted due to bug 1335011.

Comment 9 Fedora End Of Life 2017-07-25 20:41:15 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 10 Florian Weimer 2017-07-27 11:10:20 UTC
The revert has been reverted upstream, and this is fixed glibc 2.24 and later.