[nRF Connect for VS Code][BUG?] Backtrace is sometimes not shown on fatal error

Using the official nRF Connect for VS Code extension sometimes when debugging and hitting a fatal error, no backtrace is shown (backtrace seems to be mostly garbage):

Without changing anything, no flashing or anything, if I use the cortex-debug extension (https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug) I get the full backtrace:

So something seems wrong with the official nRF Connect for VS Code extension.

The code that triggers the fatal error is the assert on line 2 here:

    if (const int ret = sensor_sample_fetch(mHallSensorDevice); ret < 0) {
        __ASSERT(false, "Sensor [%s] failed sensor_sample_fetch(): [%d].", HallSensorPositionToString(mHallSensorPosition), ret);
        abort();
    }

Funny enough the extension will in show the backtrace if I just move the assert above the if like so:

    __ASSERT(false, "Sensor [%s] failed sensor_sample_fetch(): [%d].", HallSensorPositionToString(mHallSensorPosition), ret);
    
    if (const int ret = sensor_sample_fetch(mHallSensorDevice); ret < 0) {
        __ASSERT(false, "Sensor [%s] failed sensor_sample_fetch(): [%d].", HallSensorPositionToString(mHallSensorPosition), ret);
        abort();
    }

I'm using the latest version of the extension (v2024.3.25). This happens in context of building a larger matter application. I don't know how to make a minimal example for you where this is  always reproducible. As you can see from above, it seems the happen randomly depending on where the fatal error happens. Also it might be related to us recently updating from nRF Connect SDK 2.5.2 to 2.6.0, but I'm not sure about this. What I can say is that I didn't see this problem with 2.5.2, but this might also be completely unrelated.

Best regards

Alex

Parents Reply Children
No Data
Related