ThreadSanitizer finds data race in concurrent creation of Isolates

39 vues
Accéder directement au premier message non lu

Andre Cunha

non lue,
17 mai 2017, 08:58:4417/05/2017
à v8-users
Hello,

I'm working on a library where multiple threads can run JS code independently at the same time. In the library, each thread creates and uses its own Isolate. However, I noticed clang's AddressSanitizer was complaining about a data race during Isolate creation. I managed to reproduce the problem outside our library, and I'm sending both the code and the sanitizer's error message (the code needs to be compiled with -std=c++11 and -pthread). I'm using V8 5.8.283.38, but I repeated the test on the master branch and got the same result. What the test does is spawn 10 threads; each one of them just creates and destroys Isolates repeatedly.

I have found a recent issue in the bug tracker [1] that reports a similar problem, but the commit is not included in V8 5.8, and the problem is reproducible in the master branch anyway.

So, my question is: I know that multiple threads can run JS code simultaneously, provided that each thread has its own Isolate; but does Isolate creation need to be synchronous?

Best regards,
Andre

stress.cc
tsan_output.txt

Zac Hansen

non lue,
20 mai 2017, 01:26:3020/05/2017
à v8-users
Perhaps just file it as a bug.   https://bugs.chromium.org/p/v8/issues/
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message