pocoproject / poco

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
https://pocoproject.org
Other
8.04k stars 2.11k forks source link

NestedDiagnosticContext crashed in multi-thread environment #4557

Open siren186 opened 1 month ago

siren186 commented 1 month ago

Describe the bug A clear and concise description of what the bug is.

NestedDiagnosticContext& NestedDiagnosticContext::current()
{
    static NestedDiagnosticContext ndc;
    return ndc;
}

It should use Thread Local Storage to store the NDC context. Not a singleton.

Please add relevant environment information: