Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intermittent watchdog messages on esp32/esp32c3 #2914

Open
pljakobs opened this issue Nov 24, 2024 · 19 comments
Open

intermittent watchdog messages on esp32/esp32c3 #2914

pljakobs opened this issue Nov 24, 2024 · 19 comments

Comments

@pljakobs
Copy link
Contributor

I'm getting

E (54167) task_wdt: esp_task_wdt_reset(713): task not found

intermittently.
Sometimes, that's followed by a restart, but I can't see any reason yet.

@mikee47
Copy link
Contributor

mikee47 commented Nov 24, 2024

All changing in #2913 so should disappear.

@slaff
Copy link
Contributor

slaff commented Nov 25, 2024

@pljakobs can you check if the latest develop version fixes the reported issue?

@slaff
Copy link
Contributor

slaff commented Nov 26, 2024

@pljakobs I will close the issue for now. If it happens again in the latest develop feel free to re-open the issue.

@slaff slaff closed this as completed Nov 26, 2024
@mikee47
Copy link
Contributor

mikee47 commented Nov 26, 2024

By way of explanation, the message appears because the task watchdog is created for the Sming task but is getting called on the tcpip task on occasion. The revisions revert to the IDLE task watchdog so the message won't appear any more, but more importantly tasks are correctly serialised so general reliabiity will be improved.

@pljakobs
Copy link
Contributor Author

pljakobs commented Nov 26, 2024

built my current version using the current sming develop branch fails an assert on the esp32c3:

assert failed: xQueueGenericSendFromISR queue.c:1180 (pxQueue)
Core  0 register dump:
MEPC    : 0x40380698  RA      : 0x4038558e  SP      : 0x3fc9bbc0  GP      : 0x3fc90800  
TP      : 0x3fc44c64  T0      : 0x37363534  T1      : 0x7271706f  T2      : 0x33323130  
S0/FP   : 0x00000001  S1      : 0x3fc9bd1e  A0      : 0x3fc9bc18  A1      : 0x3fc91c99  
A2      : 0x00000001  A3      : 0x00000029  A4      : 0x00000001  A5      : 0x3fc98000  
A6      : 0x7a797877  A7      : 0x76757473  S2      : 0x00000089  S3      : 0x3fc9bc18  
S4      : 0x3fc9bc18  S5      : 0x3c0d2ef8  S6      : 0x00000029  S7      : 0x3c10760c  
S8      : 0x3c10d400  S9      : 0x3c0c4000  S10     : 0x00000000  S11     : 0x00000000  
T3      : 0x6e6d6c6b  T4      : 0x6a696867  T5      : 0x66656463  T6      : 0x62613938  
MSTATUS : 0x00001801  MTVEC   : 0x40380001  MCAUSE  : 0x00000007  MTVAL   : 0x00000000  
MHARTID : 0x00000000  

same on the esp32:

assert failed: xQueueGenericSendFromISR queue.c:1180 (pxQueue)


Backtrace: 0x4008115a:0x3ffb1ce0 0x400880c1:0x3ffb1d00 0x4008e77d:0x3ffb1d20 0x40088716:0x3ffb1e40 0x400833c3:0x3ffb1e70 0x40083fe1:0x3ffb1ea0 0x40112772:0x3ffb1ec0 0x401100fa:0x3ffb1ee0 0x4010fe4d:0x3ffb1f00 0x400d88f5:0x3ffb1f20 0x400d8a62:0x3ffb2120 0x400d4749:0x3ffb2170 0x40174a6c:0x3ffb2190 0x40088d55:0x3ffb21b0

@pljakobs
Copy link
Contributor Author

@mikee47 I can't reopen this since I can only re-open issues that I have closed myself. I don't know if you get a notification on a closed issue, so: ping

@slaff slaff reopened this Nov 26, 2024
@mikee47
Copy link
Contributor

mikee47 commented Nov 26, 2024

That assert indicates the queue hasn't been created yet: I'll try Basic_Wifi on the esp32c3, see what I can dig up.

@mikee47
Copy link
Contributor

mikee47 commented Nov 26, 2024

So I've tried the Basic_Wifi sample on an esp32c3 and runs without issue. We need to know what called xQueueGenericSendFromISR and, more specifically, why the queue handle is invalid.

