[8.0.0 Release] Need help with PR40761: Sanitizers broken on FreeBSD

I think the release is looking pretty good, but there is one blocker
that's worrying me: https://llvm.org/PR40761

From what I understand, ASan et al. used to work on FreeBSD but don't

anymore, and there's nobody working on it.

Is there someone who has access to a FreeBSD machine that could help
investigate this? Just getting it bisected would be super helpful.

Thanks,
Hans

Hi Hans,

I have a freebsd machine and some time to spare this weekend.

Could you offer the minimal git bisect command to repro? I’m hoping not to have to run the full check-clang test suite if there’s a smaller subset of tests for ASAN.

Thanks,

  • Kim

That's excellent!

I think the check-sanitizer target should cover it.

Thanks,
Hans

Hi again,

It took me a while to get the environment up and running. Turns out
the sanitizer test suite is in pretty bad shape overall on FreeBSD.

The target reproducing the DEADLYSIGNAL loop is check-asan-dynamic.

I ran the bisect all the way from release/7.x to release/8.x --

* release/7.x - normal test run
* $somewhere - another hang bug where the lit invocation stops dead
immediately after warning about %shared_libasan:

    llvm-lit: /home/kimgr/code/llvm-project/compiler-rt/test/asan/lit.cfg:110:
warning: %shared_libasan substitution not set but dynamic ASan is
available.

* 342d03e71fbc302cf5a1683dcd03c366bf96d4bb (Reimplement Thread Static
Data ASan routines with TLS) - AddressSanitizer:DEADLYSIGNAL

The DEADLYSIGNAL behavior is in fact introduced by
⚙ D55596 Reimplement Thread Static Data ASan routines with TLS. But it looks like FreeBSD was broken
even before this. I'll see if I can bisect where $somewhere is.

- Kim

Many thanks for digging into this, and sorry for my slow reply.

Kamil: it sounds like your commit is involved here. Any idea what's happening?

Dimitry: If we don't find anyone to debug and fix this before the
release, how bad is it for FreeBSD? Can it be worked around downstream
if 8.0.0 ships without a fix? Since I'm not entirely sure how
supported this functionality is on FreeBSD, I'm not sure how much we
should block the release on it.

Kim: If you can bisect to find that $somewhere revision, that would be
very helpful.

Thanks,
Hans

Hans,

I'm not really in a position to have an opinion :), but it seems it
would be useful if check-.* on FreeBSD didn't hang -- it's hard to
judge the quality of anything if the test suite never finishes. I'm
guessing the sanitizer tests have never been 100% successful on
FreeBSD, but now we don't even get a result.

- Kim

Many thanks for digging into this, and sorry for my slow reply.

Kamil: it sounds like your commit is involved here. Any idea what's happening?

Dimitry: If we don't find anyone to debug and fix this before the
release, how bad is it for FreeBSD? Can it be worked around downstream
if 8.0.0 ships without a fix?

I regularly apply post-release patches, so that should be no problem.

Since I'm not entirely sure how
supported this functionality is on FreeBSD, I'm not sure how much we
should block the release on it.

No, let's not block the release on it. As far as I can see, mainly the
"asan-dynamic" use case is broken, and I am unsure how much that is used.

-Dimitry

Thanks! That sounds good to me.