Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#52053 closed enhancement (invalid)

clang-3.8 @3.8.1_3 Sanitizer self-tests to check sanity

Reported by: hmijail (Horacio Mijail Antón Quiles) Owned by: jeremyhu (Jeremy Huddleston Sequoia)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: larryv (Lawrence Velázquez)
Port: clang-3.8

Description

The official documentation for some of the clang sanitizers (for example, Thread Sanitizer) only mention Linux as supported. However, the sanitizer is included in the OS X build, and seems to work - in that it seems to detect problems. On the other hand, at least one of those detected problems seems to be a false positive, so I can only wonder.

Given that LLVM and Clang seem to include a lot of self-tests, using them would be a good way to check whether the sanitizers seem useable in OS X.

I have tried building clang-3.8 with MacPorts and jumping in afterwards to run the tests, but it's complicated enough that I don't even know if they are there or need to be checked out and built additionally. I'm hoping that for the maintainers it might be easier to organize.

Change History (8)

comment:1 Changed 8 years ago by mf2k (Frank Schima)

Cc: jeremyhu@… removed
Keywords: tests removed
Owner: changed from macports-tickets@… to jeremyhu@…
Version: 2.3.4

comment:2 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Resolution: invalid
Status: newclosed

Yes, TSan is supported on macOS. We discussed it quite extensively at WWDC, and it is integrated quite nicely into Xcode 8.

It doesn't look like anything is actually being reported here.

comment:3 in reply to:  description ; Changed 8 years ago by larryv (Lawrence Velázquez)

Replying to hmijail@…:

However, the sanitizer is included in the OS X build, and seems to work - in that it seems to detect problems. On the other hand, at least one of those detected problems seems to be a false positive, so I can only wonder.

The sanitizers, like any code analysis tools, may report false positives. Such reports are not necessarily indicative of a build problem. If you feel that they are reporting issues that they should not be, you should work with upstream to fix it.

comment:4 in reply to:  2 Changed 8 years ago by hmijail (Horacio Mijail Antón Quiles)

Replying to jeremyhu@…:

Yes, TSan is supported on macOS. We discussed it quite extensively at WWDC, and it is integrated quite nicely into Xcode 8.

That's nice to know. It's just a pity that it's not documented anywhere. That's why I turned to the code itself - and its tests. Anyway, thanks for letting me know.

It doesn't look like anything is actually being reported here.

It was an enhancement request, not a report.

comment:5 in reply to:  3 Changed 8 years ago by hmijail (Horacio Mijail Antón Quiles)

Replying to larryv@…:

Replying to hmijail@…:

However, the sanitizer is included in the OS X build, and seems to work - in that it seems to detect problems. On the other hand, at least one of those detected problems seems to be a false positive, so I can only wonder.

The sanitizers, like any code analysis tools, may report false positives. Such reports are not necessarily indicative of a build problem. If you feel that they are reporting issues that they should not be, you should work with upstream to fix it.

I'll gladly do that, but first I needed to know if the code was supposed to work at all on Mac OS X.

comment:6 Changed 8 years ago by hmijail (Horacio Mijail Antón Quiles)

In fact, knowing that TSan will be included in XCode 8 helps very little. That is future, and Apple builds its own clang - so I don't know how that matters at all for MacPorts' current clang 3.8.

So, again: the *current* Clang 3.8 does include a TSan. Does that work on OS X? No idea, no documentation, though it SEEMS to work. The self-tests at least would give an indication.

comment:7 Changed 8 years ago by jeremyhu (Jeremy Huddleston Sequoia)

Our ("Apple") version of TSan and ASan are *very* close to the OSS (ie "MacPorts") versions. There are only a couple very minor patches on top of the OSS versions for things that are more specific to our internal environment. The meat of the sanitizers is the same as the OSS version. TSan in 3.8 and 3.9 should be quite usable and reliable on OS X.

As for the documentation, please file an upstream bug.

comment:8 Changed 8 years ago by hmijail (Horacio Mijail Antón Quiles)

OK, thank you.

Note: See TracTickets for help on using tickets.