If you rebuild with ENABLE_GDB=1 then when it crashes you should be able to run make gdb, then bt to get a backtrace.

@mikee47
Copy link
Contributor

mikee47 commented Nov 26, 2024

I can't reproduce the issue but I suspect something is trying to post to the Sming event queue before it's been created, probably during network initialisation. Can you try this patch to Sming/Arch/Esp32/Components/esp32/src/startup.cpp:

@@ -30,15 +30,16 @@ extern "C" void app_main(void)
 	hw_timer_init();
 
 	smg_uart_detach_all();
 	esp_log_set_vprintf(m_vprintf);
 
+	System.initialize();
+
 #ifndef DISABLE_WIFI
 	esp_network_initialise();
 #endif
 
-	System.initialize();
 	Storage::initialize();
 
 	// Application gets called outside main thread at startup
 	// Things like smartconfig won't work if called via task queue
 	init();

@pljakobs
Copy link
Contributor Author

will try, I have not looked at this more deeply yet (day job taking excessive cycles) - it happens right after initializing ConfigDB, but I will need to debug it more.

@pljakobs
Copy link
Contributor Author

with this startup.cpp, the issue persists

/****
 * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
 * Created 2015 by Skurydin Alexey
 * http://github.com/SmingHub/Sming
 * All files of the Sming Core are provided under the LGPL v3 license.
 *
 * startup.cpp
 *
 */

#include <esp_system.h>
#include <esp_log.h>
#include <esp_event.h>
#include <debug_progmem.h>
#include <Platform/System.h>
#include <driver/hw_timer.h>
#include <driver/uart.h>
#include <Storage.h>

extern void init();
extern void esp_network_initialise();
extern void start_sming_task_loop();

extern "C" void __wrap_esp_newlib_init_global_stdio(const char*)
{
}

extern "C" void app_main(void)
{
	hw_timer_init();

	smg_uart_detach_all();
	esp_log_set_vprintf(m_vprintf);

	System.initialize();

#ifndef DISABLE_WIFI
	esp_network_initialise();
#endif

	Storage::initialize();

	// Application gets called outside main thread at startup
	// Things like smartconfig won't work if called via task queue
	init();

	start_sming_task_loop();
}

@mikee47
Copy link
Contributor

mikee47 commented Nov 26, 2024

Going to need a reproducible sample or backtrace to diagnose this further.

@pljakobs
Copy link
Contributor Author

pljakobs commented Nov 27, 2024

so it took me a while to set this up, broke out the jtag interface. Here's what I got:

Temporary breakpoint 1, app_main () at /opt/Sming/Sming/Arch/Esp32/Components/esp32/src/startup.cpp:30
30		hw_timer_init();
(gdb) c
Continuing.
[esp32.cpu0] Target halted, PC=0x400DADE9, debug_reason=00000002
Set GDB target to 'esp32.cpu0'

Program received signal SIGTRAP, Trace/breakpoint trap.
ArduinoJson::V6213PB2::detail::storeString<ArduinoJson::V6213PB2::detail::SizedRamString, ArduinoJson::V6213PB2::detail::SlotKeySetter> (pool=0x3ffb1970, str=..., callback=...) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:226
226	  JsonString storedString(copy, str.size(), JsonString::Copied);
(gdb) bt
#0  ArduinoJson::V6213PB2::detail::storeString<ArduinoJson::V6213PB2::detail::SizedRamString, ArduinoJson::V6213PB2::detail::SlotKeySetter> (pool=0x3ffb1970, str=..., callback=...)
    at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:226
#1  0x400dae20 in ArduinoJson::V6213PB2::detail::storeString<ArduinoJson::V6213PB2::detail::SizedRamString, ArduinoJson::V6213PB2::detail::SlotKeySetter> (pool=0x3ffb1970, str=..., 
    callback=...)
    at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Memory/MemoryPool.hpp:250
#2  0x400dae5a in ArduinoJson::V6213PB2::detail::slotSetKey<ArduinoJson::V6213PB2::detail::SizedRamString> (pool=0x3ffb1970, key=..., var=0x3ffcdde0)
    at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Variant/SlotFunctions.hpp:13
#3  ArduinoJson::V6213PB2::detail::CollectionData::addMember<ArduinoJson::V6213PB2::detail::SizedRamString> (this=0x3ffb1988, key=..., pool=0x3ffb1970)
    at /opt/Sming/Sming/Libraries/ArduinoJson6/include/../ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp:40
#4  0x400dae98 in ArduinoJson::V6213PB2::detail::CollectionData::getOrAddMember<ArduinoJson::V6213PB2::detail::SizedRamString> (this=0x3ffb1988, key=..., pool=0x3ffb1970)
    at /opt/Sming/Sming/Libraries/ArduinoJson6/include/../ArduinoJson/src/ArduinoJson/Collection/CollectionImpl.hpp:125
#5  0x400daed8 in ArduinoJson::V6213PB2::detail::VariantData::getOrAddMember<ArduinoJson::V6213PB2::detail::SizedRamString> (this=0x3ffb1988, key=..., pool=0x3ffb1970)
--Type <RET> for more, q to quit, c to continue without paging--c
    at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Variant/VariantData.hpp:277
#6  0x400daefc in ArduinoJson::V6213PB2::detail::variantGetOrAddMember<ArduinoJson::V6213PB2::detail::SizedRamString> (var=0x3ffb1988, key=..., pool=0x3ffb1970) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Variant/VariantFunctions.hpp:89
#7  0x400f5470 in ArduinoJson::V6213PB2::detail::MemberProxy<ArduinoJson::V6213PB2::JsonObject, String>::getOrCreateData (this=0x3ffb1438) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Object/MemberProxy.hpp:54
#8  ArduinoJson::V6213PB2::detail::VariantAttorney::getOrCreateData<ArduinoJson::V6213PB2::detail::MemberProxy<ArduinoJson::V6213PB2::JsonObject, String> const> (client=...) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Variant/VariantAttorney.hpp:44
#9  ArduinoJson::V6213PB2::detail::VariantRefBase<ArduinoJson::V6213PB2::detail::MemberProxy<ArduinoJson::V6213PB2::JsonObject, String> >::getOrCreateData (this=0x3ffb1438) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Variant/VariantRefBase.hpp:290
#10 ArduinoJson::V6213PB2::detail::VariantRefBase<ArduinoJson::V6213PB2::detail::MemberProxy<ArduinoJson::V6213PB2::JsonObject, String> >::getOrCreateVariant (this=0x3ffb1438) at /opt/Sming/Sming/Libraries/ArduinoJson6/include/../ArduinoJson/src/ArduinoJson/Variant/VariantImpl.hpp:120
#11 ArduinoJson::V6213PB2::detail::VariantRefBase<ArduinoJson::V6213PB2::detail::MemberProxy<ArduinoJson::V6213PB2::JsonObject, String> >::set<char const> (value=0x3f40c6ec "2.0", this=0x3ffb1438) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Variant/VariantRefBase.hpp:135
#12 ArduinoJson::V6213PB2::detail::MemberProxy<ArduinoJson::V6213PB2::JsonObject, String>::operator=<char const> (src=0x3f40c6ec "2.0", this=0x3ffb1438) at /opt/Sming/Sming/Libraries/ArduinoJson6/ArduinoJson/src/ArduinoJson/Object/MemberProxy.hpp:39
#13 JsonRpcMessage::JsonRpcMessage (this=<optimized out>, name=...) at /home/pjakobs/devel/esp_rgbww_firmware/app/jsonrpcmessage.cpp:6
#14 0x400ed611 in AppWIFI::broadcastWifiStatus (this=0x3ffc1140 <app>, message=...) at /home/pjakobs/devel/esp_rgbww_firmware/app/networking.cpp:433
#15 0x400eea14 in AppWIFI::startAp (this=0x3ffc1140 <app>) at /home/pjakobs/devel/esp_rgbww_firmware/app/networking.cpp:416
#16 0x400eefdc in AppWIFI::init (this=0x3ffc1140 <app>) at /home/pjakobs/devel/esp_rgbww_firmware/app/networking.cpp:168
#17 0x400d7aea in Application::init (this=0x3ffc1140 <app>) at /home/pjakobs/devel/esp_rgbww_firmware/app/application.cpp:361
#18 0x400d7c40 in init () at /home/pjakobs/devel/esp_rgbww_firmware/app/application.cpp:145
#19 0x400d44d0 in app_main () at /opt/Sming/Sming/Arch/Esp32/Components/esp32/src/startup.cpp:45
#20 0x4018bc4b in main_task (args=0x0) at /opt/esp-idf-5.2/components/freertos/app_startup.c:208
#21 0x40088e1c in vPortTaskWrapper (pxCode=0x4018bc04 <main_task>, pvParameters=0x0) at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134

I'm unsure that this really shows the issue since this is an unconfigured chip, meaning it does not connect to the wifi yet but should open it's AP for configuration - which it doesn't seem to do.
But: it also doesn't boot loop, hence I wonder if the debug output shows anything at all.
(the inline gdb didn't work for some odd reason. Done it multiple times with the 8266, but with the 32c3, I would always just end up with normal terminal output on the serial link, causing gdb to time out.)

@mikee47
Copy link
Contributor

mikee47 commented Nov 27, 2024

Using GDB on the esp32 requires the ESP_SYSTEM_GDBSTUB_PANIC setting via make sdk-menuconfig, so when the fault occurs we get:

Entering gdb stub now.
$T0b#e6

Should be able to break out then run make gdb:

Remote debugging using /dev/ttyUSB0
warning: multi-threaded target stopped without sending a thread-id, using first non-exited thread
0x4008111d in panic_abort (details=0x3ffb0b30 "assert failed: xQueueGenericSendFromISR queue.c:1180 (pxQueue)")
    at /opt/esp-idf-5.2/components/esp_system/panic.c:466
466	    *((volatile int *) 0) = 0; // NOLINT(clang-analyzer-core.NullDereference) should be an invalid operation on targets
(gdb) bt
#0  0x4008111d in panic_abort (details=0x3ffb0b30 "assert failed: xQueueGenericSendFromISR queue.c:1180 (pxQueue)")
    at /opt/esp-idf-5.2/components/esp_system/panic.c:466
#1  0x40087d74 in esp_system_abort (details=0x3ffb0b30 "assert failed: xQueueGenericSendFromISR queue.c:1180 (pxQueue)")
    at /opt/esp-idf-5.2/components/esp_system/port/esp_system_chip.c:93
#2  0x4008e2d8 in __assert_func (file=<optimized out>, line=<optimized out>, func=<optimized out>, expr=<optimized out>)
    at /opt/esp-idf-5.2/components/newlib/assert.c:81
#3  0x400883c9 in xQueueGenericSendFromISR (xQueue=0x0, pvItemToQueue=<optimized out>, pxHigherPriorityTaskWoken=0x3ffb0c88, 
    xCopyPosition=<optimized out>) at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/queue.c:1181
#4  0x40083345 in system_os_post (prio=<optimized out>, sig=1074687320, par=1073470200)
    at ../../../../../../../Arch/Esp32/Components/esp32/src/tasks.cpp:96
#5  0x40083f9c in SystemClass::queueCallback (callback=<optimized out>, param=0x3ffbdaf8) at ../../../../../../../Platform/System.cpp:87
#6  0x400e6d24 in SystemClass::queueCallback(Delegate<void ()>) (callback=...) at ../../../../../../../Platform/System.cpp:116
#7  0x400d4c90 in SystemClass::onReady(Delegate<void ()>) (this=<optimized out>, readyHandler=...)
    at ../../../../../../../../../Sming/Platform/System.h:166
#8  init () at ../../../../../../../app/application.cpp:74
#9  0x400d4724 in app_main () at ../../../../../../../Arch/Esp32/Components/esp32/src/startup.cpp:44
#10 0x4012cc02 in main_task (args=0x0) at /opt/esp-idf-5.2/components/freertos/app_startup.c:208
#11 0x40088a08 in vPortTaskWrapper (pxCode=0x4012cb98 <main_task>, pvParameters=0x0)
    at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
(gdb) 

NB. I'm forcing this exception by patching system_os_post to call xQueueSendToBackFromISR(nullptr, ...).

NOTE: For some reason the esp32c3 isn't responding to GDB over serial (esp32 is fine). I'm not sure why, but it's annoying.

@mikee47
Copy link
Contributor

mikee47 commented Nov 27, 2024

OK, so at least with my esp32c3 dev. board I suspect that the auto-reset lines (RTS/CTS) on the serial port aren't being set correctly with GDB (both should be low). Can't find any gdb commands to override that behaviour, closest is flow control (which is disabled). Here's a workaround:

