rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.05k stars 12.69k forks source link

Bug-> rust/library/alloc/src/collections/btree /node.rs #116718

Closed blue-freedom-technologies closed 1 year ago

blue-freedom-technologies commented 1 year ago

Summary

I am testing a new board esp32-c6 our target is riscv32imac-esp-espidf. This is std application (ESP_IDF_VERSION = "v5.1")

We were trying this code.

use esp_idf_sys as _; 
use log::*;

use std::str::FromStr;
use subxt_signer::{SecretUri};
static DEVICE_ACCOUNT_SEEDS:&str ="*";

fn main() {
    esp_idf_sys::link_patches();
    esp_idf_svc::log::EspLogger::initialize_default();

    let uri_break_point = SecretUri::from_str(DEVICE_ACCOUNT_SEEDS).expect("valid URI");

    info!("Hello, world!");
 }

I tried this code:

let uri = SecretUri::from_str(DEVICE_ACCOUNT_SEEDS).expect("valid URI");

I expected to see this happen: explanation

To use this library:

 subxt-signer = { version = "0.32.1", default-features = false, features = ["sr25519","subxt"] }

Instead, this happened: explanation

The gdb-multiarch view

image

It blows up exactly in here

For the esp32c6 chip.

Meta

rustc --version --verbose:

rustc 1.75.0-nightly (97c81e1b5 2023-10-07)
binary: rustc
commit-hash: 97c81e1b537088f1881c8894ee8579812ed9b6d1
commit-date: 2023-10-07
host: x86_64-unknown-linux-gnu
release: 1.75.0-nightly
LLVM version: 17.0.2
Backtrace

