Comment 1 for bug 541372

Revision history for this message
bcoudoin (bruno-coudoin-eads) wrote :

I found the issue, in gddNewDel.h:gdd_NEWDEL_NEW() there is a race condition.

In this method, a first test is made if there are gdd left in the pool. If not it creates 20 more gdds. Then it goes on and uses one gdd of the pool for the new object being created.

What happens is that 2 threads can run while there is a single gdd in the pool. Then none will create gdds at the first stage. At the second stage, the first one will succeed but the second one will crash because there is no gdd left in the pool.

The solution is to move the guard at the start of the method instead of being into the two inner cases.