Bug 1702761 - gcc 9 -fsanitize=address breaks configure-time detection of -ldl because it silently imports dlopen
Summary: gcc 9 -fsanitize=address breaks configure-time detection of -ldl because it s...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-24 17:11 UTC by Richard W.M. Jones
Modified: 2020-05-26 15:39 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-26 15:39:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2019-04-24 17:11:44 UTC
Description of problem:

configure scripts try to detect what library is needed
to use dlopen, dlsym etc, by doing:

$ cat conftest.c
char dlopen ();
int
main ()
{
return dlopen ();
  ;
  return 0;
}

$ gcc -o conftest $CFLAGS conftest.c

and trying various -l libraries.

Unfortunately:

$ gcc -o conftest -fsanitize=address conftest.c

does not fail, so configure believes that no library
is needed.  However it does actually fail later because
although somehow -fsanitize=address imports dlopen silently,
it doesn't import dlsym.

This is certainly a regression over earlier versions of
GCC because I used to test this and haven't seen this
problem before.

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

gcc-9.0.1-0.10.fc30.x86_64

How reproducible:

100%

Steps to Reproduce:
1. See above.

Additional info:

Actual configure.ac section which fails:

https://github.com/libguestfs/nbdkit/blob/4a68b7dd553fe915dad5dbc8234dced28913b0e3/configure.ac#L227

Comment 1 Jakub Jelinek 2019-04-24 17:18:05 UTC
No change happened on the gcc or libasan side for years.
The only thing that it could be caused by is the https://fedoraproject.org/wiki/Changes/RemoveExcessiveLinking
mess.

Comment 2 Eric Blake 2019-04-24 17:43:07 UTC
A possible workaround - since the program depends on dlsym, configure.ac should probe for dlsym rather (or in addition to) dlopen

Comment 3 Richard W.M. Jones 2019-04-24 20:27:57 UTC
I tried it on a few systems:

gcc-4.8.5-36.el7.x86_64 => undefined reference to symbol 'dlopen@@GLIBC_2.2.5'
gcc-7.3.1-6.fc27.x86_64 => no error
gcc-8.2.1-3.5.el8.x86_64 => no error
gcc-8.3.1-2.fc28.x86_64 => no error

So yes I guess it's been like this for longer than I thought.

Comment 4 Ben Cotton 2020-04-30 21:49:09 UTC
This message is a reminder that Fedora 30 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 30 on 2020-05-26.
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 '30'.

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 30 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 5 Ben Cotton 2020-05-26 15:39:46 UTC
Fedora 30 changed to end-of-life (EOL) status on 2020-05-26. Fedora 30 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.