Open ehbar opened 2 hours ago
Output of $HOME/.espressif/tools/xtensa-esp-elf/esp-14.2.0_20240906/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc --version
:
xtensa-esp-elf-gcc (crosstool-NG esp-14.2.0_20240906) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Thanks for the detailed report, we can reproduce it as well.
AFAICT, it's like a bug introduced by ESP_STATIC_ANALYZER_CHECK
in the esp-idf. If I comment out the ESP_STATIC_ANALYZER_CHECK
in the esp_ringbuf/ringbuf.c
, the example just works as expected.
Answers checklist.
IDF version.
v5.4-dev-4291-g7a305c0284
Espressif SoC revision.
ESP32-S3 (QFN56) (revision v0.2)
Operating System used.
Linux
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-S3-DevKitC-1-N8R8
Power Supply used.
USB
What is the expected behavior?
The "basic" esp_console example at https://github.com/espressif/esp-idf/tree/master/examples/system/console/basic executes normally
What is the actual behavior?
The "basic" esp_console example at https://github.com/espressif/esp-idf/tree/master/examples/system/console/basic panics at start if the kconfig option
CONFIG_COMPILER_STATIC_ANALYZER=y
is set (!).Steps to reproduce.
master
branch of esp-idf, run:-fanalyze
to the compiler):Debug Logs.
More Information.
Yes, this is extremely bizarre, but I can 100% reproduce the panic on three different devices: a generic/no-name esp32 chip rev v3.1, and two different esp32s3 boards I have including an an Espressif ESP32-S3-DevKitC-1-N8R8.
The panic is triggered after the
linenoise
library tries on init to send an ANSI escape code to the terminal and read its response.As far as I can tell,
CONFIG_COMPILER_STATIC_ANALYZER=y
just adds the-fanalyzer
flag to GCC when compiling, which I don't think is supposed to change the build artifact. So this could be a compiler bug.