f4exb / sdrangel

SDR Rx/Tx software for Airspy, Airspy HF+, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay and FunCube
GNU General Public License v3.0
2.91k stars 441 forks source link

NFM demod: crash on close #680

Closed f4exb closed 3 years ago

f4exb commented 3 years ago

On latest from master

...
2020-11-01 07:47:43.226 (D) MessageQueue::~MessageQueue: message:  NFMDemodBaseband::MsgConfigureNFMDemodBaseband  was still in queue
free(): invalid pointer
Aborted (core dumped)
f4exb commented 3 years ago

Backtrace:

#1  0x00007f2db85ef859 in __GI_abort () at abort.c:79
#2  0x00007f2db865a3ee in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7f2db8784285 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#3  0x00007f2db866247c in malloc_printerr (str=str@entry=0x7f2db87824ae "free(): invalid pointer") at malloc.c:5347
#4  0x00007f2db8663cac in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:4173
#5  0x00007f2db9e071c1 in CTCSSDetector::~CTCSSDetector() (this=0x55c84a4c2f08, __in_chrg=<optimized out>) at /opt/build/sdrangel/sdrbase/dsp/ctcssdetector.cpp:55
#6  0x00007f2d8a88b56c in NFMDemodSink::~NFMDemodSink() (this=0x55c84a4c2d30, __in_chrg=<optimized out>) at /opt/build/sdrangel/plugins/channelrx/demodnfm/nfmdemodsink.cpp:66
#7  0x00007f2d8a890860 in NFMDemodBaseband::~NFMDemodBaseband() (this=0x55c84a4c2cc0, __in_chrg=<optimized out>) at /opt/build/sdrangel/plugins/channelrx/demodnfm/nfmdemodbaseband.cpp:49
#8  0x00007f2d8a8908a0 in NFMDemodBaseband::~NFMDemodBaseband() (this=0x55c84a4c2cc0, __in_chrg=<optimized out>) at /opt/build/sdrangel/plugins/channelrx/demodnfm/nfmdemodbaseband.cpp:53
#9  0x00007f2d8a883981 in NFMDemod::~NFMDemod() (this=0x55c84a4a7780, __in_chrg=<optimized out>) at /opt/build/sdrangel/plugins/channelrx/demodnfm/nfmdemod.cpp:78
#10 0x00007f2d8a883a10 in NFMDemod::~NFMDemod() (this=0x55c84a4a7780, __in_chrg=<optimized out>) at /opt/build/sdrangel/plugins/channelrx/demodnfm/nfmdemod.cpp:80
#11 0x00007f2d8a882344 in NFMDemod::destroy() (this=0x55c84a4a7780) at /opt/build/sdrangel/plugins/channelrx/demodnfm/nfmdemod.h:66
f4exb commented 3 years ago

Problem found: the toneSet used to be built in the class but it is not anymore since #664. It is now a static array defined in CTCSSFrequencies. The delete of this array was left over in the destructor.

f4exb commented 3 years ago

Implemented in v4.21.1 and 5.15.1