The following sequence of operations occurs:
Removes node A
Removes node B
Enqueues node A back into the queue
Removes node C
Enqueues a new node D
Thread 1 starts execution
According to the sequence of events in this table,
head will now point to memory that was freed. Also, if reclaimed memory is returned to the operating system (for example, using
munmap()), access to such memory locations can result in fatal access violation errors. The ABA problem occurred because of the internal reuse of nodes that have been popped off the list or the reclamation of memory occupied by removed nodes.
The likelihood of having a race condition is low. Once the race condition occurs, the reading memory that has already been freed can lead to abnormal program termination or unintended information disclosure.
|Polyspace Bug Finder|
Multiple tasks perform unprotected non-atomic operations on shared variables
|[Apiki 2006]||"Lock-Free Programming on AMD Multi-Core System"|
|[Asgher 2000]||"Practical Lock-Free Buffers"|
|[Michael 2004]||"Hazard Pointers"|