The "stress" parameter is optional (and defaults to false)
cmake -S . -B build
cmake --build build -j
./build/spdlogger --seconds 5
./build/spdlogger --seconds 5 --stressYour task Identify and fix as many correctness issues as you reasonably can. For each fix, briefly explain: what the problem was why it happens (especially why it’s intermittent) why your fix is correct
Constraints Do not remove async logging.
Upload solutions to github with Readme
| File | Bug | Type |
|---|---|---|
string_uaf.h | Dangling pointer to a local std::string variable | Use-after-free |
shutdown.h | spdlog::shutdown() called while other threads a logging | Race/Undefined behaviour at shutdown |
level.h | delete &s on a class member that was not dynamically allocated | Undefined behaviour (destructor) |
level.h | g_level non-atomic shared between threads | Data race |
timebase.h | Mixing steady_clock/system_clock | Logic |
sink_callback.h | Re-entrant logging from sink_it_() | Possible deadlock |