Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

feature request: fsanitize=thread results? #9

Open
Dushistov opened this issue Mar 2, 2018 · 4 comments
Open

feature request: fsanitize=thread results? #9

Dushistov opened this issue Mar 2, 2018 · 4 comments

Comments

@Dushistov
Copy link
Contributor

As newcomer I would like to see that testing with -fsanitize=thread have been done.
In perfect world of course this should be part of CI, but not sure how much efforts this requires,
because of you need compile Qt from source code with -fsanitize=thread flag.

So may be just mention in readme that such kind of testing was done for OS Z/compiler Y/Qt X and all tests are green?

@Dushistov Dushistov changed the title feature: fsanitize=thread results? feature request: fsanitize=thread results? Mar 2, 2018
@benlau
Copy link
Owner

benlau commented Mar 2, 2018

I did a quick search about the current status of sanitize_thread support in QT binary. I doubt its support due to this issue:

[QTBUG-37402] QMutex not recognized by thread sanitizer - Qt Bug Tracker
https://bugreports.qt.io/browse/QTBUG-37402

According to the last comment, even the patched version of Qt still report race condition.

I have tested with Qt 5.10 and it also reports race in calling future.result() which should be a thread-safe function. I am not sure if the result really meaningful.

@benlau
Copy link
Owner

benlau commented Mar 2, 2018

SUMMARY: ThreadSanitizer: data race qfuture.h:157 in QFuture<int>::result() const

If QFuture::result() could not pass the test, AsyncFuture won't pass for sure. I may test with Qt 5.11 later.

@Dushistov
Copy link
Contributor Author

Strange enough, future.result uses QFutureInterface<T>::resultReference
which uses QMutex, and with patch mentioned in QTBUG-37402 mutex should have been annotated.
You build patched version of Qt with -fsanitize=thread under what OS/compiler?

@benlau
Copy link
Owner

benlau commented Mar 3, 2018

It is a undocumented feature. sanitizer could be enabled via qmake by

CONFIG += sanitizer sanitize_thread

I don't know how Qt handle it . But I am not going to build my own version of Qt to test it as it is very time consuming.

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

No branches or pull requests

2 participants