make tcp-serial-redirect
make gdb COM_PORT_GDB=192.168.1.40:7780

Replacing the IP as required.

@pljakobs
Copy link
Contributor Author

not sure how helpful this is, seems that gdb cannot identify the error?

Registered storage devices:
  spiFlash: type flash, size 0x400000. Partitions:
    spiFlash/nvs, data/nvs @ 0x9000, size 0x6000
    spiFlash/phy_init, data/phy @ 0xf000, size 0x1000
    spiFlash/factory, app/factory @ 0x10000, size 0x160000
    spiFlash/lfs0, data/littlefs @ 0x170000, size 0x90000
    spiFlash/rom1, app/ota1 @ 0x200000, size 0x180000
    spiFlash/lfs1, data/littlefs @ 0x380000, size 0x80000


[/home/pjakobs/devel/esp_rgbww_firmware/app/otaupdate.cpp:512] ApplicationOTA::saveStatus 3 to rom partition rom0

[/home/pjakobs/devel/esp_rgbww_firmware/app/application.cpp:558] mouting primary littlefs partition at 170000, length 589824
[Core/FileSystem.cpp:45] mount() returned 0 (Success)
[Core/FileSystem.cpp:54] File system initialised
Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception). 
Debug exception reason: Stack canary watchpoint triggered (main) 
Core  0 register dump:
PC      : 0x40089036  PS      : 0x00060a36  A0      : 0x4008318d  A1      : 0x3ffb1200  
A2      : 0x00000000  A3      : 0x00060a23  A4      : 0x00060a20  A5      : 0x3ffb15c4  
A6      : 0x00000002  A7      : 0x3ffcb450  A8      : 0x801212ac  A9      : 0x3ffb13a0  
A10     : 0x3ffcb624  A11     : 0x0000005d  A12     : 0x00000003  A13     : 0x3ffb17fc  
A14     : 0x00000002  A15     : 0x3ffb16d0  SAR     : 0x0000001b  EXCCAUSE: 0x00000001  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  


Backtrace: 0x40089033:0x3ffb1200 0x4008318a:0x3ffb12d0 0x4008c572:0x3ffb12f0 0x4008c630:0x3ffb1310 0x40081d2d:0x3ffb1330 0x40081d59:0x3ffb1360 0x40081d89:0x3ffb1380 0x4008e82d:0x3ffb13a0 0x401212a9:0x3ffb13c0 0x40121317:0x3ffb13e0 0x40121416:0x3ffb1410 0x4011fda3:0x3ffb1430 0x4011ff6d:0x3ffb1450 0x40125917:0x3ffb1480 0x4012486f:0x3ffb14a0 0x40125155:0x3ffb14d0 0x4012516f:0x3ffb1590 0x4013fd42:0x3ffb15b0 0x40140027:0x3ffb15f0 0x401403fd:0x3ffb1610 0x40140431:0x3ffb1630 0x40124615:0x3ffb1690 0x4011f65a:0x3ffb1c30 0x401225b3:0x3ffb1cd0 0x40122ee2:0x3ffb1d70 0x40123c16:0x3ffb1dd0 0x40123d8e:0x3ffb1e20 0x4012195d:0x3ffb1e70 0x400d5d83:0x3ffb1e90 0x400d7849:0x3ffb1ec0 0x400d7cc1:0x3ffb2120 0x400d4551:0x3ffb2170 0x401899bc:0x3ffb2190 0x40088ded:0x3ffb21b0




ELF file SHA256: 6e7439947

Entering gdb stub now.
$T1f#eb
--- exit ---
pjakobs@t460 ~/d/esp_rgbww_firmware (feature/pinConfig)> make gdb

esp_rgbww_firmware: Invoking 'gdb' for Esp32/esp32 (debug) architecture
COM_PORT is /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0@115200 for Esp32
using firmware version pj-1-441-gc0ab-dirty"-["feature/pinConfig"]"
using WEBapp V5-pj-235-g2390-[feature/manualPinConfig]
using SMING 6.0.x-dev-23-g7b3ef-dirty"-["develop"]"
trap '' INT; /opt/esp32/tools/xtensa-esp-elf-gdb/12.1_20231023/xtensa-esp-elf-gdb/bin/xtensa-esp32-elf-gdb -x /opt/Sming/Sming/Arch/Esp32/Components/gdbstub/gdbcmds -b 115200 -ex "target remote /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0" out/Esp32/esp32/debug/build/app.out
GNU gdb (esp-gdb) 12.1_20231023
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=xtensa-esp-elf".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from out/Esp32/esp32/debug/build/app.out...

