Skip to content

Crash when using the days since 2000 block #210

@adazem009

Description

@adazem009

There's a static initialization order fiasco in the implementation of the days since 2000 block (https://en.cppreference.com/w/cpp/language/siof).

SensingBlocks::clock (see src/blocks/sensingblocks.cpp) depends on the Clock singleton (Clock::instance()) which is initialized after SensingBlocks::clock.

Sensing blocks must hold a pointer to a Clock object for testing (mocking) reasons. It should point to Clock::instance() by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Priority: CriticalbugSomething isn't workingcrashIssues involving a crashgood first issueGood for newcomers

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions