cool tech zone zone
How to diagnose crashes? - Printable Version

+- cool tech zone zone (https://forum.cooltech.zone)
+-- Forum: Tangara (https://forum.cooltech.zone/forumdisplay.php?fid=3)
+--- Forum: Firmware Development (https://forum.cooltech.zone/forumdisplay.php?fid=7)
+--- Thread: How to diagnose crashes? (/showthread.php?tid=80)



How to diagnose crashes? - ticky - 2024-12-19

I've been enjoying using my Tangara since I got it the other day, thank you for all your hard work!

I've encountered a couple of crashes in my time using it, and I'm wondering what the best way is to tell what's gone wrong, and supply you with crash information to help improve the firmware over time?


RE: How to diagnose crashes? - jacqueline - 2024-12-20

Hi! Glad you're enjoying your device!!

If you have consistent repro steps, then sharing those is usually enough for us to dig in. Otherwise, you *can* get stacktraces off the device, but it currently requires you to be running a dev build + have `idf.py monitor` running and connected to the device at the time of the crash. If this is the case, you'll get a full stacktrace showing the point of the crash. These are very very helpful!!


RE: How to diagnose crashes? - ticky - 2024-12-20

Nothing particularly consistent, just having loaded my music onto my device (chiefly converted to opus format using beets as the majority of my library is in AAC or ALAC) I have pretty frequent crashes when playing back via Bluetooth. It's not consistent but it seems most correlated with loading the next track. I'll see if they still happen while listening via the headphone jack later.


RE: How to diagnose crashes? - ticky - 2024-12-20

Code:
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x4008b6f9  PS      : 0x00060931  A0      : 0x8008c520  A1      : 0x3ffbf620
--- 0x4008b6f9: bg_exit_core at /Users/ticky/Developer/tangara-fw/lib/esp-idf/components/esp_hw_support/spi_bus_lock.c:548
(inlined by) spi_bus_lock_bg_exit at /Users/ticky/Developer/tangara-fw/lib/esp-idf/components/esp_hw_support/spi_bus_lock.c:778

A2      : 0x00000000  A3      : 0x00000000  A4      : 0x3ffbf658  A5      : 0x00000000
A6      : 0x3ffdc16c  A7      : 0x3ffdc16c  A8      : 0x00000000  A9      : 0x00000000
A10     : 0x00000000  A11     : 0xfffffbff  A12     : 0x00000005  A13     : 0x00060923
A14     : 0x00000001  A15     : 0x3ffdc16c  SAR     : 0x0000000e  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000008  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff
--- 0x4000c2e0: memcpy in ROM
0x4000c2f6: memcpy in ROM



Backtrace: 0x4008b6f6:0x3ffbf620 0x4008c51d:0x3ffbf640 0x40089a59:0x3ffbf680 0x40162a49:0x3ffcde20 0x40160dda:0x3ffcde80 0x4016224e:0x3ffcee00 0x4015e1e9:0x3ffcf1d0 0x4015eb77:0x3ffcf2a0 0x4015f18e:0x3ffcf360 0x4015f2b7:0x3ffd0340 0x401590e5:0x3ffd0370 0x4015b3be:0x3ffd03a0 0x4015b546:0x3ffd03f0 0x4015ccc5:0x3ffd0420 0x401422e6:0x3ffd0440 0x400fcfbe:0x3ffd0480 0x4008480d:0x3ffd04c0 0x400fdcb1:0x3ffd0500 0x401d6a3f:0x3ffd0520
--- 0x4008b6f6: bg_exit_core at /Users/ticky/Developer/tangara-fw/lib/esp-idf/components/esp_hw_support/spi_bus_lock.c:548
(inlined by) spi_bus_lock_bg_exit at /Users/ticky/Developer/tangara-fw/lib/esp-idf/components/esp_hw_support/spi_bus_lock.c:778
0x4008c51d: spi_intr at /Users/ticky/Developer/tangara-fw/lib/esp-idf/components/esp_driver_spi/src/gpspi/spi_master.c:1015
0x40089a59: _xt_lowint1 at /Users/ticky/Developer/tangara-fw/lib/esp-idf/components/xtensa/xtensa_vectors.S:1240
0x40162a49: clt_mdct_backward_c at /Users/ticky/Developer/tangara-fw/lib/opus/celt/mdct.c:272
0x40160dda: celt_synthesis at /Users/ticky/Developer/tangara-fw/lib/opus/celt/celt_decoder.c:435
0x4016224e: celt_decode_with_ec at /Users/ticky/Developer/tangara-fw/lib/opus/celt/celt_decoder.c:1113
0x4015e1e9: opus_decode_frame at /Users/ticky/Developer/tangara-fw/lib/opus/src/opus_decoder.c:524 (discriminator 4)
0x4015eb77: opus_decode_native at /Users/ticky/Developer/tangara-fw/lib/opus/src/opus_decoder.c:730
0x4015f18e: opus_multistream_decode_native at /Users/ticky/Developer/tangara-fw/lib/opus/src/opus_multistream_decoder.c:253
0x4015f2b7: opus_multistream_decode at /Users/ticky/Developer/tangara-fw/lib/opus/src/opus_multistream_decoder.c:383
0x401590e5: op_decode at /Users/ticky/Developer/tangara-fw/lib/opusfile/src/opusfile.c:2792
0x4015b3be: op_read_native at /Users/ticky/Developer/tangara-fw/lib/opusfile/src/opusfile.c:2875
0x4015b546: op_read_native at /Users/ticky/Developer/tangara-fw/lib/opusfile/src/opusfile.c:2811 (discriminator 1)
(inlined by) op_filter_read_native at /Users/ticky/Developer/tangara-fw/lib/opusfile/src/opusfile.c:2941 (discriminator 1)
0x4015ccc5: op_read_stereo at /Users/ticky/Developer/tangara-fw/lib/opusfile/src/opusfile.c:3076
0x401422e6: codecs::XiphOpusDecoder::DecodeTo(std::span<short, 4294967295u>) at /Users/ticky/Developer/tangara-fw/src/codecs/opus.cpp:145 (discriminator 2)
0x400fcfbe: audio::Decoder::continueDecode() at /Users/ticky/Developer/tangara-fw/src/tangara/audio/audio_decoder.cpp:196 (discriminator 1)
0x4008480d: audio::Decoder::Main() at /Users/ticky/Developer/tangara-fw/src/tangara/audio/audio_decoder.cpp:121
0x400fdcb1: std::_Function_handler<void (), audio::Decoder::Start(std::shared_ptr<audio::SampleProcessor>)::{lambda()#1}>::_M_invoke(std::_Any_data const&) at /Users/ticky/Developer/tangara-fw/src/tangara/audio/audio_decoder.cpp:55
(inlined by) __invoke_impl<void, audio::Decoder::Start(std::shared_ptr<audio::SampleProcessor>)::<lambda()>&> at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/invoke.h:61
(inlined by) __invoke_r<void, audio::Decoder::Start(std::shared_ptr<audio::SampleProcessor>)::<lambda()>&> at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/invoke.h:111
(inlined by) _M_invoke at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/std_function.h:290
0x401d6a3f: std::function<void ()>::operator()() const at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/std_function.h:591
(inlined by) void std::__invoke_impl<void, std::function<void ()>&>(std::__invoke_other, std::function<void ()>&) at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/invoke.h:61
(inlined by) std::__invoke_result<std::function<void ()>&>::type std::__invoke<std::function<void ()>&>(std::function<void ()>&) at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/bits/invoke.h:96
(inlined by) std::invoke_result<std::function<void ()>&>::type std::invoke<std::function<void ()>&>(std::function<void ()>&) at /Users/ticky/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/xtensa-esp-elf/include/c++/13.2.0/functional:113
(inlined by) tasks::PersistentMain(void*) at /Users/ticky/Developer/tangara-fw/src/tasks/tasks.cpp:110

Okay, I’ve reproduced it with a local build and with monitor running, I hope this is useful!