Adding the error here, although I cannot believe there would be a problem like this in the server.
Guru Meditation Error: Core 0 panic’ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x402629fc PS : 0x00000030 A0 : 0x40228e5d A1 : 0x3fff45d0
0x402629fc: memchr at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/string/memchr.c:120
0x40228e5d: _printf_i at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf_i.c:221
A2 : 0x000000ab A3 : 0x00000000 A4 : 0x000000aa A5 : 0x402283bc
0x402283bc: __ssputs_r at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf.c:179
A6 : 0x3fff4680 A7 : 0x00000000 A8 : 0x3fff4663 A9 : 0x3fff4808
A10 : 0x4027adba A11 : 0x00000064 A12 : 0x000000ab A13 : 0x3fff46d0
A14 : 0x402283bc A15 : 0x3fff4620 SAR : 0x0000001f EXCCAUSE: 0x0000001c
0x402283bc: __ssputs_r at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf.c:179
Backtrace: 0x402629fc:0x3fff45d0 0x40228e5d:0x3fff45d0 0x40228738:0x3fff4620 0x4022a7b9:0x3fff46d0 0x4022a80d:0x3fff4750 0x4022524d:0x3fff4780 0x40225fc8:0x3fff47b0 Guru Meditation Error: Core 0 panic’ed (LoadStoreAlignment). Exception was unhandled.
0x402629fc: memchr at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/string/memchr.c:120
0x40228e5d: _printf_i at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf_i.c:221
0x40228738: _svfprintf_r at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf.c:636
0x4022a7b9: _vsnprintf_r at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/vsnprintf.c:71 (discriminator 4)
0x4022a80d: vsnprintf at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/vsnprintf.c:41
0x4022524d: mg_vasprintf at /home/esp/esp/RoyalMarine/components/mongoose/mongoose.c:4103
0x40225fc8: mg_vprintf at /home/esp/esp/RoyalMarine/components/mongoose/mongoose.c:2129
Core 0 register dump:
PC : 0x4023d349 PS : 0x00000033 A0 : 0x4023d2bc A1 : 0x3ffea190
0x4023d349: xt_retaddr_callee at /home/esp/esp/ESP8266_RTOS_SDK/components/esp8266/source/backtrace.c:83
0x4023d2bc: xt_retaddr_callee at /home/esp/esp/ESP8266_RTOS_SDK/components/esp8266/source/backtrace.c:47
A2 : 0x00015fb8 A3 : 0x00000024 A4 : 0x3fff47e1 A5 : 0x3fff47dd
A6 : 0x000007fe A7 : 0x000000a1 A8 : 0x000000c0 A9 : 0x3fff4808
A10 : 0x4027adba A11 : 0x00000064 A12 : 0x40225fc8 A13 : 0x3ffea1d0
0x40225fc8: mg_vprintf at /home/esp/esp/RoyalMarine/components/mongoose/mongoose.c:2129
A14 : 0x40228e5d A15 : 0x40228e5d SAR : 0x0000001f EXCCAUSE: 0x00000009
0x40228e5d: _printf_i at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf_i.c:221
0x40228e5d: _printf_i at /builds/idf/crosstool-NG/.build/xtensa-lx106-elf/src/newlib/newlib/libc/stdio/nano-vfprintf_i.c:221
Backtrace: 0x4023d349:0x3ffea190 0x4021fdc7:0x3ffea1c0 0x40100c78:0x3ffea210 0x4023d2bc:0x3ffea230
0x4023d349: xt_retaddr_callee at /home/esp/esp/ESP8266_RTOS_SDK/components/esp8266/source/backtrace.c:83
0x4021fdc7: panic_frame at /home/esp/esp/ESP8266_RTOS_SDK/components/freertos/port/esp8266/panic.c:109
(inlined by) panicHandler at /home/esp/esp/ESP8266_RTOS_SDK/components/freertos/port/esp8266/panic.c:168
0x40100c78: _heap_caps_malloc at /home/esp/esp/ESP8266_RTOS_SDK/components/heap/src/esp_heap_caps.c:98
0x4023d2bc: xt_retaddr_callee at /home/esp/esp/ESP8266_RTOS_SDK/components/esp8266/source/backtrace.c:47
Code is (practically what is found in general examples):
static void http_server_handler(
struct mg_connection *conn,
int ev,
void *ev_data,
void *fn_data
)
{
if (ev == MG_EV_HTTP_MSG)
{
struct mg_http_message *hm = (struct mg_http_message *)ev_data;
struct mg_http_serve_opts opts = {
.root_dir = cfg.webroot,
.ssi_pattern = NULL,
.extra_headers = NULL
};
mg_http_serve_dir(conn, hm, &opts); // BOOM!
}
}
Webroot (SPIFFS mount point) is “/html” and if request URI points to a non-existing file, there is no crash (browser receives “Not found”). If requested file exists, it will crash.
Something SPIFFS specific that I should do?