mirror of
https://github.com/Icinga/icinga2.git
synced 2026-05-04 17:10:26 -04:00
The issue is that std::promise internally also used thread local storage, in a call to `std::call_once` in `std::promise::set_value()`. The theory is that since all paths in `Send()` run this `std::call_once` routine and from then on, then Coroutine function looks like a normal function, the compiler inlined `set_value()` and moved the common parts of it to a common location for all paths before the suspension point in WriteMessage(yc). When finally the coroutine is resumes, it is likely that that happens under a different thread, which still has `__once_callable` in `std::call_once` set as `nullptr`, leading to the segmentation fault. The fix is to not use std::promise across coroutine suspension points and instead reimplement the functionality we required from it in a small helper class `SyncResult` that does not require any thread local storag. |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| elasticsearchwriter.cpp | ||
| elasticsearchwriter.hpp | ||
| elasticsearchwriter.ti | ||
| gelfwriter.cpp | ||
| gelfwriter.hpp | ||
| gelfwriter.ti | ||
| graphitewriter.cpp | ||
| graphitewriter.hpp | ||
| graphitewriter.ti | ||
| influxdb2writer.cpp | ||
| influxdb2writer.hpp | ||
| influxdb2writer.ti | ||
| influxdbcommonwriter.cpp | ||
| influxdbcommonwriter.hpp | ||
| influxdbcommonwriter.ti | ||
| influxdbwriter.cpp | ||
| influxdbwriter.hpp | ||
| influxdbwriter.ti | ||
| opentsdbwriter.cpp | ||
| opentsdbwriter.hpp | ||
| opentsdbwriter.ti | ||
| otlpmetricswriter.cpp | ||
| otlpmetricswriter.hpp | ||
| otlpmetricswriter.ti | ||
| perfdatawriter.cpp | ||
| perfdatawriter.hpp | ||
| perfdatawriter.ti | ||
| perfdatawriterconnection.cpp | ||
| perfdatawriterconnection.hpp | ||