Out of memory error with mbed-os 6.8 and libxdot 4.1.4

Hi there,

I’m moving a project from the Online Compiler and mbed-os 5 / libxdot-mbed 5 to Keil Studio and mbed-os 6.8.0 / libxdot 4.1.4. The problem is the LoRa code that was previously running fine under mbed-os 5 is now crashing with the error message:

++ MbedOS Error Info ++
Error Status: 0x8001011F Code: 287 Module: 1
Error Message: Operator new[] out of memory

Location: 0x801BB57
Error Value: 0x800
Current Thread: main Id: 0x20002910 Entry: 0x801EE09 StackSize: 0xA00 StackMem: 0x200013B0 SP: 0x20001C5C

The code that causes this error is:

#include "lsb.h"
#include "ChannelPlan_AS923.h"
#include "ChannelPlan_AU915.h"

extern config current_config;
extern BufferedSerial term;

mDot* dot = NULL;
lora::ChannelPlan* plan = NULL;
static uint8_t config_frequency_sub_band = 1;
int32_t ret;

void configNetworkAndJoin(void)
{
    if(current_config.channel_plan==1) plan = new lora::ChannelPlan_AS923(); else if(current_config.channel_plan==2) plan = new lora::ChannelPlan_AU915();
    assert(plan);
 
    dot = mDot::getInstance(plan);
    assert(dot);

The crash happens during the call to getInstance(). I have checked the mbed-os and libxdot versions and according to the libxdot git commit log, these are the correct versions.

Any help would be greatly appreciated!

This not directly an answer for your problem, but often when I had similar problem, was because of bad code. try to static analyze your cod using cppcheck or any other tool.
That might give you a hint.
sorry if that doesn’t help you.