The future wait operation currently does not maintain the thread-local state of the current task. Specifically, the current_finish property is not restored after a potential fiber migration in blocking future wait calls. This can result in the wrong finish scope counter being decremented, and often triggers a segfault later in the execution due to broken synchronization.
The following test program demonstates this behavior:
The future
wait
operation currently does not maintain the thread-local state of the current task. Specifically, thecurrent_finish
property is not restored after a potential fiber migration in blocking futurewait
calls. This can result in the wrong finish scope counter being decremented, and often triggers a segfault later in the execution due to broken synchronization.The following test program demonstates this behavior:
https://github.com/habanero-rice/hclib/blob/8f649248e5a5d1a0e26dfa3097cce7fec31533db/test/cpp/promise/future4.cpp