Tracker One crashes


I’ve been working on a fork of the Tracker Edge firmware for some time, making use of GPS, BLE and CAN. After refactoring my application code (Implementing runtime polymorphism for CAN nodes, it crashes during the first run of the main loop. (Before the refactoring it was working)

The crash occurs in the can-mcp25x library, in the following function:

byte MCP_CAN::mcp2515_readRegister(const byte address)
    byte ret;

    // If I comment out this transaction there is no crash.
    ret = spi_read();

    return ret;

(I have access to a debugger)
How should I go about troubleshooting this?

An observation I’ve made is that debug builds don’t seem to crash, but normal builds do.

What are the differences in the build types?
Does this observation give anyone a hint of what might be wrong?

Turns out I was dealing with an uninitialized pointer to my CAN interface. The issue got resolved by adding the keyword “virtual” when the parent classes inherited from the same grandparent class, diamond inheritance.