Open Ams-Laser opened 1 year ago
Looking into this, want to drop the decoded backtrace here -
$> ~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-addr2line -e bt-firmware.elf -fCp < backtrace.txt
panic_abort at (snip)/esp-idf-public/components/esp_system/panic.c:408
esp_system_abort at (snip)/esp-idf-public/components/esp_system/esp_system.c:137
abort at (snip)/esp-idf-public/components/newlib/abort.c:46
__cxxabiv1::__terminate(void (*)()) at (snip)/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc:47
__cxa_call_terminate at (snip)/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_call.cc:54
__gxx_personality_v0 at (snip)/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_personality.cc:676
_Unwind_RaiseException_Phase2 at (snip)/xtensa-esp32-elf/src/gcc/libgcc/unwind.inc:64
_Unwind_Resume at (snip)/xtensa-esp32-elf/src/gcc/libgcc/unwind.inc:241
__gnu_cxx::new_allocator<char>::~new_allocator() at (snip)/xtensa-esp32-elf/include/c++/8.4.0/ext/new_allocator.h:86 (discriminator 1)
std::filesystem::__cxx11::directory_entry::directory_entry(std::filesystem::__cxx11::path const&, std::filesystem::file_type) at (snip)/xtensa-esp32-elf/include/c++/8.4.0/bits/fs_dir.h:304
std::filesystem::__cxx11::recursive_directory_iterator::increment(std::error_code&) at (snip)/FluidNC/stdfs/std-dir.cpp:177
std::filesystem::__cxx11::recursive_directory_iterator::operator++() at (snip)/FluidNC/stdfs/std-dir.cpp:155
_ZN5WebUIL14listFilesystemEPKcS1_NS_19AuthenticationLevelER7Channel$isra$76 at (snip)/FluidNC/src/WebUI/WebSettings.cpp:407
WebUI::listSDFiles(char*, WebUI::AuthenticationLevel, Channel&) at (snip)/FluidNC/src/WebUI/WebSettings.cpp:433
WebCommand::action(char*, WebUI::AuthenticationLevel, Channel&) at (snip)/FluidNC/src/WebUI/WebSettings.cpp:107
do_command_or_setting(char const*, char*, WebUI::AuthenticationLevel, Channel&) at (snip)/FluidNC/src/ProcessSettings.cpp:927
settings_execute_line(char*, Channel&, WebUI::AuthenticationLevel) at (snip)/FluidNC/src/ProcessSettings.cpp:989
execute_line(char*, Channel&, WebUI::AuthenticationLevel) at (snip)/FluidNC/src/ProcessSettings.cpp:1017
protocol_main_loop() at (snip)/FluidNC/src/Protocol.cpp:282
loop() at (snip)/FluidNC/src/Main.cpp:191
loopTask(void*) at (snip)/framework-arduinoespressif32/cores/esp32/main.cpp:50
So we're seeing a failure that involves the copy/pasted std::filesystem
contents in std-dir.cpp
, in particular, something in the line while (!_M_dirs->top().advance(skip_permission_denied, ec) && !ec)
Continuing to investigate...
For those interested in generating their own backtrace, the file backtrace.txt
piped into the platformio bundled addr2line
is a newline separated addresses from the backtrace.
I wonder if it is just out of memory at that point. "new_allocator"
Could be, but it's a little odd that it's crashing in ~new_allocator()
, the dtor. Here's lines 303 to 305 of fs_dir.h
(fs_dir.h:304
is in the backtrace) -
directory_entry(const filesystem::path& __p, file_type __t)
: _M_path(__p), _M_type(__t)
{ }
so perhaps it runs out of memory when trying to make a copy of __p
(_M_path
is a full filesystem::path
object, not taking a reference).
We have reason to believe that memory could be low, based on the WARN messages. I never use the BT version so I do not have a good sense of its memory usage. I wonder if it can be configured similarly to WiFi.
@Ams-Laser are you able to reliably reproduce this issue when issuing $sd/list
just after startup? Could you try with the wifi or noradio builds and see if you can repro the reboot?
@Ams-Laser are you able to reliably reproduce this issue when issuing
$sd/list
just after startup? Could you try with the wifi or noradio builds and see if you can repro the reboot?
It does not happen after reboot, only after upload, Will try on WiFi and let you know
The Bluetooth build is using a lot of RAM memory. The Arduino Espressif32 Framework compiles the Bluetooth library with a lot of unnecessary options enabled - BLE, audio, secure pairing, and various other things that chew up memory.
I made some improvements to the WebSocketsNoStall branch to get back some of the memory, but there is still a potential problem. Reducing the framework library's memory footprint can be done, but it requires some tricks that create a maintenance problem.
@Ams-Laser Does this prerelease help? https://github.com/bdring/FluidNC/releases/tag/v3.7.2-pre3 It reduces the memory usage of the Bluetooth stack, in addition to other memory-related improvements.
Will try and get back
just flashed and connected does not look good it works in vector mode but if i send a raster job it just hangs
Controller Board
MKS TinyBee V1.0
Machine Description
Co2 Laser, but problem was detected using plain board, no drivers no conections, only SD card inserted
Input Circuits
Configuration file
Startup Messages
User Interface Software
Fluid Term
What happened?
uploaded a file to SD using fluid term, then issued $sd/list (to verify upload) board re booted
Other Information
Backtrace: 0x40085539:0x3ffd5550 0x40096729:0x3ffd5570 0x4009d091:0x3ffd5590 0x401c1aa7:0x3ffd5610 0x401db490:0x3ffd5630 0x401c177a:0x3ffd5650 0x401dd471:0x3ffd56c0 0x401dd755:0x3ffd5700 0x400d98d3:0x3ffd57a0 0x400feaf3:0x3ffd57c0 0x400ff209:0x3ffd5870 0x400ff289:0x3ffd5900 0x400fc00f:0x3ffd5950 0x400fc370:0x3ffd5a50 0x401f9345:0x3ffd5a70 0x400f028a:0x3ffd5aa0 0x400f04cb:0x3ffd5b20 0x400f0527:0x3ffd5b50 0x400f1606:0x3ffd5b80 0x400e45f1:0x3ffd5bb0 0x40104495:0x3ffd5c00
ELF file SHA256: 007f6a0ee47fc85b