Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

172
Visualizações
STM32 embedded memory overflow/leak detection

I've been bitten in the ass a few times where I would write to an array out of scope. I have been working on a particular firmware for over 2 years and suspect an overflow which by now is close to impossible to find - for example:

uint8_t example[50];
uint8_t example2[100];
for(uint8_t i = 0; i < sizeof(example2); i++)
   example[i] = i;

I understand that the above code example is primitive. It's only an example of what I am trying to describe.

Is there a package or function available that can detect these "leaks"?

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Recent versions of GCC with the flag -Wall will detect simple errors like the problem in your example, and print a warning.

The tool Valgrind is more advanced, but also more work to configure and use correctly.

There is no tool in the universe that can detect every possible mistake, so start with the easiest to use.

over 4 years ago · Santiago Trujillo Relatório

0

Static analysis can only do so much, but here are a couple of the tools I'm using on a daily basis:

  • cppcheck
  • clang-tidy (part of LLVM) - not trivial to set up if you don't use CMake.

Also, as Tom V pointed out, turn on as many warnings as possible (-Wall is a minimum - here is a good starting set of warning flags).

over 4 years ago · Santiago Trujillo Relatório

0

The tool Frama-c , through the Eva plugin, allows to do value analysis: it is able to compute every possible value for each variable and then detects (among other issues) array overflows even in non trivial code source.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda