Automatically finding atomic regions for fixing bugs in Concurrent Programs