Skip to content

Conversation

@iabyn
Copy link
Contributor

@iabyn iabyn commented Sep 11, 2024

Test 5 was failing on newer Linux builds with clang and ASAN.

This was indirectly because although since around 2020 both gcc and clang have -fno-common by default, clang+ASAN was putting some private symbols in the common section of the libperl object file while under -fno-cpmmon, namely this output from nm:

0000000000000008 C ___asan_globals_registered

It so happens that libperl.t handled -fno-common by aliasing a hash, $symbols{data}{common}{}, to another hash, $symbols{data}{bss}{} if {common} was empty. It then looked up a particular symbol under {common} and found it even if it was actually under {bss}. This scheme failed as soon as {common} was non-empty even under -fno-common.

This commit removes the common-to-bss aliasing trick and instead looks for the symbol under both common and bss. The test passes if either is found.

This commit also changes the test diagnostic output accordingly. It also now recognises (but ignores) 'w' and 'W' weak symbol types in nm output, such as

                 w __stop_asan_globals

TODO: fill description here


  • This set of changes requires a perldelta entry, and it is included.
  • This set of changes requires a perldelta entry, and I need help writing it.
  • This set of changes does not require a perldelta entry.

Test 5 was failing on newer Linux builds with clang and ASAN.

This was indirectly because although since around 2020 both gcc and
clang have -fno-common by default, clang+ASAN was putting some private
symbols in the common section of the libperl object file while under
-fno-cpmmon, namely this output from nm:

    0000000000000008 C ___asan_globals_registered

It so happens that libperl.t handled -fno-common by aliasing a hash,
$symbols{data}{common}{}, to another hash, $symbols{data}{bss}{} if
{common} was *empty*.  It then looked up a particular symbol under
{common} and found it even if it was actually under {bss}. This scheme
failed as soon as {common} was non-empty even under -fno-common.

This commit removes the common-to-bss aliasing trick and instead looks
for the symbol under both common and bss. The test passes if *either*
is found.

This commit also changes the test diagnostic output accordingly.  It
also now recognises (but ignores) 'w' and 'W' weak symbol types in nm
output, such as

                     w __stop_asan_globals
@jkeenan
Copy link
Contributor

jkeenan commented Sep 11, 2024

Test 5 was failing on newer Linux builds with clang and ASAN.

Can you provide the Configure invocation that reproduces this? Thanks.

@iabyn
Copy link
Contributor Author

iabyn commented Sep 11, 2024 via email

@iabyn iabyn merged commit c4c1a84 into blead Sep 12, 2024
@iabyn iabyn deleted the davem/libperl branch September 12, 2024 14:12
@Leont
Copy link
Contributor

Leont commented Sep 12, 2024

This test keeps being a continuous source of breakage, seems like every major release has at least one. At the same time its benefit is kind of dubious, has it ever even caught an issue?

I'm not sure we should keep this test, it seems like a poor trade-off.

@iabyn
Copy link
Contributor Author

iabyn commented Sep 13, 2024 via email

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

Successfully merging this pull request may close these issues.

5 participants