Skip to content

Crashes in tests (in random order) #3557

@igt-fred

Description

@igt-fred

This issue is a probably a follow up to #3449, I didn't dare post there (closed).

I think I've found the reason of the crashes, this seems to come from the side effect of calling spdlog::drop_all() in some tests (like "clone-logger") and then calling any method of spdlog::default_logger() (without checking it was valid) in some other test.

To illustrate it easily, just run the cases "clone-logger" and "argv1" in that order:

> spdlog-utests.exe -d yes --order decl clone-logger,argv1
0.002 s: clone-logger
argv1
-------------------------------------------------------------------------------
E:\dev\_libs\sources\spdlog-1.17.0\tests\test_cfg.cpp(35)
...............................................................................
E:\dev\_libs\sources\spdlog-1.17.0\tests\test_cfg.cpp(41): FAILED:
  {Unknown expression after the reported line}
due to a fatal error condition:
  SIGSEGV - Segmentation violation signal

This was on Windows with visual 2026 x64 18.3.2, spdlog 1.17.0, catch2 3.13.0, but I guess it doesn't matter (except catch for the random order).

Most "risky" calls to spdlog::default_logger() are in test_cfg.cpp, others seem covered by a set_default_logger().
On the other side, 33 occurrences of drop_all(), might be more difficult to fix...

Fortunately, the library itself is OK, and all the tests run fine with --order decl.
I hope it helps (feel free to close it immediately if no fix is planned).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions