关于存在一个未初始化指针的问题

bhcgdxtx
Posts: 5
Joined: Thu Sep 25, 2025 1:12 pm

关于存在一个未初始化指针的问题

Postby bhcgdxtx » Tue Oct 21, 2025 4:42 pm

我在使用主机模式的堆跟踪的时候,会出现一个报错,分析得到的原因是使用了一个未初始化的指针,但是我已经正确在初始化中加入了对应语句,请问如何解决这个问题,下面是堆跟踪的日志
ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0x30f (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1
load:0x4ff33ce0,len:0x17a4
load:0x4ff29ed0,len:0xf28
load:0x4ff2cbd0,len:0x3454
entry 0x4ff29eda
I (25) boot: ESP-IDF HEAD-HASH-NOTFOUND 2nd stage bootloader
I (26) boot: compile time Oct 21 2025 11:30:28
I (26) boot: Multicore bootloader
I (28) boot: chip revision: v1.0
I (30) boot: efuse block revision: v0.3
I (33) qio_mode: Enabling default flash chip QIO
I (38) boot.esp32p4: SPI Speed : 80MHz
I (41) boot.esp32p4: SPI Mode : QIO
I (45) boot.esp32p4: SPI Flash Size : 4MB
I (49) boot: Enabling RNG early entropy source...
I (53) boot: Partition Table:
I (56) boot: ## Label Usage Type ST Offset Length
I (62) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (69) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (75) boot: 2 factory factory app 00 00 00010000 00180000
I (83) boot: End of partition table
I (85) esp_image: segment 0: paddr=00010020 vaddr=40030020 size=5735ch (357212) map
I (148) esp_image: segment 1: paddr=00067384 vaddr=30100000 size=0005ch ( 92) load
I (150) esp_image: segment 2: paddr=000673e8 vaddr=4ff00000 size=08c30h ( 35888) load
I (160) esp_image: segment 3: paddr=00070020 vaddr=40000020 size=28e7ch (167548) map
I (187) esp_image: segment 4: paddr=00098ea4 vaddr=4ff08c30 size=08b04h ( 35588) load
I (196) esp_image: segment 5: paddr=000a19b0 vaddr=4ff11780 size=023f4h ( 9204) load
I (203) boot: Loaded app from partition at offset 0x10000
I (203) boot: Disabling RNG early entropy source...
I (213) cpu_start: Multicore app
I (222) cpu_start: Pro cpu start user code
I (222) cpu_start: cpu freq: 360000000 Hz
I (222) app_init: Application information:
I (223) app_init: Project name: person_detection
I (227) app_init: App version: d32e912-dirty
I (231) app_init: Compile time: Oct 21 2025 11:30:16
I (236) app_init: ELF file SHA256: cd59cc44a...
I (241) app_init: ESP-IDF: HEAD-HASH-NOTFOUND
I (246) efuse_init: Min chip rev: v0.1
I (249) efuse_init: Max chip rev: v1.99
I (253) efuse_init: Chip rev: v1.0
I (257) heap_init: Initializing. RAM available for dynamic allocation:
I (264) heap_init: At 4FF1DE70 len 0001D150 (116 KiB): RAM
I (269) heap_init: At 4FF3AFC0 len 00004BF0 (18 KiB): RAM
I (274) heap_init: At 4FF40000 len 00060000 (384 KiB): RAM
I (279) heap_init: At 50108080 len 00007F80 (31 KiB): RTCRAM
I (284) heap_init: At 3010005C len 00001FA4 (7 KiB): TCM
Guru Meditation Error: Core 0 panic'ed (Load access fault). Exception was unhandled.

Core 0 register dump:
MEPC : 0x4fc055dc RA : 0x4ff0250e SP : 0x4ff3c870 GP : 0x4ff11f80
--- 0x4fc055dc: systimer_hal_connect_alarm_counter in ROM
--- 0x4ff0250e: esp_timer_impl_get_time at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_timer/src/esp_timer_impl_systimer.c:72
TP : 0x00000000 T0 : 0x00000000 T1 : 0x00001806 T2 : 0xb33fffff
S0/FP : 0x00000000 S1 : 0x00000000 A0 : 0x4ff14c8c A1 : 0x00000000
A2 : 0x00000000 A3 : 0x00000001 A4 : 0x00000000 A5 : 0x00000000
A6 : 0x4ff1e208 A7 : 0x00000000 S2 : 0x00000001 S3 : 0x00000001
S4 : 0x0000002f S5 : 0x00000005 S6 : 0x4ff3c940 S7 : 0x4ff1e1e0
S8 : 0x4003169c S9 : 0x000000c8 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x00010000 T4 : 0x4003169c T5 : 0x00000000 T6 : 0x50108080
MSTATUS : 0x00001880 MTVEC : 0x4ff00003 MCAUSE : 0x00000005 MTVAL : 0x00000004
--- 0x4ff00003: _vector_table at ??:?
MHARTID : 0x00000000

Stack memory:
4ff3c870: 0xffffffff 0x00000038 0x00000001 0x4ff04b70 0x95911e21 0x58c6a5b0 0x00000000 0x00000030
--- 0x4ff04b70: esp_apptrace_tmo_init at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/app_trace/include/esp_app_trace_util.h:39
--- (inlined by) SEGGER_SYSVIEW_X_SysView_Lock at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/app_trace/sys_view/Sample/FreeRTOSV10.4/Config/esp/SEGGER_SYSVIEW_Config_FreeRTOS.c:273
4ff3c890: 0x34410037 0x43353000 0x0352a800 0x4ff3c940 0x4ff3c940 0x00000005 0x00000001 0x4ff042c2
--- 0x4ff042c2: SEGGER_SYSVIEW_RecordU32x3 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/app_trace/sys_view/SEGGER/SEGGER_SYSVIEW.c:1577
4ff3c8b0: 0x4ff13cec 0x00000001 0x0010180e 0x00000001 0x00000001 0x00000000 0x4ff13c98 0x4ff0819a
--- 0x4ff0819a: prvInitialiseNewQueue at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/freertos/FreeRTOS-Kernel/queue.c:626
4ff3c8d0: 0x4ff3c940 0x00000004 0x00000004 0x4ff1e1dc 0x000000d0 0x4ff3c940 0x4ff13c98 0x4ff081dc
--- 0x4ff081dc: xQueueGenericCreateStatic at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/freertos/FreeRTOS-Kernel/queue.c:461
4ff3c8f0: 0x00000000 0x30100070 0x3010005c 0x0000005c 0x00001f90 0x30100070 0x4ff3cb20 0x4ff085a0
--- 0x4ff085a0: xQueueCreateMutexStatic at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/freertos/FreeRTOS-Kernel/queue.c:690
4ff3c910: 0x00000005 0x00001f90 0x4ff3cb20 0x4ff01452 0x00000000 0x000000cc 0x
--- 0x4ff01452: heap_caps_update_per_task_info_alloc at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/heap/heap_task_info.c:272
4ff1e1dc 0x00000005
4ff3c930: 0x4ff1e280 0x4ff3c940 0x4ff3cb20 0x40002b88 0x40031690 0x0010180e 0x00000000 0x00000000
--- 0x40002b88: heap_caps_init at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/heap/heap_caps_init.c:216
4ff3c950: 0x4ff1de70 0x4ff3afc0 0xb33fffff 0x00000000 0x4ff1de70 0x00000000 0x40031690 0x0010180e
4ff3c970: 0x00000000 0x00000000 0x4ff3afc0 0x4ff3fbb0 0xb33fffff 0x00000000 0x00000000 0x00000000
4ff3c990: 0x40031690 0x0010180e 0x00000000 0x00000000 0x4ff40000 0x4ffa0000 0xb33fffff 0x00000000
4ff3c9b0: 0x00000000 0x00000000 0x400316a0 0x00008000 0x00000000 0x00001806 0x50108080 0x50110000
4ff3c9d0: 0xb33fffff 0x00000000 0x50108080 0x00000000 0x4003169c 0x00010000 0x00001806 0x00000000
4ff3c9f0: 0x3010005c 0x30102000 0xb33fffff 0x00000000 0x3010005c 0x00000000 0x4ff3cb20 0x400027c2
--- 0x400027c2: heap_caps_init at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/heap/heap_caps_init.c:107
4ff3ca10: 0x4ff1de70 0x0001d150 0x00000000 0x4ff00000 0x00000000 0x4ff3afc0 0x00004bf0 0x00000000
--- 0x4ff00000: _vector_table at ??:?
4ff3ca30: 0x4ff3afc0 0x00000001 0x4ff40000 0x00060000 0x00000000 0x4ff3afc0 0x00000001 0x50108080
4ff3ca50: 0x00007f80 0x00000003 0x00000000 0x00000000 0x3010005c 0x00001fa4 0x00000002 0x00000000
4ff3ca70: 0x00000000 0x30303030 0x00000030 0x00000000 0x00000000 0x00000000 0x00010020 0x0005735c
4ff3ca90: 0x00010000 0x00028e7c 0x4ff00402 0x00000000 0x00000000 0x00000000 0x00010020 0x0005735c
--- 0x4ff00402: call_start_cpu0 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/port/cpu_start.c:357
4ff3cab0: 0x00010000 0x00028e7c 0x4ff00402 0x00000000 0x00000000 0x00000000 0x00000064 0x4fc0327c
--- 0x4ff00402: call_start_cpu0 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/port/cpu_start.c:357
--- 0x4fc0327c: ets_emsa_pss_verify in ROM
4ff3cad0: 0x00000000 0x00000000 0x00000001 0x40000230 0x00010000 0x000000f1 0x40030120 0x400027ac
--- 0x40000230: __esp_system_init_fn_init_show_app_info at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_app_format/esp_app_desc.c:145
--- 0x400027ac: heap_caps_init at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/heap/heap_caps_init.c:106
4ff3caf0: 0x00000000 0x00000000 0x00010020 0x0005735c 0x00010000 0x00028e7c 0x4ff00402 0x00000000
--- 0x4ff00402: call_start_cpu0 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/port/cpu_start.c:357
4ff3cb10: 0x00000000 0x00000000 0x400872e4 0x40002bb2 0x40030020 0x00000001 0x400872dc 0x400019a0
--- 0x40002bb2: __esp_system_init_fn_init_heap at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/heap/heap_caps_init.c:29
--- 0x400019a0: do_system_init_fn at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/startup.c:132
4ff3cb30: 0x00010000 0x00028e7c 0x00000000 0x00070020 0x40030020 0x00000001 0x00300000 0x400019fe
--- 0x400019fe: do_core_init at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/startup.c:171
4ff3cb50: 0x40030020 0x00000001 0x00300000 0x40001a5e 0x40030020 0x00000001 0x02625a00 0x4ff00722
--- 0x40001a5e: start_cpu0_default at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/startup.c:206
--- 0x4ff00722: call_start_cpu0 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/port/cpu_start.c:837
4ff3cb70: 0x4ff3cc64 0x4ff33bd4 0x00000000 0x01f3cb94 0x2f0206e9 0x4ff00402 0x000000ee 0x01000012
--- 0x4ff00402: call_start_cpu0 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/port/cpu_start.c:357
4ff3cb90: 0x0000c700 0x01000000 0x00000001 0x00000001 0x40030020 0x40000020 0xffff0000 0x4ff2e0ae
--- 0x40000020: esp_app_format_init_elf_sha256 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_app_format/esp_app_desc.c:88
4ff3cbb0: 0xbda964fe 0xf687d051 0x3fedace0 0x00010000 0x0aa07103 0x00030000 0x00010020 0x00070020
4ff3cbd0: 0x40030020 0x40000020 0x0005735c 0x00028e7c 0x00007b60 0x000000cb 0x00000000 0x4ff40000
--- 0x40000020: esp_app_format_init_elf_sha256 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_app_format/esp_app_desc.c:88
4ff3cbf0: 0x00007b60 0x4fc1da4c 0x0000ffff 0xffffffff 0xffffffff 0x4ff3cd50 0xffffffff 0x4ff2e6b4
4ff3cc10: 0x00010000 0x00180000 0x00010000 0x2f0206e9 0x4ff00402 0x000000ee 0x01000012 0x0000c700
--- 0x4ff00402: call_start_cpu0 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_system/port/cpu_start.c:357
4ff3cc30: 0x01000000 0x40030020 0x0005735c 0x30100000 0x0000005c 0x4ff00000 0x00008c30 0x40000020
--- 0x30100000: PMU_instance at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_hw_support/port/esp32p4/pmu_init.c:44
--- 0x4ff00000: _vector_table at ??:?
--- 0x40000020: esp_app_format_init_elf_sha256 at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/esp_app_format/esp_app_desc.c:88
4ff3cc50: 0x00028e7c 0x4ff08c30 0x00008b04 0x4ff11780 0x000023f4 0x00000000 0x00000000 0x00000000
--- 0x4ff08c30: rv_utils_restore_intlevel_regval at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/riscv/include/esp_private/interrupt_clic.h:195
--- (inlined by) rv_utils_set_intlevel_regval at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/riscv/include/esp_private/interrupt_clic.h:235
--- (inlined by) xPortSetInterruptMaskFromISR at D:/Applications/Espressif/frameworks/esp-idf-v5.5/components/freertos/FreeRTOS-Kernel/portable/riscv/port.c:490



ELF file SHA256: cd59cc44a

Who is online

Users browsing this forum: No registered users and 3 guests