From f5afd52405519015df94ccc64cd520cea7943e7c Mon Sep 17 00:00:00 2001 From: Liam Barry Date: Fri, 28 Jul 2023 11:27:38 +0100 Subject: MLECO-4246: Bug fix MLEK hardfault when SRAM exceeded GCC builds of inference runner hardfault when tensor allocation fails. Traced to duplicated delete calls on interpreter member variable in app code and ~Model() which has undefined behaviour Signed-off-by: Liam Barry Change-Id: I3872338b4fdc3c25aa26a5cd55991cd575da5a3c --- source/application/api/common/source/Model.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/source/application/api/common/source/Model.cc b/source/application/api/common/source/Model.cc index 80c10b7..f365c89 100644 --- a/source/application/api/common/source/Model.cc +++ b/source/application/api/common/source/Model.cc @@ -98,6 +98,7 @@ bool arm::app::Model::Init(uint8_t* tensorArenaAddr, if (allocate_status != kTfLiteOk) { printf_err("tensor allocation failed!\n"); delete this->m_pInterpreter; + this->m_pInterpreter = nullptr; return false; } -- cgit v1.2.1