Thread 1 gets a reference to some item in a queue (line 107) and passes it to wait_until (line 113)
Call to wait_until releases the lock
Thread 2 calls push (line 136)
And after that the reference becomes invalid according to ASAN, because of a data race in an underlying queue.
My propose is to retrieve a copy of a queue item instead of reference. It eliminates ASAN errors.
Also ASAN blames for this only under MacOS but finds no issues on Linux. Probably because of a different queue implementation.
Greetings! Some time ago I performed checks of some project which uses RxCpp with address sanitizer and got this:
Logs are truncated a bit, please check https://gist.github.com/luckychess/0abced67530eda0ede1456e666d2ccf6 for details. After some investigation the problem became more clear to me:
wait_until
(line 113)wait_until
releases the lockpush
(line 136) And after that the reference becomes invalid according to ASAN, because of a data race in an underlying queue. My propose is to retrieve a copy of a queue item instead of reference. It eliminates ASAN errors. Also ASAN blames for this only under MacOS but finds no issues on Linux. Probably because of a different queue implementation.