pschatzmann / arduino-audio-tools

Arduino Audio Tools (a powerful Audio library not only for Arduino)
GNU General Public License v3.0
1.27k stars 199 forks source link

Infinite loop in CodecMP3Helix.h #1413

Closed DMXRoid closed 3 months ago

DMXRoid commented 3 months ago

Problem Description

When using the MP3Helix library to decode, an infinite loop appears to exist in the addNotifyAudioChange function on line 123, which leads to a core dump. Commenting out the recursive call alleviates this problem, as does using the version prior to the most recent commit.

`[D] CodecMP3Helix.h : 122 - virtual void audio_tools::MP3DecoderHelix::addNotifyAudioChange(audio_tools::AudioInfoSupport&) [D] CodecMP3Helix.h : 122 - virtual void audio_tools::MP3DecoderHelix::addNotifyAudioChange(audio_tools::AudioInfoSupport&) [D] CodecMP3Helix.h : 122 - virtual void audio_tools::MP3DecoderHelix::addNotifyAudioChange(audio_tools::AudioInfoSupport&) [D] CodecMP3Helix.h : 122 - virtual void audio_tools::MP3DecoderHelix::addNotifyAudioChange(audio_tools::AudioInfoSupport&)

[ repeat a few thousand times ]

[D] CodecMP3Helix.h : 12Guru Meditation Error: Core 1 panic'ed (Unhandled debug exception). Debug exception reason: Stack canary watchpoint triggered (loopTask) Core 1 register dump: PC : 0x40084c88 PS : 0x00060b36 A0 : 0x3ffcbad0 A1 : 0x3ffcba10
A2 : 0x00000001 A3 : 0xffffffff A4 : 0x3ffbb438 A5 : 0x3ffbb3fc
A6 : 0x3ffbb410 A7 : 0x00000000 A8 : 0x80083788 A9 : 0x3ffcbab0
A10 : 0x3ff000e0 A11 : 0x00000001 A12 : 0x3ffbdfb8 A13 : 0x00060b23
A14 : 0x00060b23 A15 : 0x00000000 SAR : 0x0000001b EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000 LBEG : 0x4008abb1 LEND : 0x4008abc1 LCOUNT : 0xfffffffe `

Device Description

ESP32 WROOM

Sketch

https://github.com/DMXRoid/gbhq-controller/blob/main/audio.cpp

Other Steps to Reproduce

No response

What is your development environment

Arduino IDE on Ubuntu

I have checked existing issues, discussions and online documentation

pschatzmann commented 3 months ago

This has already been corrected. Thanks for the feed back

see https://github.com/pschatzmann/arduino-audio-tools/discussions/1412