This is an archive of the discontinued LLVM Phabricator instance.

[scudo] Get rid of initLinkerInitialized
ClosedPublic

Authored by cryptoad on May 25 2021, 3:01 PM.

Details

Summary

Now that everything is forcibly linker initialized, it feels like a
good time to get rid of the init/initLinkerInitialized split.

This allows to get rid of various memset construct in init that
gcc complains about (this fixes a Fuchsia open issue).

I added various DCHECKs to ensure that we would get a zero-inited
object when entering init, which required ensuring that
unmapTestOnly leaves the object in a good state (tests are currently
the only location where an allocator can be "de-initialized").

Running the tests with --gtest_repeat= showed no issue.

Diff Detail

Event Timeline

cryptoad created this revision.May 25 2021, 3:01 PM
cryptoad requested review of this revision.May 25 2021, 3:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 25 2021, 3:01 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
hctim accepted this revision.May 25 2021, 3:17 PM

Yay!

compiler-rt/lib/scudo/standalone/stats.h
62

Can you also delete HybridMutex::init()?

compiler-rt/lib/scudo/standalone/tests/tsd_test.cpp
45

nit: floating ;

This revision is now accepted and ready to land.May 25 2021, 3:17 PM
cryptoad updated this revision to Diff 347810.May 25 2021, 3:34 PM
cryptoad marked 2 inline comments as done.

Remove HybridMutex::init, remove stray ;.

This revision was landed with ongoing or failed builds.May 26 2021, 9:54 AM
This revision was automatically updated to reflect the committed changes.
yroux added a subscriber: yroux.Jun 9 2021, 12:21 AM

Hi,

This change introduced a regression on ARMv7 Thumb bots which wasn't noticed due to other issues.

logs can be seen here: https://lab.llvm.org/buildbot/#/builders/26/builds/2251

The 3 tests fail with a bus error raised from tsd_shared.h line 49

Hi,

This change introduced a regression on ARMv7 Thumb bots which wasn't noticed due to other issues.

logs can be seen here: https://lab.llvm.org/buildbot/#/builders/26/builds/2251

The 3 tests fail with a bus error raised from tsd_shared.h line 49

Hey, do you have more details about this? (I was on vacation last few days).
https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/scudo/standalone/tsd_shared.h#L49 is just the end of a block. Looking at the output of the failing tests in the bots, it's just empty.
I am unclear as to how this would only fail on arm thumb as this part is not arch specific.

yroux added a comment.Jun 16 2021, 7:52 AM

Hi,

this is due to a misaligned data access, in Thumb the code generated for unmapTestOnly
contains a Vector Store instruction vst1.64 {d16-d17}, [r0, :128] which needs a 16-bytes
alignement, but the adress of TSDs (which is in r0) is not.

Hi,

this is due to a misaligned data access, in Thumb the code generated for unmapTestOnly
contains a Vector Store instruction vst1.64 {d16-d17}, [r0, :128] which needs a 16-bytes
alignement, but the adress of TSDs (which is in r0) is not.

Thank you Yvan!
Potential fix: https://reviews.llvm.org/D104402
The new DCHECK caught the alignment issue on x86/64, I assume this would work for armhf as well.

Thank you Yvan!
Potential fix: https://reviews.llvm.org/D104402
The new DCHECK caught the alignment issue on x86/64, I assume this would work for armhf as well.

Great, I'll test it. Thanks a lot Kostya