Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop the LDFLAGS="-Wl,--no-as-needed" workaround when BZ#1827338 is worked out #247

Open
mrc0mmand opened this issue Apr 23, 2020 · 3 comments

Comments

@mrc0mmand
Copy link
Member

mrc0mmand commented Apr 23, 2020

dfe84a2 disabled the clang sanitizers job, since the latest LLVM/clang (10.0.x) breaks the sanitizers run in a pretty interesting way (see BZ#1827338). As gcc 10.0.x doesn't suffer from this issue, let's use that in the meantime.

@mrc0mmand mrc0mmand changed the title Re-enable clang sanitizer job once BZ#1827338 is worked out Re-enable clang sanitizers job once BZ#1827338 is worked out Apr 23, 2020
@mrc0mmand
Copy link
Member Author

Also see #248.

@mrc0mmand
Copy link
Member Author

Oh well, ASan in gcc 10.1.0 picked up the issue as well:

[root@bbd28b3fbe6e /]# gcc -fsanitize=address -o main main.c
[root@bbd28b3fbe6e /]# ./main 
AddressSanitizer:DEADLYSIGNAL
=================================================================
==1282==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x000000000000 bp 0x7fff302e4ca0 sp 0x7fff302e4428 T0)
==1282==Hint: pc points to the zero page.
==1282==The signal is caused by a READ memory access.
==1282==Hint: address points to the zero page.
    #0 0x0  (<unknown module>)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (<unknown module>) 
==1282==ABORTING
[root@bbd28b3fbe6e /]# gcc --version
gcc (GCC) 10.1.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mrc0mmand added a commit that referenced this issue May 15, 2020
GCC 10 picked up the ASAn issue as well, making TEST-46-HOMED broken
under sanitizers in both runs (clang & gcc), see #247. Disabling
temporarily to not break current PR runs, but will try to come up with a
reasonable workaround shortly.
mrc0mmand added a commit to mrc0mmand/systemd-centos-ci that referenced this issue May 15, 2020
Since version 10, both gcc and clang started to ignore certain linker errors
when compiling with -fsanitize=address. This eventually leads up to a cc
command line which has -Wl,--as-needed that causes linking against libcrypt
(-lcrypt) to have no effect and causing systemd-homed (and its utilities) to
crash when they try to resolve an external symbol from the libcrypt library.
Negating the -Wl,--as-needed by -Wl,--no-as-needed seems to help in this case.

See:
  https://bugzilla.redhat.com/show_bug.cgi?id=1827338#c3
  systemd#247
mrc0mmand added a commit to mrc0mmand/systemd-centos-ci that referenced this issue May 15, 2020
Since version 10, both gcc and clang started to ignore certain linker errors
when compiling with -fsanitize=address. This eventually leads up to -lcrypt
not being correctly propagated, but the fact is masked by the aforementioned
issue. However, when the binary attempts to load a symbol from the libcrypt
binary, it crashes since it's not linked correctly against it.
Negating the -Wl,--as-needed used by default by -Wl,--no-as-needed seems to
help in this case.

See:
  https://bugzilla.redhat.com/show_bug.cgi?id=1827338#c3
  systemd#247
@mrc0mmand mrc0mmand changed the title Re-enable clang sanitizers job once BZ#1827338 is worked out Drop the LDFLAGS="-Wl,--no-as-needed" workaround when BZ#1827338 is worked out May 20, 2020
@mrc0mmand
Copy link
Member Author

Update: a patch has been proposed: https://reviews.llvm.org/D85011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant