espressif / esp-matter

Espressif's SDK for Matter
Apache License 2.0
645 stars 150 forks source link

Memory Leak Question (CON-1253) #1007

Open ronny-antoon opened 1 month ago

ronny-antoon commented 1 month ago

Describe the question/query that you have I made my own program using esp_matter, and separated it to components for better maintained and testing. I tested all my component expect the component using esp_matter and their is no memory leak, the component using esp_matter i dont know how to test it.

Look at this analytics and tell me is this called memory leak? and how to test the component that using esp_matter?

memory Leak Image

shubhamdp commented 1 month ago

Hi @ronny-antoon could you please tell us more about that setup?

ronny-antoon commented 1 month ago

esp-idf 5.2.1 esp_matter 1.3.0 component Apple Homepod and iphone

bluetooth commision and then wifi

Does the controller performs wild card read? i dont know what it is.

the test more than 3 days i can give you more data

    addMetricToBuffer("freeHeap", (int) heap_caps_get_free_size(MALLOC_CAP_DEFAULT));
    addMetricToBuffer("minFreeHeap", (int) heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT));
    addMetricToBuffer("largestFreeBlock", (int) heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT));
DejinChen commented 1 month ago

Hi @ronny-antoon. Could you test the memory leak on idf v5.3? There was a fix for memory leak before on idf.

ronny-antoon commented 1 month ago

Hi @ronny-antoon. Could you test the memory leak on idf v5.3? There was a fix for memory leak before on idf.

I cant compile with idf v5.3

DejinChen commented 1 month ago

I cant compile with idf v5.3

Could you offer the compiling log?

ronny-antoon commented 1 month ago

ESP_IDF 5.2.1 compiling good.

but ESP-IDF 5.3 i got error

 *  Executing task: C:\Users\RonnyPC\esptest53\.espressif\tools\cmake\3.24.0\bin\cmake.exe -G=Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B=c:\Users\RonnyPC\Documents\MatterApplication\build -S=c:\Users\RonnyPC\Documents\MatterApplication 

-- Found Git: C:/Users/RonnyPC/esptest53/.espressif/tools/idf-git/2.39.2/cmd/git.exe (found version "2.39.2.windows.1")
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/RonnyPC/esptest53/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/RonnyPC/esptest53/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
-- Detecting C compile features       
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/RonnyPC/esptest53/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
Dependencies lock doesn't exist, solving dependencies.
............................Updating lock file at C:\Users\RonnyPC\Documents\MatterApplication\dependencies.lock
Processing 20 dependencies:
[1/20] bblanchon/arduinojson (7.0.4)
[2/20] espressif/button (3.2.1)
[3/20] espressif/cbor (0.6.0~1)
[4/20] espressif/cmake_utilities (0.5.3)
[5/20] espressif/esp_diag_data_store (1.0.1)
[6/20] espressif/esp_diagnostics (1.0.2)
[7/20] espressif/esp_encrypted_img (2.1.0)
[8/20] espressif/esp_insights (1.0.1)
[9/20] espressif/esp_matter (1.3.0)
[10/20] espressif/esp_secure_cert_mgr (2.4.1)
[11/20] espressif/jsmn (1.1.0)
[12/20] espressif/json_generator (1.1.2)
[13/20] espressif/json_parser (1.0.3)
[14/20] espressif/mdns (1.3.2)
[15/20] espressif/rmaker_common (1.4.6)
[16/20] idf (5.3.0)
[17/20] ronny-antoon/accessorymodule (4.9.3)
[18/20] ronny-antoon/devicemodule (4.9.0)
[19/20] ronny-antoon/metricsmodule (5.0.0)
[20/20] ronny-antoon/relaybuttonmodule (4.5.0)
-- Found Python3: C:/Users/RonnyPC/AppData/Local/Programs/Python/Python312/python.exe (found version "3.12.4") found components: Interpreter 
-- Project sdkconfig file C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig
warning: default on the choice symbol SEC_CERT_DAC_PROVIDER (defined at C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_matter\connectedhomeip/connectedhomeip/config/esp32/components/chip/Kconfig:929, C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_matter\components/esp_matter/Kconfig:48) will have no effect, as defaults do not affect choice symbols
warning: the choice symbol SEC_CERT_DAC_PROVIDER (defined at C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_matter\connectedhomeip/connectedhomeip/config/esp32/components/chip/Kconfig:929, C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_matter\components/esp_matter/Kconfig:48) is defined with a prompt outside the choice
Loading defaults file C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults...
C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults:56 CONFIG_NIMBLE_MAX_CONNECTIONS was replaced with CONFIG_BT_NIMBLE_MAX_CONNECTIONS
warning: unknown kconfig symbol 'RONNY_ANTOON' assigned to 'y' in C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults
warning: unknown kconfig symbol 'ESPTOOLPY_BAUD_921600B' assigned to 'y' in C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults
warning: unknown kconfig symbol 'ESPTOOLPY_BAUD' assigned to '921600' in C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults
warning: unknown kconfig symbol 'ESPTOOLPY_COMPRESSED' assigned to 'y' in C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults
warning: unknown kconfig symbol 'ESPTOOLPY_MONITOR_BAUD_151200B' assigned to 'y' in C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig.defaults
-- Compiler supported targets: xtensa-esp-elf
-- Found Python3: C:/Users/RonnyPC/esptest53/.espressif/python_env/idf5.3_py3.11_env/Scripts/python.exe (found version "3.11.2") found components: Interpreter 
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "MatterApplication" version: 1.0
-- Adding linker script C:/Users/RonnyPC/Documents/MatterApplication/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script C:/Users/RonnyPC/Documents/MatterApplication/build/esp-idf/esp_system/ld/sections.ld.in
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- BUTTON: 3.2.1
ESP Insights Project commit: c8430fd-dirty
-- Components: AccessPointManager EndpointManager StatusControlManager StorageManager app_trace app_update bblanchon__arduinojson bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format esp_bootloader_format esp_coex esp_common esp_driver_ana_cmpr esp_driver_cam esp_driver_dac esp_driver_gpio esp_driver_gptimer esp_driver_i2c esp_driver_i2s esp_driver_isp esp_driver_jpeg esp_driver_ledc esp_driver_mcpwm esp_driver_parlio esp_driver_pcnt esp_driver_ppa esp_driver_rmt esp_driver_sdio esp_driver_sdm esp_driver_sdmmc esp_driver_sdspi esp_driver_spi esp_driver_tsens esp_driver_uart esp_driver_usb_serial_jtag esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_lcd esp_local_ctrl esp_mm esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_vfs_console esp_wifi espcoredump espressif__button espressif__cbor espressif__cmake_utilities espressif__esp_diag_data_store espressif__esp_diagnostics espressif__esp_encrypted_img espressif__esp_insights espressif__esp_matter espressif__esp_secure_cert_mgr espressif__jsmn espressif__json_generator espressif__json_parser espressif__mdns espressif__rmaker_common esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash nvs_sec_provider openthread partition_table perfmon protobuf-c protocomm pthread ronny-antoon__accessorymodule ronny-antoon__devicemodule ronny-antoon__metricsmodule ronny-antoon__relaybuttonmodule sdmmc soc spi_flash spiffs 
tcp_transport ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/Users/RonnyPC/Documents/MatterApplication/components/AccessPointManager C:/Users/RonnyPC/Documents/MatterApplication/components/EndpointManager C:/Users/RonnyPC/Documents/MatterApplication/components/StatusControlManager C:/Users/RonnyPC/Documents/MatterApplication/components/StorageManager C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/app_trace C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/app_update C:/Users/RonnyPC/Documents/MatterApplication/managed_components/bblanchon__arduinojson C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader_support C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bt C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/cmock C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/console C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/cxx C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/driver C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/efuse C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp-tls C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_adc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_app_format C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_bootloader_format C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_coex C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_common C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_ana_cmpr C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_cam C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_dac C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_gpio C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_gptimer C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_i2c C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_i2s C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_isp C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_jpeg C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_ledc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_mcpwm C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_parlio C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_pcnt C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_ppa C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_rmt C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_sdio C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_sdm C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_sdmmc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_sdspi C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_spi C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_tsens C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_uart C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_driver_usb_serial_jtag C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_eth C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_event C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_gdbstub C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hid C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_http_client C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_http_server C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_https_ota C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_https_server C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_lcd C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_local_ctrl C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_mm C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_netif C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_netif_stack C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_partition C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_phy C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_pm C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_psram C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_ringbuf C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_system C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_timer C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_vfs_console C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_wifi C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/espcoredump C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__button C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__cbor C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__cmake_utilities C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_diag_data_store C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_diagnostics C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_encrypted_img C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_insights C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_matter C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__esp_secure_cert_mgr C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__jsmn C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__json_generator C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__json_parser C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__mdns C:/Users/RonnyPC/Documents/MatterApplication/managed_components/espressif__rmaker_common C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esptool_py C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/fatfs C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/hal C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/heap C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/http_parser C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/idf_test C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/ieee802154 C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/json C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/log C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip C:/Users/RonnyPC/Documents/MatterApplication/main C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/mbedtls C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/mqtt C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/newlib C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/nvs_flash C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/nvs_sec_provider C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/openthread C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/partition_table C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/perfmon C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/protobuf-c C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/protocomm C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/pthread C:/Users/RonnyPC/Documents/MatterApplication/managed_components/ronny-antoon__accessorymodule C:/Users/RonnyPC/Documents/MatterApplication/managed_components/ronny-antoon__devicemodule C:/Users/RonnyPC/Documents/MatterApplication/managed_components/ronny-antoon__metricsmodule C:/Users/RonnyPC/Documents/MatterApplication/managed_components/ronny-antoon__relaybuttonmodule C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/sdmmc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/spi_flash C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/spiffs C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/tcp_transport C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/ulp C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/unity C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/usb C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/vfs C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/wear_levelling C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/wifi_provisioning C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/wpa_supplicant C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/RonnyPC/Documents/MatterApplication/build

 *  Executing task: C:\Users\RonnyPC\esptest53\.espressif\tools\ninja\1.11.1\ninja.exe  

[6/1612] Generating ../../partition_table/partition-table.bin
Partition table binary generated. Contents:
*******************************************************************************
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
esp_secure_cert,63,6,0x10000,16K,encrypted
nvs,data,nvs,0x14000,104K,
nvs_keys,data,nvs_keys,0x2e000,8K,encrypted
otadata,data,ota,0x30000,8K,
phy_init,data,phy,0x32000,8K,
fctry,data,nvs,0x34000,48K,
ota_0,app,ota_0,0x40000,2880K,
ota_1,app,ota_1,0x310000,2880K,
frontend,data,spiffs,0x5e0000,1664K,
coredump,data,coredump,0x780000,128K,
*******************************************************************************
[370/1612] Building C object esp-idf/newlib/CMakeFiles/__idf_newlib.dir/locks.c.obj
FAILED: esp-idf/newlib/CMakeFiles/__idf_newlib.dir/locks.c.obj 
C:\Users\RonnyPC\esptest53\.espressif\tools\xtensa-esp-elf\esp-13.2.0_20240530\xtensa-esp-elf\bin\xtensa-esp32-elf-gcc.exe -DESP_PLATFORM -DIDF_VER=\"v5.3\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -IC:/Users/RonnyPC/Documents/MatterApplication/build/config -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/newlib/platform_include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/newlib/priv_include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/config/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/config/include/freertos -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/config/xtensa/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/FreeRTOS-Kernel/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos/esp_additions/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/include/soc -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/include/soc/esp32 -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/dma/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/ldo/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/port/esp32/. -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support/port/esp32/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/heap/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/log/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc/esp32 -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc/esp32/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/hal/platform_port/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/hal/esp32/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/hal/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/include/esp32 -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32 -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_common/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_system/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_system/port/soc -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_system/port/include/private -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/xtensa/esp32/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/xtensa/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/xtensa/deprecated_include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/include/apps -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/include/apps/sntp -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/lwip/src/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/port/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/port/freertos/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/port/esp32xx/include -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/port/esp32xx/include/arch -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/lwip/port/esp32xx/include/sys -IC:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/spi_flash/include -mlongcalls -Wno-frame-address  -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -fdiagnostics-color=always -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -O2 -fmacro-prefix-map=C:/Users/RonnyPC/Documents/MatterApplication=. -fmacro-prefix-map=C:/Users/RonnyPC/esptest53/v5.3/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DconfigUSE_TRACE_FACILITY=1 -Wno-error=uninitialized -Wno-error=maybe-uninitialized -Wno-format-nonliteral -Wno-missing-field-initializers -Wno-error=array-bounds -Wno-write-strings -Wno-format-security -std=gnu17 -Wno-old-style-declaration -Os -MD -MT esp-idf/newlib/CMakeFiles/__idf_newlib.dir/locks.c.obj -MF esp-idf\newlib\CMakeFiles\__idf_newlib.dir\locks.c.obj.d -o esp-idf/newlib/CMakeFiles/__idf_newlib.dir/locks.c.obj -c C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/newlib/locks.c
C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/newlib/locks.c:240:1: error: static assertion failed: "Incorrect size of struct __lock"
  240 | _Static_assert(sizeof(struct __lock) >= sizeof(StaticSemaphore_t),
      | ^~~~~~~~~~~~~~
[391/1612] Performing configure step for 'bootloader'
-- Found Git: C:/Users/RonnyPC/esptest53/.espressif/tools/idf-git/2.39.2/cmd/git.exe (found version "2.39.2.windows.1")
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/RonnyPC/esptest53/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/RonnyPC/esptest53/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/RonnyPC/esptest53/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
-- Project sdkconfig file C:/Users/RonnyPC/Documents/MatterApplication/sdkconfig
-- Compiler supported targets: xtensa-esp-elf
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc/esp32/ld/esp32.peripherals.ld
-- Bootloader project name: "bootloader" version: 1
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.api.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom/esp32/ld/esp32.rom.newlib-funcs.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.ld
-- Adding linker script C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader/subproject/main/ld/esp32/bootloader.rom.ld
-- Components: bootloader bootloader_support efuse esp_app_format esp_bootloader_format esp_common esp_hw_support esp_rom esp_system esptool_py freertos hal log main micro-ecc newlib partition_table soc spi_flash xtensa
-- Component paths: C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader_support C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/efuse C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_app_format C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_bootloader_format C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_common C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_hw_support C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_rom C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esp_system C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/esptool_py C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/freertos C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/hal C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/log C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader/subproject/main C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/bootloader/subproject/components/micro-ecc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/newlib C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/partition_table C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/soc C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/spi_flash C:/Users/RonnyPC/esptest53/v5.3/esp-idf/components/xtensa
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/RonnyPC/Documents/MatterApplication/build/bootloader
ninja: build stopped: subcommand failed.

 *  The terminal process "C:\Users\RonnyPC\esptest53\.espressif\tools\ninja\1.11.1\ninja.exe" terminated with exit code: 1. 
DejinChen commented 1 month ago

@ronny-antoon First you can try to use idf v5.3 to compile projects without esp_matter component like examples in idf. If this error still occurs, you can try to modify struct to struct __lock { int reserved[23]; };. If you can compile other projects, but the project with esp_matter component fails, please let me know.

ronny-antoon commented 1 month ago

Thank you, solved.

the problem occurs when adding this component https://github.com/ronny-antoon/DeviceModule

and the solution was to add CONFIG_FREERTOS_USE_TRACE_FACILITY=y in sdkconfig.defaults

how i can add this "CONFIG_FREERTOS_USE_TRACE_FACILITY=y" in the component it self and not from the sdkconfig.defaults ??

ronny-antoon commented 1 month ago

the compile solved not the Memory.

DejinChen commented 1 month ago

how i can add this "CONFIG_FREERTOS_USE_TRACE_FACILITY=y" in the component it self and not from the sdkconfig.defaults ??

Maybe you can add select FREERTOS_USE_TRACE_FACILITY in a config of which the default value is y. Actually it's a strange problem. sizeof(StaticSemaphore_t) is influenced by FREERTOS_USE_TRACE_FACILITY.

ronny-antoon commented 3 weeks ago

mem leak

After some test, I think the main problem for memory leak is the WiFi. after a WiFi disconnect and then reconnet "at least one time" the memory leak starting but i dont know where and why.

DejinChen commented 3 weeks ago

Could you offer the device logs and the reproduction method?