Introduce --with-tsan to compile with Clang ThreadSanitizer#2343
Conversation
pkg repo uses multiple threads to speed up the repository creation process. On MacOS with multiple workers this is predictably crashing ```pkg``` or generating unparsable repository artefacts. Introduce --with-tsan to compile with Clang ThreadSanitizer. While here, make the description of the configure options more clear and remove ```-ggdb``` in favour of ```-g```.
|
I would be interested to see if On MacOS ThreadSanitizer seems to produce valid remarks, but a thorough analysis has yet to be performed. |
|
seems like tsan does not even build on FreeBSD, I have duplicated symbols for things in libc and libpthread. |
|
:( |
|
if needed we can switch back to the fork model we used before, we converted to thread just to simplify the code |
|
Absolutely NOT my intention with this. |
|
fully agreed, in the mean time I have opened a bug in FreeBSD for us to fix tsan on our side |
|
Just compiled using All tests ran fine using the pkg built with tsan. So I will need to read-up on pthread issues with MacOS.... |
|
I don't know anything about threads in MacOS, but if the C11 threads are saner to use on MacOS, I am fine with pkg using them instead of pthreads. |
|
There is nothing wrong with pthreads in MacOS, unfortunately the Once properly initialized, the pkg_repo code shows the usual symptoms of multi-threaded code: deadlocks and data races in emitting the UCL fragments. I have nothing to commit right now, am trying to deal with the fallout of adding /* initialize mutexes & conditions */
pthread_mutex_init(&te->nlock, 0);
pthread_mutex_init(&te->llock, 0);
pthread_mutex_init(&te->flock, 0);
pthread_cond_init(&te->cond, 0);in I might need to park this though, just to manage your expectations. WORKERS_COUNT=1 is just so much easier to type than threaded code to fix. |
pkg repo uses multiple threads to speed up the repository creation process. On MacOS with multiple workers this is predictably crashing
pkgor generating unparsable repository artefacts. Introduce--with-tsanto compile with Clang ThreadSanitizer.While here, make the description of the configure options more clear and remove
-ggdbin favour of-g.