icinga2/lib/perfdata
Johannes Schmidt 067cd060be Fix PerfdataWriterConnection segfaults on non-X86 architectures
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 storage.

(cherry picked from commit 9a4dd4689c)
2026-07-02 14:32:07 +02:00
..
CMakeLists.txt Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
elasticsearchwriter.cpp Freeze perfdata arrays and remove locks in code using them 2026-07-02 14:29:56 +02:00
elasticsearchwriter.hpp Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
elasticsearchwriter.ti Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
gelfwriter.cpp Freeze perfdata arrays and remove locks in code using them 2026-07-02 14:29:56 +02:00
gelfwriter.hpp Fix potential nullptr-dereference in perfdata writer stats functions 2026-07-02 14:29:49 +02:00
gelfwriter.ti Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
graphitewriter.cpp Freeze perfdata arrays and remove locks in code using them 2026-07-02 14:29:56 +02:00
graphitewriter.hpp Fix potential nullptr-dereference in perfdata writer stats functions 2026-07-02 14:29:49 +02:00
graphitewriter.ti Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
influxdb2writer.cpp Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
influxdb2writer.hpp Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
influxdb2writer.ti Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
influxdbcommonwriter.cpp Freeze perfdata arrays and remove locks in code using them 2026-07-02 14:29:56 +02:00
influxdbcommonwriter.hpp Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
influxdbcommonwriter.ti Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
influxdbwriter.cpp Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
influxdbwriter.hpp Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
influxdbwriter.ti Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
opentsdbwriter.cpp Freeze perfdata arrays and remove locks in code using them 2026-07-02 14:29:56 +02:00
opentsdbwriter.hpp Fix potential nullptr-dereference in perfdata writer stats functions 2026-07-02 14:29:49 +02:00
opentsdbwriter.ti Reapply "Merge pull request #10668 from Icinga/perfdata-writers-connection-handling" 2026-07-02 13:49:27 +02:00
otlpmetricswriter.cpp Freeze perfdata arrays and remove locks in code using them 2026-07-02 14:29:56 +02:00
otlpmetricswriter.hpp Allow users to provide additional resource attributes 2026-04-01 12:18:21 +02:00
otlpmetricswriter.ti OTLP: Set enable_ha to true by default 2026-04-01 12:18:21 +02:00
perfdatawriter.cpp Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
perfdatawriter.hpp Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
perfdatawriter.ti Replace all existing copyright headers with SPDX headers 2026-02-04 14:00:05 +01:00
perfdatawriterconnection.cpp Fix PerfdataWriterConnection segfaults on non-X86 architectures 2026-07-02 14:32:07 +02:00
perfdatawriterconnection.hpp Fix PerfdataWriterConnection segfaults on non-X86 architectures 2026-07-02 14:32:07 +02:00