-
Nadav Har'El authored
The second stack trace mentioned in issue #178 happens because of a bug in tst-queue-mpsc (this is what happens when tests become too complex, and have bugs of their own...): The "popper" thread reads an "item" from a lockfree:queue_mpsc, and wakes the "pusher" thread in that item. But we have a bug when the pusher thread is done and returns: While the condvar remains valid, the "item" containing it does not! We cannot continue to use the index item->value.waiter after we woke this thread, because it can return and item points to invalid memory... We need to save the index "item->value.waiter" before waking the thread. Unfortunately, this does *not* completely solve issue #178 - the timer bug (similar to the two stack traces on issue #178) is still seen (rarely) after this patch. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
Nadav Har'El authoredThe second stack trace mentioned in issue #178 happens because of a bug in tst-queue-mpsc (this is what happens when tests become too complex, and have bugs of their own...): The "popper" thread reads an "item" from a lockfree:queue_mpsc, and wakes the "pusher" thread in that item. But we have a bug when the pusher thread is done and returns: While the condvar remains valid, the "item" containing it does not! We cannot continue to use the index item->value.waiter after we woke this thread, because it can return and item points to invalid memory... We need to save the index "item->value.waiter" before waking the thread. Unfortunately, this does *not* completely solve issue #178 - the timer bug (similar to the two stack traces on issue #178) is still seen (rarely) after this patch. Signed-off-by:
Nadav Har'El <nyh@cloudius-systems.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>