Techniques to detect and avert advanced software concurrency bugs