Files
scylladb/core
Nadav Har'El 902d5b21ca sleep: Fix use-after-free in sleep()
The implementation of sleep() looks like a game of Seastar golf - doing
something in the minimum number of lines possible :-) Unfortunately, it
looks very clever, but not quite right. sleep() usually works correctly,
but the sanitizer (in the debug build) catches a use after free.

The problem was that we delete an object which contains a timer which
contains the callback (and std::function) - from inside this callback.

The workaround in this patch is to use our future chaining to only delete
the sleeper object after its future became ready - and at that point, none
of the sleeper object or code is needed any more.

This patch also includes a regression test for this issue. The test looks
silly (just sleeps and checks nothing), but in the debugging build it
failed (with a sanitizer reporting use-after-free) before this patch.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-05-14 11:26:58 +03:00
..
2015-03-01 15:29:13 +02:00
2015-04-02 10:27:38 +03:00
2015-04-19 10:33:38 +03:00
2015-03-11 14:45:43 +02:00
2015-05-05 10:11:18 +03:00
2015-03-15 20:18:17 +02:00
2015-03-03 14:58:58 +02:00
2015-05-11 13:33:33 +03:00
2015-03-24 10:12:47 +02:00
2015-05-14 11:26:58 +03:00