``` Running `espflash flash --monitor target/riscv32imac-esp-espidf/debug/prototype-app` [2023-10-14T05:18:44Z INFO ] 🚀 A new version of espflash is available: v2.1.0 [2023-10-14T05:18:44Z INFO ] Detected 2 serial ports [2023-10-14T05:18:44Z INFO ] Ports which match a known common dev board are highlighted [2023-10-14T05:18:44Z INFO ] Please select a port [2023-10-14T05:18:48Z INFO ] Serial port: '/dev/ttyACM0' [2023-10-14T05:18:48Z INFO ] Connecting... [2023-10-14T05:18:48Z INFO ] Using flash stub Chip type: esp32c6 (revision v0.0) Crystal frequency: 40MHz Flash size: 8MB Features: WiFi 6, BT 5 MAC address: 40:4c:ca:41:d4:34 App/part. size: 1,540,224/8,323,072 bytes, 18.51% [00:00:00] [========================================] 13/13 0x0 [00:00:00] [========================================] 1/1 0x8000 [00:00:08] [========================================] 662/662 0x10000 [2023-10-14T05:18:57Z INFO ] Flashing has completed! Commands: CTRL+R Reset chip CTRL+C Exit ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x15 (USB_UART_HPSYS),boot:0xc (SPI_FAST_FLASH_BOOT) Saved PC:0x408007fe 0x408007fe - read_id_core at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/spi_flash/esp_flash_api.c:413 SPIWP:0xee mode:DIO, clock div:2 load:0x4086c410,len:0xd48 0x4086c410 - _heap_start at ??:?? load:0x4086e610,len:0x2d68 0x4086e610 - _heap_start at ??:?? load:0x40875720,len:0x1800 0x40875720 - _heap_start at ??:?? SHA-256 comparison failed: Calculated: 377c26481ad6ab0cce508450f353a55f4bd7eb9159aaf85fde3111071f164514 Expected: 0af544a033ab3492852b8232c904c578d5f07c9d4a423a64473f060db374ab32 Attempting to boot anyway... entry 0x4086c410 0x4086c410 - _heap_start at ??:?? I (41) boot: ESP-IDF v5.1-beta1-378-gea5e0ff298-dirt 2nd stage bootloader I (42) boot: compile time Jun 7 2023 08:02:08 I (43) boot: chip revision: v0.0 I (46) boot.esp32c6: SPI Speed : 40MHz I (51) boot.esp32c6: SPI Mode : DIO I (56) boot.esp32c6: SPI Flash Size : 8MB I (61) boot: Enabling RNG early entropy source... I (66) boot: Partition Table: I (70) boot: ## Label Usage Type ST Offset Length I (77) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (84) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (92) boot: 2 factory factory app 00 00 00010000 007f0000 I (99) boot: End of partition table I (103) esp_image: segment 0: paddr=00010020 vaddr=42000020 size=e2f78h (929656) map I (301) esp_image: segment 1: paddr=000f2fa0 vaddr=40800000 size=05078h ( 20600) load I (306) esp_image: segment 2: paddr=000f8020 vaddr=420e8020 size=8baa0h (572064) map I (423) esp_image: segment 3: paddr=00183ac8 vaddr=40805078 size=035c4h ( 13764) load I (428) esp_image: segment 4: paddr=00187094 vaddr=40808640 size=00fbch ( 4028) load I (432) boot: Loaded app from partition at offset 0x10000 I (435) boot: Disabling RNG early entropy source... I (452) cpu_start: Unicore app I (452) cpu_start: Pro cpu up. W (461) clk: esp_perip_clk_init() has not been implemented yet I (468) cpu_start: Pro cpu start user code I (468) cpu_start: cpu freq: 160000000 Hz I (468) cpu_start: Application information: I (471) cpu_start: Project name: libespidf I (476) cpu_start: App version: 1 I (480) cpu_start: Compile time: Oct 13 2023 15:21:02 I (486) cpu_start: ELF file SHA256: 0000000000000000... I (492) cpu_start: ESP-IDF: v5.1 I (497) cpu_start: Min chip rev: v0.0 I (502) cpu_start: Max chip rev: v0.99 I (507) cpu_start: Chip rev: v0.0 I (511) heap_init: Initializing. RAM available for dynamic allocation: I (518) heap_init: At 4080A570 len 000720A0 (456 KiB): D/IRAM I (525) heap_init: At 4087C610 len 00002F54 (11 KiB): STACK/DIRAM I (532) heap_init: At 50000010 len 00003FF0 (15 KiB): RTCRAM I (539) spi_flash: detected chip: generic I (543) spi_flash: flash io: dio W (547) rmt(legacy): legacy driver is deprecated, please migrate to `driver/rmt_tx.h` and/or `driver/rmt_rx.h` W (557) timer_group: legacy driver is deprecated, please migrate to `driver/gptimer.h` I (566) sleep: Configure to isolate all GPIO pins in sleep state I (573) sleep: Enable automatic switching of GPIO sleep configuration I (580) coexist: coex firmware version: ebddf30 I (585) coexist: coexist rom version 5b8dcfa I (590) app_start: Starting scheduler on CPU0 I (595) main_task: Started on CPU0 I (595) main_task: Calling app_main() Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled. Core 0 register dump: MEPC : 0x40022394 RA : 0x40022616 SP : 0x4080ac40 GP : 0x40808e40 0x40022394 - wifi_get_target_power at ??:?? 0x40022616 - wifi_get_target_power at ??:?? 0x4080ac40 - _heap_start at ??:?? 0x40808e40 - __global_pointer$ at ??:?? TP : 0x40781e68 T0 : 0x4002238a T1 : 0xffffffe0 T2 : 0x00000004 0x40781e68 - ets_rom_layout_p at ??:?? 0x4002238a - wifi_get_target_power at ??:?? 0xffffffe0 - LP_ANA_PERI at ??:?? 0x00000004 - RV_STK_RA at ??:?? S0/FP : 0x00001800 S1 : 0x4087de78 A0 : 0x00001800 A1 : 0x4087de70 0x00001800 - at ??:?? 0x4087de78 - _heap_start at ??:?? 0x00001800 - at ??:?? 0x4087de70 - _heap_start at ??:?? A2 : 0x00000080 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x4004d0d0 0x00000080 - RV_STK_MSTATUS at ??:?? 0x00000001 - at ??:?? 0x00000000 - at ??:?? 0x4004d0d0 - wifi_get_target_power at ??:?? A6 : 0x00000004 A7 : 0x00000001 S2 : 0x4087de78 S3 : 0x00001800 0x00000004 - RV_STK_RA at ??:?? 0x00000001 - at ??:?? 0x4087de78 - _heap_start at ??:?? 0x00001800 - at ??:?? S4 : 0x4080ac74 S5 : 0x00000000 S6 : 0x4080c40c S7 : 0x4080c3e4 0x4080ac74 - _heap_start at ??:?? 0x00000000 - at ??:?? 0x4080c40c - _heap_start at ??:?? 0x4080c3e4 - _heap_start at ??:?? S8 : 0x4080c3c0 S9 : 0x4080b3f8 S10 : 0x40809610 S11 : 0x00000000 0x4080c3c0 - _heap_start at ??:?? 0x4080b3f8 - _heap_start at ??:?? 0x40809610 - _bss_start at ??:?? 0x00000000 - at ??:?? T3 : 0x00000000 T4 : 0x00000004 T5 : 0x00000000 T6 : 0x00000000 0x00000000 - at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x00000005 MTVAL : 0x00001810 0x00001881 - at ??:?? 0x40800001 - _iram_start at ??:?? 0x00000005 - RV_STK_RA at ??:?? 0x00001810 - at ??:?? MHARTID : 0x00000000 0x00000000 - at ??:?? Stack memory: 4080ac40: 0x4087de78 0x4087de78 0x00001800 0x40022616 0x00000000 0x0000180c 0x00000003 0x00000080 0x4087de78 - _heap_start at ??:?? 0x4087de78 - _heap_start at ??:?? 0x00001800 - at ??:?? 0x40022616 - wifi_get_target_power at ??:?? 0x00000000 - at ??:?? 0x0000180c - at ??:?? 0x00000003 - at ??:?? 0x00000080 - RV_STK_MSTATUS at ??:?? 4080ac60: 0x4080c40c 0x00000000 0x4080ac74 0x00001800 0x4087de78 0x00000080 0x00000080 0x40801376 0x4080c40c - _heap_start at ??:?? 0x00000000 - at ??:?? 0x4080ac74 - _heap_start at ??:?? 0x00001800 - at ??:?? 0x4087de78 - _heap_start at ??:?? 0x00000080 - RV_STK_MSTATUS at ??:?? 0x00000080 - RV_STK_MSTATUS at ??:?? 0x40801376 - heap_caps_realloc_base at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/heap/heap_caps.c:442 4080ac80: 0x4087c610 0x4087f564 0x4080c3f4 0x00000004 0x00001800 0x00000080 0x4080ace8 0x408013a6 0x4087c610 - _heap_start at ??:?? 0x4087f564 - _heap_start at ??:?? 0x4080c3f4 - _heap_start at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00001800 - at ??:?? 0x00000080 - RV_STK_MSTATUS at ??:?? 0x4080ace8 - _heap_start at ??:?? 0x408013a6 - heap_caps_realloc at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/heap/heap_caps.c:474 4080aca0: 0x00000080 0x00000004 0x4080ace8 0x420cf554 0x00000004 0x00000004 0x00000000 0x0000000c 0x00000080 - RV_STK_MSTATUS at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x4080ace8 - _heap_start at ??:?? 0x420cf554 - alloc::alloc::realloc at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00000000 - at ??:?? 0x0000000c - RV_STK_GP at ??:?? 4080acc0: 0x00000000 0x00000004 0x00000008 0x42020240 0x4080c3f4 0x00000040 0x00000008 0x42020710 0x00000000 - at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00000008 - RV_STK_SP at ??:?? 0x42020240 - core::alloc::layout::Layout::array::inner at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/alloc/layout.rs:457 0x4080c3f4 - _heap_start at ??:?? 0x00000040 - RV_STK_A6 at ??:?? 0x00000008 - RV_STK_SP at ??:?? 0x42020710 - as core::ops::try_trait::Try>::branch at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1950 4080ace0: 0x03c4000a 0x00000000 0x4080c528 0x000000c0 0x00000000 0x4087de78 0x00000004 0x00000040 0x03c4000a - at ??:?? 0x00000000 - at ??:?? 0x4080c528 - _heap_start at ??:?? 0x000000c0 - at ??:?? 0x00000000 - at ??:?? 0x4087de78 - _heap_start at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00000040 - RV_STK_A6 at ??:?? 4080ad00: 0x4080add0 0x4080ad94 0x4080c3e4 0x42021096 0x4087e2d4 0x40880000 0x4087c610 0x4201f9ac 0x4080add0 - _heap_start at ??:?? 0x4080ad94 - _heap_start at ??:?? 0x4080c3e4 - _heap_start at ??:?? 0x42021096 - alloc::raw_vec::RawVec::reserve_for_push at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec.rs:302 0x4087e2d4 - _heap_start at ??:?? 0x40880000 - g_saved_pc at ??:?? 0x4087c610 - _heap_start at ??:?? 0x4201f9ac - alloc::vec::Vec::push at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:1885 4080ad20: 0x00000000 0x00000000 0x00000000 0x00000010 0x4080ac74 0x00000010 0x00001800 0x408011d0 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000010 - _rtc_slow_length at ??:?? 0x4080ac74 - _heap_start at ??:?? 0x00000010 - _rtc_slow_length at ??:?? 0x00001800 - at ??:?? 0x408011d0 - heap_caps_malloc_base at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/heap/heap_caps.c:177 4080ad40: 0x00000000 0x420de7a4 0x00000003 0x4080b278 0x4087d2f8 0x4080c3e0 0x00000003 0x00000001 0x00000000 - at ??:?? 0x420de7a4 - uart_fcntl at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_uart.c:298 0x00000003 - at ??:?? 0x4080b278 - _heap_start at ??:?? 0x4087d2f8 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x00000003 - at ??:?? 0x00000001 - at ??:?? 4080ad60: 0x00001800 0x00000010 0x00000001 0x00000000 0x4080add0 0x00000000 0x420eea20 0x4201f7e0 0x00001800 - at ??:?? 0x00000010 - _rtc_slow_length at ??:?? 0x00000001 - at ??:?? 0x00000000 - at ??:?? 0x4080add0 - _heap_start at ??:?? 0x00000000 - at ??:?? 0x420eea20 - anon.541560c33a54eeee0848c66f96b20927.132.llvm.8325921864184165149 at ??:?? 0x4201f7e0 - regex_automata::nfa::thompson::builder::Builder::add_capture_start at /home/silveira/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.1/src/nfa/thompson/builder.rs:1026 4080ad80: 0x00000008 0x4087d0d0 0x00000004 0x4087e2d4 0x00000006 0x00000004 0x00000000 0x00000001 0x00000008 - RV_STK_SP at ??:?? 0x4087d0d0 - _heap_start at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x4087e2d4 - _heap_start at ??:?? 0x00000006 - RV_STK_RA at ??:?? 0x00000004 - RV_STK_RA at ??:?? 0x00000000 - at ??:?? 0x00000001 - at ??:?? 4080ada0: 0x00000000 0x4080b3f8 0x4080c3c0 0x4080ae18 0x4087d2f8 0x4080c3e0 0x00000006 0x00000001 0x00000000 - at ??:?? 0x4080b3f8 - _heap_start at ??:?? 0x4080c3c0 - _heap_start at ??:?? 0x4080ae18 - _heap_start at ??:?? 0x4087d2f8 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x00000006 - RV_STK_RA at ??:?? 0x00000001 - at ??:?? 4080adc0: 0x4080b048 0x4080c3c0 0x4087e2d4 0x42037e6e 0x420dd94e 0x420dd966 0x00000000 0x00000000 0x4080b048 - _heap_start at ??:?? 0x4080c3c0 - _heap_start at ??:?? 0x4087e2d4 - _heap_start at ??:?? 0x42037e6e - core::ptr::drop_in_place> at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:498 0x420dd94e - usb_serial_jtag_close at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_usb_serial_jtag.c:244 0x420dd966 - usb_serial_jtag_fstat at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_usb_serial_jtag.c:235 0x00000000 - at ??:?? 0x00000000 - at ??:?? 4080ade0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 4080ae00: 0x00000000 0x00000000 0x420ddaca 0x00000000 0x420dd988 0x4080c3e4 0x4080c3e0 0x4080b278 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x420ddaca - usb_serial_jtag_fcntl at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_usb_serial_jtag.c:249 0x00000000 - at ??:?? 0x420dd988 - usb_serial_jtag_fsync at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_usb_serial_jtag.c:265 0x4080c3e4 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x4080b278 - _heap_start at ??:?? 4080ae20: 0x4080b048 0x4080c3e0 0x00000003 0x00000002 0x4080b144 0x4087d318 0x0000002a 0x42036c9a 0x4080b048 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x00000003 - at ??:?? 0x00000002 - at ??:?? 0x4080b144 - _heap_start at ??:?? 0x4087d318 - _heap_start at ??:?? 0x0000002a - RV_STK_A0 at ??:?? 0x42036c9a - regex_automata::nfa::thompson::compiler::Compiler::c at /home/silveira/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.1/src/nfa/thompson/compiler.rs:1005 4080ae40: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x7665642f 0x6365732f 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x7665642f - LP_ANA_PERI at ??:?? 0x6365732f - LP_ANA_PERI at ??:?? 4080ae60: 0x61646e6f 0x00007972 0x0000000e 0x00000000 0x00000001 0x000000c0 0x00000000 0x420dd6aa 0x61646e6f - LP_ANA_PERI at ??:?? 0x00007972 - at ??:?? 0x0000000e - RV_STK_GP at ??:?? 0x00000000 - at ??:?? 0x00000001 - at ??:?? 0x000000c0 - at ??:?? 0x00000000 - at ??:?? 0x420dd6aa - console_write at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_console.c:71 4080ae80: 0x00000000 0x420dd75e 0x00000000 0x00000000 0x420dd646 0x420dd722 0x420dd6fe 0x00000000 0x00000000 - at ??:?? 0x420dd75e - console_read at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_console.c:96 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x420dd646 - console_open at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_console.c:53 0x420dd722 - console_close at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_console.c:86 0x420dd6fe - console_fstat at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_console.c:81 0x00000000 - at ??:?? 4080aea0: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 4080aec0: 0x00000000 0x00000000 0x00000000 0x420dd786 0x00000000 0x4080af4c 0x4080c3e4 0x4201f9e0 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x420dd786 - console_fcntl at /home/silveira/bluefreedom/microcontroller/std/prototype-app/.embuild/espressif/esp-idf/v5.1/components/vfs/vfs_console.c:101 0x00000000 - at ??:?? 0x4080af4c - _heap_start at ??:?? 0x4080c3e4 - _heap_start at ??:?? 0x4201f9e0 - as core::ops::try_trait::Try>::branch at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1950 4080aee0: 0x420392da 0x4203872a 0x0000002a 0x40808e40 0x40781e68 0x42038732 0x4202011c 0x00000004 0x420392da - OUTLINED_FUNCTION_21 at ??:?? 0x4203872a - regex_automata::nfa::thompson::compiler::Compiler::add_union at /home/silveira/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.1/src/nfa/thompson/compiler.rs:1654 0x0000002a - RV_STK_A0 at ??:?? 0x40808e40 - __global_pointer$ at ??:?? 0x40781e68 - ets_rom_layout_p at ??:?? 0x42038732 - regex_automata::nfa::thompson::compiler::Compiler::add_union at /home/silveira/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.1/src/nfa/thompson/compiler.rs:1654 0x4202011c - OUTLINED_FUNCTION_20 at ??:?? 0x00000004 - RV_STK_RA at ??:?? 4080af00: 0x4080b048 0x4087d318 0x4080c3e4 0x4080c3e0 0x4080c3e0 0x00000001 0x4080a4e0 0x20001000 0x4080b048 - _heap_start at ??:?? 0x4087d318 - _heap_start at ??:?? 0x4080c3e4 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x00000001 - at ??:?? 0x4080a4e0 - uxCriticalNesting at ??:?? 0x20001000 - at ??:?? 4080af20: 0x0000000a 0x00000001 0x00000002 0x00000002 0x4080b144 0x4080af64 0x4080b048 0x4201f5fa 0x0000000a - RV_STK_SP at ??:?? 0x00000001 - at ??:?? 0x00000002 - at ??:?? 0x00000002 - at ??:?? 0x4080b144 - _heap_start at ??:?? 0x4080af64 - _heap_start at ??:?? 0x4080b048 - _heap_start at ??:?? 0x4201f5fa - regex_automata::nfa::thompson::builder::Builder::add_union at /home/silveira/.cargo/registry/src/index.crates.io-6f17d22bba15001f/regex-automata-0.4.1/src/nfa/thompson/builder.rs:718 4080af40: 0x4080c3c0 0x4080b3f8 0x40809610 0x00000000 0x40809610 0x4080b3f8 0x4080c3c0 0x4080b278 0x4080c3c0 - _heap_start at ??:?? 0x4080b3f8 - _heap_start at ??:?? 0x40809610 - _bss_start at ??:?? 0x00000000 - at ??:?? 0x40809610 - _bss_start at ??:?? 0x4080b3f8 - _heap_start at ??:?? 0x4080c3c0 - _heap_start at ??:?? 0x4080b278 - _heap_start at ??:?? 4080af60: 0x4080b138 0x4080c3e0 0x00000003 0x00000002 0x4080b144 0x4087d318 0x0000002a 0x420370ba 0x4080b138 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x00000003 - at ??:?? 0x00000002 - at ??:?? 0x4080b144 - _heap_start at ??:?? 0x4087d318 - _heap_start at ??:?? 0x0000002a - RV_STK_A0 at ??:?? 0x420370ba - as core::ops::try_trait::Try>::branch at /home/silveira/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:1950 4080af80: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 4080afa0: 0x4080b0ec 0x00000000 0x00000000 0x00000000 0x4080c538 0x00000000 0x00000000 0x00010889 0x4080b0ec - _heap_start at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x4080c538 - _heap_start at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00010889 - at ??:?? 4080afc0: 0x4080c538 0x00000080 0x4080c3e4 0x4080c3e0 0x4080afb0 0x420e1aa8 0x420e1ade 0x420e1b30 0x4080c538 - _heap_start at ??:?? 0x00000080 - RV_STK_MSTATUS at ??:?? 0x4080c3e4 - _heap_start at ??:?? 0x4080c3e0 - _heap_start at ??:?? 0x4080afb0 - _heap_start at ??:?? 0x420e1aa8 - __sread at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:37 0x420e1ade - __swrite at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:85 0x420e1b30 - __sseek at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:109 4080afe0: 0x420e1b68 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x420e1b68 - __sclose at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:130 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 4080b000: 0x00000000 0x00000000 0x4080b144 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x4080b144 - _heap_start at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 4080b020: 0x00000000 0x00020008 0x00000000 0x00000000 0x00000000 0x00000000 0x4080b018 0x420e1aa8 0x00000000 - at ??:?? 0x00020008 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x00000000 - at ??:?? 0x4080b018 - _heap_start at ??:?? 0x420e1aa8 - __sread at /builds/idf/crosstool-NG/.build/riscv32-esp-elf/src/newlib/newlib/libc/stdio/stdio.c:37 ELF file SHA256: 0000000000000000 Rebooting... ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0xc (SW_CPU),boot:0xc (SPI_FAST_FLASH_BOOT) Saved PC:0x4001975a 0x4001975a - wifi_get_target_power at ??:?? SPIWP:0xee mode:DIO, clock div:2 load:0x4086c410,len:0xd48 0x4086c410 - _heap_start at ??:?? load:0x4086e610,len:0x2d68 0x4086e610 - _heap_start at ??:?? load:0x40875720,len:0x1800 0x40875720 - _heap_start at ??:?? SHA-256 comparison failed: Calculated: 377c26481ad6ab0cce508450f353a55f4bd7eb9159aaf85fde3111071f164514 Expected: 0af544a033ab3492852b8232c904c578d5f07c9d4a423a64473f060db374ab32 Attempting to boot anyway... entry 0x4086c410 0x4086c410 - _heap_start at ??:?? ```

saethlin commented 1 year ago

The only indication you've provided is saying that "it blows up". What exactly happens?

blue-freedom-technologies commented 1 year ago

Hi,

this is a heap mem or stack mem blowup.

Since I don't know well this crate and its using BTreeMap internally I wonder if this is a heap mem issue.

If it is a stack mem I am able to mitigate using ThreadBuilder.

So, seeking more advise about this problem.

Patryk27 commented 1 year ago

Maybe you're running out of memory (heap / stack)?

blue-freedom-technologies commented 1 year ago

Hi,

in a embedded system we are always running out of memory.

Our problem is, if it is a stack memory issue we just wrap that code with a ThreadBuilder and use a stack guard together with a memory allocator. Managing the stack in this way.

But if it is a heap memory problem we normally have to use the faithful dhat.

So, is this best approach ? Do anyone know any better ways(or tools) of solving this heap memory issues for rust embedded systems ?