boostorg / boostorg/fiber

Crash if fiber sleeps in catch block (Windows only)

Đang mở
#293 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
510
Fork
123
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

If anything makes a fiber sleep in the 'catch' block (not by thread sleeping, but switching to another fiber), then, when it wakes up, it crashes on trying to switch back to the 'try' block (at least, according to the call stack). The issue is not reproducible on Linux.
The following code crashes when built and run on Windows (tested with boost 1.67 and boost 1.76):

```C++
#include "boost/fiber/all.hpp"

void func()
{
try
{
throw std::logic_error("error");
}
catch (...)
{
boost::this_fiber::sleep_for(std::chrono::milliseconds(100));
}
}

int main()
{
boost::fibers::fiber f1(func);
boost::fibers::fiber f2(func);

f1.join();
f2.join();

return 0;
}
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.