Welcome to SMING!
Type 'c' (continue) to run application

Remote debugging using /dev/serial/by-id/usb-Silicon_Labs_CP2102_USB_to_UART_Bridge_Controller_0001-if00-port0
warning: multi-threaded target stopped without sending a thread-id, using first non-exited thread
_frxt_int_enter ()
--Type <RET> for more, q to quit, c to continue without paging--
    at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:127
127	    s32i    a13, a1, XT_STK_A13
(gdb) 

but, here's the resulting backtrace:

(gdb) bt
#0  _frxt_int_enter ()
    at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/portasm.S:127
#1  0x4008318d in _xt_lowint1 () at /opt/esp-idf-5.2/components/xtensa/xtensa_vectors.S:1225
#2  0x4008c575 in vPortExitCriticalSafe (mux=0x3ffaea40)
    at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h:600
#3  multi_heap_internal_unlock (heap=0x3ffc6b90)
    at /opt/esp-idf-5.2/components/heap/multi_heap.c:170
#4  0x4008c633 in multi_heap_realloc_impl (heap=0x3ffc6b90, p=0x3ffcb624, size=93)
    at /opt/esp-idf-5.2/components/heap/multi_heap.c:265
#5  0x40081d30 in heap_caps_realloc_base (ptr=0x3ffcb624, size=93, caps=6144)
    at /opt/esp-idf-5.2/components/heap/heap_caps.c:456
#6  0x40081d5c in heap_caps_realloc (ptr=0x3ffcb624, size=93, caps=6144)
    at /opt/esp-idf-5.2/components/heap/heap_caps.c:492
#7  0x40081d8c in heap_caps_realloc_default (ptr=0x3ffcb624, size=93)
    at /opt/esp-idf-5.2/components/heap/heap_caps.c:261
#8  0x4008e830 in realloc (ptr=0x3ffcb624, size=93)
    at /opt/esp-idf-5.2/components/newlib/heap.c:34
#9  0x401212ac in ConfigDB::PoolData::ensureCapacity (this=0x3ffcb438, capacity=93)
    at /opt/Sming/Sming/Libraries/ConfigDB/src/Pool.cpp:55
#10 0x4012131a in ConfigDB::PoolData::allocate (this=0x3ffcb438, itemCount=17)
    at /opt/Sming/Sming/Libraries/ConfigDB/src/Pool.cpp:76
#11 0x40121419 in ConfigDB::StringPool::add (this=0x3ffcb438, string=...)
--Type <RET> for more, q to quit, c to continue without paging--c
    at /opt/Sming/Sming/Libraries/ConfigDB/src/Pool.cpp:119
