Closed Skyb0rg007 closed 3 years ago
Thanks for the detailed report @Skyb0rg007 Let me spend some time investigating to see if anything else needs to be changed, and then we can patch this up.
Alright, this is working much better now with your fix, and will be included in the next release. Thanks again for the great work finding and writing this up!
The current runtime implementation does not properly handle parallel symbol creation. The problematic code is here.
The issue is that a separate thread can create the symbol in-between lines 472 and 473. This can be seen in the gist here. In the gist, two threads race to create the same symbol. When the race occurs, two symbols of the same value are created, though they do not compare equal (since their memory addresses are not the same).
An example fix is the following code, added to
add_symbol
:There may need to be additional changes, but this solution would work to prevent the race from occuring.