#12 0x4011fda6 in ConfigDB::StringPool::findOrAdd (this=0x3ffcb438, string=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/include/ConfigDB/Pool.h:197
#13 0x4011ff70 in ConfigDB::Store::parseString (this=0x3ffcb424, prop=..., dst=..., defaultData=0x3f4126c6 <AppConfig::ContainedHardware::ContainedPinconfigsItem::defaultData+2>, value=0x3ffb1801 "Lightinator mini", valueLength=16) at /opt/Sming/Sming/Libraries/ConfigDB/src/Store.cpp:99
#14 0x4012591a in ConfigDB::Property::setJsonValue (this=0x3ffb14d0, value=0x3ffb1801 "Lightinator mini", valueLength=16) at /opt/Sming/Sming/Libraries/ConfigDB/src/Property.cpp:54
#15 0x40124872 in ConfigDB::Json::WriteStream::setProperty (this=0x3ffb169c, element=..., object=..., prop=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/Json/WriteStream.cpp:305
#16 0x40125158 in ConfigDB::Json::WriteStream::startElement (this=0x3ffb169c, element=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/Json/WriteStream.cpp:138
#17 0x40125172 in ConfigDB::Json::WriteStream::_ZThn12_N8ConfigDB4Json11WriteStream12startElementERKN4JSON7ElementE (this=0x3ffb169c, element=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/Json/WriteStream.h:95
#18 0x4013fd45 in JSON::StreamingParser::startElement (this=0x3ffb17b4, type=JSON::Element::Type::String) at /opt/Sming/Sming/Libraries/JsonStreamingParser/src/StreamingParser.cpp:356
#19 0x4014002a in JSON::StreamingParser::parse (this=0x3ffb17b4, c=34 '"') at /opt/Sming/Sming/Libraries/JsonStreamingParser/src/StreamingParser.cpp:148
#20 0x40140400 in JSON::StreamingParser::parse (this=0x3ffb17b4, data=0x3ffb165d ",\"soc\":\"esp32c3\",\"m", length=19) at /opt/Sming/Sming/Libraries/JsonStreamingParser/src/StreamingParser.cpp:110
#21 0x40140434 in JSON::StreamingParser::parse (this=0x3ffb17b4, stream=...) at /opt/Sming/Sming/Libraries/JsonStreamingParser/src/StreamingParser.cpp:123
#22 0x40124618 in ConfigDB::Json::WriteStream::parse (object=..., source=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/Json/WriteStream.cpp:49
#23 0x4011f65d in ConfigDB::Json::Format::importFromStream (this=0x3ffbe068 <ConfigDB::Json::format>, object=..., source=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/Json/Format.cpp:66
#24 0x401225b6 in ConfigDB::Object::importFromFile (this=0x3ffcb424, format=..., filename=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/Object.cpp:449
#25 0x40122ee5 in ConfigDB::Store::importFromFile (this=0x3ffcb424, format=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/include/ConfigDB/Store.h:145
#26 0x40123c19 in ConfigDB::Database::loadStore (this=<optimized out>, storeInfo=...) at /opt/esp32/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/shared_ptr_base.h:1665
#27 0x40123d91 in ConfigDB::Database::openStore (this=0x3ffcb1bc, index=<optimized out>) at /opt/Sming/Sming/Libraries/ConfigDB/src/Database.cpp:105
#28 0x40121960 in ConfigDB::Object::openStore (this=0x3ffb1f54, db=..., storeIndex=5) at /opt/Sming/Sming/Libraries/ConfigDB/src/Object.cpp:126
#29 0x400d5d86 in ConfigDB::OuterObjectTemplate<AppConfig::ContainedHardware, AppConfig::HardwareUpdater, AppConfig, 5u, AppConfig, 5u, 0u>::OuterObjectTemplate (this=0x3ffb1f54, db=...) at /opt/Sming/Sming/Libraries/ConfigDB/src/include/ConfigDB/Object.h:365
#30 0x400d784c in AppConfig::Hardware::OuterObjectTemplate (this=0x3ffb1f54) at /home/pjakobs/devel/esp_rgbww_firmware/out/ConfigDB/app-config.h:1846
#31 Application::init (this=0x3ffc1130 <app>) at /home/pjakobs/devel/esp_rgbww_firmware/app/application.cpp:289
#32 0x400d7cc4 in init () at /home/pjakobs/devel/esp_rgbww_firmware/app/application.cpp:145
#33 0x400d4554 in app_main () at /opt/Sming/Sming/Arch/Esp32/Components/esp32/src/startup.cpp:45
#34 0x401899bf in main_task (args=0x0) at /opt/esp-idf-5.2/components/freertos/app_startup.c:208
#35 0x40088df0 in vPortTaskWrapper (pxCode=0x40189978 <main_task>, pvParameters=0x0) at /opt/esp-idf-5.2/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
(gdb) 

@mikee47
Copy link
Contributor

mikee47 commented Nov 27, 2024

So this is a different error to the one you reported above. The inconsistency suggests memory corruption of some sort.

@pljakobs
Copy link
Contributor Author

let's pause this for a bit, there's currently too much going on otherwise, I can't fully concentrate.
I might be able to provide more concise data tomorrow, right now I'm just trying to get stuff between other things.

@slaff
Copy link
Contributor

slaff commented Nov 27, 2024

@pljakobs when you have more time make sure to get the latest develop, run make -C $SMING_HOME dist-clean, clean your project and then compile again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants