drowe67 / freedv-gui

GUI Application for FreeDV – open source digital voice for HF radio
https://freedv.org/
GNU Lesser General Public License v2.1
193 stars 49 forks source link

Hamlib-4.6~git change appears to trigger a segfault in lpcnet code #736

Closed Tyrbiter closed 1 month ago

Tyrbiter commented 1 month ago

The details can be found here, but it doesn't make any sense to me:

https://github.com/Hamlib/Hamlib/commit/df48595add88d2fc6ee3ded71eaa6cb70db45efd

Running under gdb a freedv thread segfaults, presumably when the modem first sees a potential 2020B mode sync, it takes a minute or two on receive but reliably fails in a short period:

Thread 20 "FreeDV PS" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffc0c006c0 (LWP 64889)] 0x00007ffff520aade in quant_pred_output (vec_out=0x555556048038, indexes=, err=0x7fffc0bfab70, pred=, num_stages=, vq=0x7ffff5dfc800 , k=18) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:243 243 err[i] -= vq[skMAX_ENTRIES+ind*k+i];

I have not seen this happen until recently when 2 unrelated changes in Hamlib-4.6~git appear to have triggered it.

Any thoughts on what is happening would be appreciated.

Tyrbiter commented 1 month ago

Commenting lpcnet_quant.c:243 results in a similar segfault at line 244 with k=18

Could this be something to do with buffer overflow or heap exhaustion? It seems to be triggered by changes in Hamlib-4.6~git which is linked in as a .so as is the lpcnet shared object.

I'm way out of my depth here.

Maybe @drowe67 could comment on what is happening in the lpcnet code.

tmiw commented 1 month ago

Are you able to compile FreeDV with libasan enabled (-fsanitize=address) to confirm that it's actually LPCNet or freedv-gui causing the issue?

Tyrbiter commented 1 month ago

Are you able to compile FreeDV with libasan enabled (-fsanitize=address) to confirm that it's actually LPCNet or freedv-gui causing the issue?

I expect I can, but I've forgotten how I did it previously.

Can I just add a -Dfsanitize=address into the cmake commands in my .spec file?

barjac commented 1 month ago

Are you able to compile FreeDV with libasan enabled (-fsanitize=address) to confirm that it's actually LPCNet or freedv-gui causing the issue?

I expect I can, but I've forgotten how I did it previously.

Can I just add a -Dfsanitize=address into the cmake commands in my .spec file?

Here is my testing spec for Mageia which has the option to add libasan and enable it, you can steal the relevant bits :)

%define dtegit  202407160907-86e9e
%define dte     %(echo %{dtegit}|cut -d- -f1)
%define git     %(echo %{dtegit}|cut -d- -f2)
#define asan    1

%define rel     1
Name:           freedv
Version:        1.9.10
Release:        %mkrel %{?dtegit:-c %{dte}.%{git}} %{rel}
Summary:        Digital Voice for Amateur Radio
Group:          Communications/Radio
License:        LGPLv2+
URL:            https://freedv.org/
# http://files.freedv.org/freedv
# https://groups.google.com/forum/#!forum/digitalvoice
Source0:        freedv-%{version}%{?dtegit:-%{dte}-%{git}}.tar.gz
Source1:        %{name}48x48.png
Source2:        %{name}64x64.png
Source3:        %{name}128x128.png
Source4:        %{name}256x256.png
Source5:        mk-tar

BuildRequires:  cmake
BuildRequires:  desktop-file-utils
BuildRequires:  git-core
%if %{mgaver} < 10
BuildRequires:  libsioclient-devel
BuildRequires:  lpcnetfreedv-devel
BuildRequires:  pkgconfig(codec2)
BuildRequires:  pkgconfig(hamlib)
%else
BuildRequires:  libsioclient-devel >= 3.1.0.1
BuildRequires:  lpcnetfreedv-devel >= 0.5
BuildRequires:  pkgconfig(codec2) >= 1.2
BuildRequires:  pkgconfig(hamlib) >= 4.6
%endif
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(samplerate)
BuildRequires:  pkgconfig(sndfile)
BuildRequires:  pkgconfig(sox)
BuildRequires:  pkgconfig(speex)
BuildRequires:  pkgconfig(speexdsp)
BuildRequires:  wxgtku3.2-devel >= 3.2

%if %{defined asan}
BuildRequires:  libasan-devel
%endif

Recommends:     hamlib-utils >= 4.6

%description
FreeDV is a GUI application that allows any SSB radio to
be used for low bit rate digital voice.

Speech is compressed down to 1400 bit/s then modulated onto a 1100 Hz wide QPSK
signal which is sent to the Mic input of a SSB radio. On receive, the signal is
received by the SSB radio, then demodulated and decoded by FreeDV.

FreeDV was built by an international team of Radio Amateurs working together on
coding, design, user interface and testing. FreeDV is open source software,
released under the GNU Public License version 2.1. The FDMDV modem and Codec 2
Speech codec used in FreeDV are also open source.

%prep
%autosetup -p1 -n %{name}-%{version}-%{dte}-%{git}

#-Sgit_am

%build
%if %{defined asan}
CXXFLAGS="${CXXFLAGS:-%optflags -fsanitize=address}"
export CXXFLAGS
%endif

%cmake \
  -DUSE_PULSEAUDIO=1 \
  -DUSE_STATIC_CODEC2=FALSE \
  -DUSE_STATIC_SPEEXDSP=FALSE \
  -DCMAKE_VERBOSE_MAKEFILE=on \
%if %{defined git}
  -DFREEDV_VERSION_TAG="%{git}"
%endif

#  -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=TRUE \

%cmake_build

%install
%cmake_install

# Tweak upstream desktop file
desktop-file-install \
    --dir=%{buildroot}%{_datadir}/applications \
    --remove-category='GTK' \
    --remove-category='GNOME' \
    --add-category='X-Mageia-CrossDesktop' \
    %{buildroot}%{_datadir}/applications/%{name}.desktop

desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop

%post
# Don't allow gpsd to grab /dev/ttyUSB0 for generic uarts used by hamlib.
sed -i 's:USBAUTO="true":USBAUTO="false":' /etc/sysconfig/gpsd ||:

%files
%doc README.md USER_MANUAL.md
%license COPYING
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}-gui/
%{_iconsdir}/hicolor/*/apps/%{name}.png
Tyrbiter commented 1 month ago

Thanks @barjac I will hack something together but it's not going to be this evening @tmiw

I will get back to you tomorrow some time.

tmiw commented 1 month ago

Thanks @barjac I will hack something together but it's not going to be this evening @tmiw

I will get back to you tomorrow some time.

No worries. If it helps, I typically just edit my top-level CMakeCache.txt file to add it in the appropriate CFLAGS/LDFLAGS/CXXFLAGS locations and then run make.

Tyrbiter commented 1 month ago

Finally managed to get libasan to link, who put that extra comma there :-/

Here is the relevant gdb output:

2:rig.c(2413):rig_get_freq entered rig_get_freq called vfo=VFOA rig_get_freq(2431) called vfo=VFOA rig.c(2440) vfo=VFOA, curr_vfo=VFOA rig_get_freq(2553): vfo_opt=0, model=2041 **3:kenwood.c(2051):kenwood_get_freq entered kenwood_safe_transaction called, cmd=FA, expected=13 kenwood_transaction called cmd=FA kenwood.c(689):kenwood_transaction returning2(0) kenwood.c(767):kenwood_safe_transaction returning2(0) 3:kenwood.c(2121):kenwood_get_freq returning(0) rig_get_band called 2:rig_get_freq: elapsed=5ms 2:rig.c(2690):rig_get_freq returning(0) unpack_frame Got a frame that was too small (<5) to be valid

This unpack_frame debug output is from rigs/commradio/frame.c I don't have one, TS-890 is definitely selected.

Thread 20 "FreeDV PS" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffc0e006c0 (LWP 405864)] 0x00007ffff4c0aade in quant_pred_output (vec_out=0x517000440c38, indexes=, err=0x7fffc0dfa2b0, pred=, num_stages=, vq=0x7ffff57fc800 , k=18) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:243 243 err[i] -= vq[skMAX_ENTRIES+ind*k+i]; Missing separate debuginfos, use: dnf debuginfo-install gdk-pixbuf2-2.42.11-2.fc40.x86_64 libasan-14.2.1-1.fc40.x86_64 (gdb) thread apply all bt full

Here is the segfaulting thread stack frame.

Thread 20 (Thread 0x7fffc0e006c0 (LWP 405864) "FreeDV PS"):

0 0x00007ffff4c0aade in quant_pred_output (vec_out=0x517000440c38, indexes=, err=0x7fffc0dfa2b0, pred=, num_stages=, vq=0x7ffff57fc800 , k=18) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:243

    s = <optimized out>
    i = <optimized out>
    ind = 1172081112
    se2 = <optimized out>

1 0x00007ffff4c0bb95 in lpcnet_frame_to_features (q=q@entry=0x517000440c00, frame=frame@entry=0x50e0002b0f80 "", features_out=features_out@entry=0x7fffc0dfa490) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:420

    i = 0
    d = <optimized out>
    pitch_ind = 1179223652
    pitch_gain_ind = 1185009739
    indexes = {1177486437, 1172081112, 1179553003, 1174889743, 1177768979}
    fract = <optimized out>
    err = {0 <repeats 18 times>}

2 0x00007ffff4c0f6bd in lpcnet_dec (lf=, frame=0x50e0002b0f80 "", pcm=, pcm@entry=0x7fffc0dfdc80) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_freedv.c:66

    d = <optimized out>
    q = 0x517000440c00
    net = 0x521000625d00
    in_features = {0 <repeats 55 times>}
    features = {10903.0215, 11724.2812, 8498.01367, 11072.6309, 11109.2549, 2639.72119, 20896.6992, 20712.1465, 11201.0986, 7057.23047, 7375.76465, 13219.2295, 8665.26465, 11477.0186, 17353.9434, 7218.98047, 6651.71924, 13920.5977, 15806.7617, 5417.88428, 11138.1582, 9957.25684, 1.66913953e+13, 3.0611365e-41, 249.300598, 1321.38843, 7578.15918, -10322.8242, -18166.1328, -4817.76123, -2218.25781, -682.046631, 1799.21289, -20889.1348, -16178.9697, 5175.43311, -17700.2266, 5931.91016, -163.156372, -4777.69385, 12707.0234, 3019.51709, 169.112732, 1687.13452, -8420.45898, 23413.873, -16543.5801, -9289.46484, -14672.5342, -4920.56348, -12527.6113, -18274.416, 15885.374, 14463.1621, 11385.5068}

3 0x00007ffff76e1abc in freedv_bits_to_speech (f=f@entry=0x7fffdd5de800, speech_out=speech_out@entry=0x7fffc0dfdc80, demod_in=demod_in@entry=0x7fffc0dfa640, rx_status=14) at /usr/src/debug/codec2-1.2.0-4.fc40.x86_64/src/freedv_api.c:957

    i = <optimized out>
    bits_per_codec_frame = 52
    data_bits_per_frame = <optimized out>
    frames = 3
    nout = 1440
    decode_speech = <optimized out>

4 0x00007ffff76e5e92 in freedv_comprx (f=0x7fffdd5de800, speech_out=0x7fffc0dfdc80, demod_in=0x7fffc0dfac40) at /usr/src/debug/codec2-1.2.0-4.fc40.x86_64/src/freedv_api.c:824

    rx_status = <optimized out>
    demod_in_short = 0x7fffc0dfa640

5 0x0000555555732c95 in FreeDVReceiveStep::execute (this=0x5040001d6d50, inputSamples=Python Exception <class 'gdb.error'>: value has been optimized out

, numInputSamples=, numOutputSamples=0x7fffbf378830) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/FreeDVReceiveStep.cpp:100 newOutputSamples = nin = nout = outputSamples = input_buf = 0x7fffc0dfe840 output_buf = 0x0 rx_fdm = 0x7fffc0dfc460 rx_fdm_offset = 0x7fffc0dfac40 inputPtr = 0x51c0004fb11e

6 0x000055555575773e in operator() (__closure=, inSamples=std::shared_ptr (use count 4, weak count 0) = {...}, numSamples=) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:215

    numOutputSamples = <optimized out>
    result = Python Exception <class 'gdb.error'>: value has been optimized out

    step = <optimized out>
    step = <optimized out>
    numOutputSamples = <optimized out>
    result = Python Exception <class 'gdb.error'>: value has been optimized out

7 std::invoke_impl<std::pair<std::sharedptr, int>, ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>&, std::shared_ptr, int> (f=) at /usr/include/c++/14/bits/invoke.h:61

8 std::invoke_r<std::pair<std::sharedptr, int>, ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>&, std::shared_ptr, int> (fn=) at /usr/include/c++/14/bits/invoke.h:139

9 operator() (__closure=) at /usr/include/c++/14/future:1499

    this = <optimized out>
    __args#0 = <optimized out>
    __args#1 = <optimized out>
    this = <optimized out>
    __args#0 = <optimized out>
    __args#1 = <optimized out>

10 std::future_base::_Task_setter<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >::operator() (this=) at /usr/include/c++/14/future:1416

11 std::invoke_impl<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >&> (__f=) at /usr/include/c++/14/bits/invoke.h:61

12 std::invoke_r<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>, std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >&> (__fn=) at /usr/include/c++/14/bits/invoke.h:138

13 std::_Function_handler<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>(), std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> > >::_M_invoke(const std::_Any_data &) (functor=) at /usr/include/c++/14/bits/std_function.h:291

14 0x000055555572e44b in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=) at /usr/include/c++/14/bits/std_function.h:591

15 std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool) (this=, f=, did_set=0x7fffbf409020) at /usr/include/c++/14/future:596

    __res = std::unique_ptr<std::__future_base::_Result_base> = {get() = <optimized out>}

16 0x00007ffff46aba4b in pthread_once_slow (once_control=0x50600095cfe8, init_routine=0x7ffff48e5f60 <std::once_proxy()>) at pthread_once.c:116

    __cancel_routine = 0x7ffff46ab910 <clear_once_control>
    __clframe = {__cancel_routine = 0x7ffff46ab910 <clear_once_control>, __cancel_arg = 0x50600095cfe8, __do_it = 1, __buffer = {__routine = 0x7ffff46ab8d0 <__pthread_cleanup_combined_routine_voidptr>, __arg = 0x7fffc0dff2a0, __canceltype = 0, __prev = 0x0}}
    val = <optimized out>
    newval = <optimized out>

17 0x00007ffff46abab9 in ___pthread_once (once_control=, init_routine=) at pthread_once.c:143

    val = <optimized out>

18 0x00005555558ed0f4 in __gthread_once (once=, func=) at /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:713

19 std::call_once<void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool>(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&) [clone .constprop.0] (once=..., f=@0x7fffbf409160: (void (std::future_base::_State_baseV2::)(class std::__future_base::_State_baseV2 const, class std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter>()> , bool )) 0x55555572e370 <std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool)>) at /usr/include/c++/14/mutex:916

    __e = <optimized out>
    __callable = {____f = <optimized out>, ____args#0 = <optimized out>, ____args#1 = <optimized out>, ____args#2 = <optimized out>}
    __exec = {<No data fields>}

20 0x0000555555753690 in std::future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool) (__ignore_failure=false, this=0x50600095cfd0, __res=...) at /usr/include/c++/14/future:435

    __did_set = <optimized out>
    __did_set = <optimized out>

21 std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run (this=0x50600095cfd0, args#0=..., __args#1=@0x7fffbf409030: 160) at /usr/include/c++/14/future:1501

    __boundfn = {__this = <optimized out>, ____args#0 = <optimized out>, ____args#1 = <optimized out>}
    __boundfn = {__this = <optimized out>, ____args#0 = <optimized out>, ____args#1 = <optimized out>}

22 std::packaged_task<std::pair<std::shared_ptr, int> (std::shared_ptr, int)>::operator()(std::shared_ptr, int) (this=, __args#0=std::shared_ptr (empty) = {...}, __args#1=) at /usr/include/c++/14/future:1635

23 ParallelStep::executeRunnerThread_ (this=, threadState=0x5100000dc840) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:202

    taskEntry = <optimized out>
    lock = {_M_device = <optimized out>, _M_owns = <optimized out>}

24 operator() (__closure=, threadState=0x5100000dc840) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:54

    this = <optimized out>
    this = <optimized out>

25 std::invoke_impl<void, ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> (f=) at /usr/include/c++/14/bits/invoke.h:61

26 std::__invoke<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> (__fn=) at /usr/include/c++/14/bits/invoke.h:96

27 std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> >::_M_invoke<0, 1> (this=) at /usr/include/c++/14/bits/std_thread.h:301

28 std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> >::operator() (this=) at /usr/include/c++/14/bits/std_thread.h:308

29 std::thread::_State_impl<std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> > >::_M_run(void) (this=) at /usr/include/c++/14/bits/std_thread.h:253

30 0x00007ffff48e7564 in std::execute_native_thread_routine (__p=0x503000690250) at ../../../../../libstdc++-v3/src/c++11/thread.cc:104

    __t = std::unique_ptr<std::thread::_State> = {get() = <optimized out>}

31 0x00007ffff785df96 in asan_thread_start(void*) () at /lib64/libasan.so.8

32 0x00007ffff46a66d7 in start_thread (arg=) at pthread_create.c:447

    ret = <optimized out>
    pd = <optimized out>
    out = <optimized out>
    unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736429295296, -5867966474384094011, 140736429295296, -272, 0, 140736485898080, -5867966474371511099, -5868011094373217083}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
    not_first_call = <optimized out>

33 0x00007ffff472a60c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Let me know if you need more information.

tmiw commented 1 month ago

Looks like libasan didn't even fire. I wonder if you need to link it to Codec2, hamlib and LPCNet too, or if it only fires when not running in gdb. Maybe try linking it to the other libraries first and see how that goes?

Tyrbiter commented 1 month ago

OK, will see what I can do, might take a while to get this all set up.

A quick look and I'm struggling to see how to do this, the plan was to build new Fedora rpms with libasan linked in, but it doesn't look simple.

If I use build_linux.sh to create freedv with all the other code linked without using shared objects can I link in libasan easily? I would need to build hamlib git master. I assume it ought to crash in the same manner?

Tyrbiter commented 1 month ago

I added -fsanitize=address to the CMAKE_CXX_FLAGS in CMakeLists.txt and I get a crash in the freedv binary under gdb, similar to before:

2:rig.c(2413):rig_get_freq entered rig_get_freq called vfo=VFOA rig_get_freq(2431) called vfo=VFOA rig.c(2440) vfo=VFOA, curr_vfo=VFOA rig_get_freq(2553): vfo_opt=0, model=2041 **3:kenwood.c(2051):kenwood_get_freq entered kenwood_safe_transaction called, cmd=FA, expected=13 kenwood_transaction called cmd=FA kenwood.c(689):kenwood_transaction returning2(0) kenwood.c(767):kenwood_safe_transaction returning2(0) 3:kenwood.c(2121):kenwood_get_freq returning(0) rig_get_band called 2:rig_get_freq: elapsed=4ms 2:rig.c(2690):rig_get_freq returning(0) unpack_frame Got a frame that was too small (<5) to be valid unpack_frame Got a frame that was too small (<5) to be valid

Thread 20 "FreeDV PS" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffc06006c0 (LWP 105714)] 0x00007ffff4a0d365 in quant_pred_output (vec_out=0x5170004693b8, indexes=, err=0x7fffc05f9ed0, pred=, num_stages=, vq=0x7ffff4cf1360 , k=18) at /home/bdm/git/freedv-gui/LPCNet/src/lpcnet_quant.c:243 243 err[i] -= vq[skMAX_ENTRIES+ind*k+i]; Missing separate debuginfos, use: dnf debuginfo-install gdk-pixbuf2-2.42.11-2.fc40.x86_64 (gdb) thread apply all bt full

then:

Thread 20 (Thread 0x7fffc06006c0 (LWP 105714) "FreeDV PS"):

0 0x00007ffff4a0d365 in quant_pred_output (vec_out=0x5170004693b8, indexes=, err=0x7fffc05f9ed0, pred=, num_stages=, vq=0x7ffff4cf1360 , k=18) at /home/bdm/git/freedv-gui/LPCNet/src/lpcnet_quant.c:243

    s = <optimized out>
    i = <optimized out>
    ind = -1096745708
    se2 = 0

1 0x00007ffff4a0ef73 in lpcnet_frame_to_features (q=q@entry=0x517000469380, frame=frame@entry=0x50e0002dd394 "\001", features_out=features_out@entry=0x7fffc05f9fe0) at /home/bdm/git/freedv-gui/LPCNet/src/lpcnet_quant.c:420

    i = <optimized out>
    d = <optimized out>
    pitch_ind = -1094325538
    pitch_gain_ind = -1104286993
    indexes = {-1096745708, -1092107250, 1059651976, -1086991333, 1065115166}
    fract = <optimized out>
    err = {0 <repeats 18 times>}

2 0x00007ffff4a10fde in lpcnet_dec (lf=, frame=0x50e0002dd394 "\001", pcm=pcm@entry=0x7fffc05fdc40) at /home/bdm/git/freedv-gui/LPCNet/src/lpcnet_freedv.c:66

    d = 0
    q = 0x517000469380
    net = 0x521000529500
    in_features = {0 <repeats 55 times>}
    features = {3.813941, -0.516370833, -2.03464055, 1.20700657, -1.58758688, -0.157586887, -1.46986914, 0.0128318071, -0.0844491497, -0.028648993, -0.146438643, -0.299048781, -0.140907496, -0.276608795, -0.203972936, -0.129050359, -0.0539454855, -0.0163180213, 0 <repeats 18 times>, -0.907999992, 0.166666672, 0, -0.424744248, -0.242738038, -0.114697397, -0.104069561, -0.116192438, -0.0935854912, -0.0836967081, -0.0866528898, -0.0296176821, 0.0297110528, 0.0321504548, 0.0588617362, 0.0651846007, 0.0538248196, 0.0285883173, 0.0484757274}

3 0x00007ffff76dc264 in freedv_bits_to_speech (f=f@entry=0x7fffdcbf8800, speech_out=0x7fffc05fdc40, speech_out@entry=0x7fffc05fd880, demod_in=demod_in@entry=0x7fffc05fa250, rx_status=14) at /home/bdm/git/freedv-gui/codec2/src/freedv_api.c:957

    i = 1
    bits_per_codec_frame = 52
    data_bits_per_frame = <optimized out>
    frames = 3
    nout = 1440
    decode_speech = <optimized out>
    __PRETTY_FUNCTION__ = "freedv_bits_to_speech"

4 0x00007ffff76dc461 in freedv_comprx (f=0x7fffdcbf8800, speech_out=0x7fffc05fd880, demod_in=0x7fffc05fa840) at /home/bdm/git/freedv-gui/codec2/src/freedv_api.c:824

    __PRETTY_FUNCTION__ = "freedv_comprx"
    rx_status = <optimized out>
    demod_in_short = 0x7fffc05fa250

5 0x000000000052f94b in FreeDVReceiveStep::execute (this=0x504000b84110, inputSamples=std::shared_ptr (use count 4, weak count 0) = {...}, numInputSamples=131, numOutputSamples=0x7fffbdddf4b0) at /home/bdm/git/freedv-gui/src/pipeline/FreeDVReceiveStep.cpp:100

    newOutputSamples = 0x7fffbdddf4e0
    nin = 720
    nout = 0
    outputSamples = 0x0
    input_buf = {2280, 211, -226, 304, -1193, -1762, 378, 683, -1101, 498, 3092, 368, -2980, -740, 1834, 253, -1322, -550, 723, 1689, 1474, -439, -1808, -934, 595, 375, -1703, -2873, -887, 2491, 4061, 3081, 453, -2524, -4044, -3104, -190, 3102, 4029, 1231, -2280, -2456, 115, 1418, 356, -139, 690, 130, -1405, -1280, -863, -897, 1288, 3144, 453, -1828, 476, 1326, -1740, -2526, 74, 1179, 347, 401, 1322, 1466, 357, -1544, -2808, -1715, 555, 1034, 195, 319, 1358, 2647, 2891, 293, -3002, -3840, -3053, -1397, 1222, 3095, 3683, 2697, -913, -3832, -3053, -2097, -1873, 1320, 4948, 3847, 433, -777, -732, -1816, -2865, -1586, 1004, 2079, 1565, 1152, 764, -794, -3000, -3164, -457, 2005, 2726, 2934, 1082, -2858, -3351, 242, 1636, -26, -212, 1133, 652, -1601, -2166, 76, 1788, 825, -419, 323, 1735, 1169, -1277, -2273, -1147, -1072, -1239, 1322, 3269, 1551, -303, -1003, -1732, -327, 1366, -729, -1496, 2329, 2933, -1367, -3068, -1264, 664, 1939, 944, -1162, -322, 1527, 898, -767, -2806, -4157, -1127, 3855, 4987, 3427, 1371, -2086, -4200, -3127, -2346, -1305, 2501, 4407, 2055, 639, 278, -2268, -2898, 392, 1098, -1632, -1223, 1824, 1645, -860, -610, 2145, 2395, -1314, -4114, -2927, -509, 1718, 3979, 3001, -1062, -1898, 588, 592, -964, -426...}
    output_buf = {0 <repeats 321 times>, -6, -11, -9, 4, -2, 4, -2, -2, -7, -18, -21, -24, -26, -10, -9, -2, 4, 9, 14, 17, 9, 8, 7, 5, 10, 9, 8, 6, 11, 15, 19, 21, 24, 26, 28, 24, 20, 17, 20, 17, 15, 24, 15, 13, 22, 25, 21, 29, 31, 38, 26, 28, 30, 25, 27, 17, 33, 22, 19, 16, 25, 21, 12, 16, 8, 7, 0, 0, -6, 1, -5, -4, -4, -9, -13, -11, -9, -20, -17, -14, -18, -21, -18, -21, -23, -20, -28, -24, -26, -22, -19, -10, -15, -7, 0, 0, 0, 6, 11, 3, 9, 2, 13, 11, 9, 2, 2, 7, 1, 6, 5, 4, 15, 13, 11, 15, 19, 22, 36, 36, 37, 31, 26, 23, 37, 37, 37, 32, 27, 29, 19, 22, 13, 11, 15, 13, 22, 19, 22, 24, 21, 17, 15, 7, 6, 5, -1, 4, 4, 3, 3, -3, 3, 2, 2, 2, 1, 1, 1, 0 <repeats 960 times>}
    rx_fdm = {{real = 2280, imag = 0}, {real = 211, imag = 0}, {real = -226, imag = 0}, {real = 304, imag = 0}, {real = -1193, imag = 0}, {real = -1762, imag = 0}, {real = 378, imag = 0}, {real = 683, imag = 0}, {real = -1101, imag = 0}, {real = 498, imag = 0}, {real = 3092, imag = 0}, {real = 368, imag = 0}, {real = -2980, imag = 0}, {real = -740, imag = 0}, {real = 1834, imag = 0}, {real = 253, imag = 0}, {real = -1322, imag = 0}, {real = -550, imag = 0}, {real = 723, imag = 0}, {real = 1689, imag = 0}, {real = 1474, imag = 0}, {real = -439, imag = 0}, {real = -1808, imag = 0}, {real = -934, imag = 0}, {real = 595, imag = 0}, {real = 375, imag = 0}, {real = -1703, imag = 0}, {real = -2873, imag = 0}, {real = -887, imag = 0}, {real = 2491, imag = 0}, {real = 4061, imag = 0}, {real = 3081, imag = 0}, {real = 453, imag = 0}, {real = -2524, imag = 0}, {real = -4044, imag = 0}, {real = -3104, imag = 0}, {real = -190, imag = 0}, {real = 3102, imag = 0}, {real = 4029, imag = 0}, {real = 1231, imag = 0}, {real = -2280, imag = 0}, {real = -2456, imag = 0}, {real = 115, imag = 0}, {real = 1418, imag = 0}, {real = 356, imag = 0}, {real = -139, imag = 0}, {real = 690, imag = 0}, {real = 130, imag = 0}, {real = -1405, imag = 0}, {real = -1280, imag = 0}, {real = -863, imag = 0}, {real = -897, imag = 0}, {real = 1288, imag = 0}, {real = 3144, imag = 0}, {real = 453, imag = 0}, {real = -1828, imag = 0}, {real = 476, imag = 0}, {real = 1326, imag = 0}, {real = -1740, imag = 0}, {real = -2526, imag = 0}, {real = 74, imag = 0}, {real = 1179, imag = 0}, {real = 347, imag = 0}, {real = 401, imag = 0}, {real = 1322, imag = 0}, {real = 1466, imag = 0}, {real = 357, imag = 0}, {real = -1544, imag = 0}, {real = -2808, imag = 0}, {real = -1715, imag = 0}, {real = 555, imag = 0}, {real = 1034, imag = 0}, {real = 195, imag = 0}, {real = 319, imag = 0}, {real = 1358, imag = 0}, {real = 2647, imag = 0}, {real = 2891, imag = 0}, {real = 293, imag = 0}, {real = -3002, imag = 0}, {real = -3840, imag = 0}, {real = -3053, imag = 0}, {real = -1397, imag = 0}, {real = 1222, imag = 0}, {real = 3095, imag = 0}, {real = 3683, imag = 0}, {real = 2697, imag = 0}, {real = -913, imag = 0}, {real = -3832, imag = 0}, {real = -3053, imag = 0}, {real = -2097, imag = 0}, {real = -1873, imag = 0}, {real = 1320, imag = 0}, {real = 4948, imag = 0}, {real = 3847, imag = 0}, {real = 433, imag = 0}, {real = -777, imag = 0}, {real = -732, imag = 0}, {real = -1816, imag = 0}, {real = -2865, imag = 0}, {real = -1586, imag = 0}, {real = 1004, imag = 0}, {real = 2079, imag = 0}, {real = 1565, imag = 0}, {real = 1152, imag = 0}, {real = 764, imag = 0}, {real = -794, imag = 0}, {real = -3000, imag = 0}, {real = -3164, imag = 0}, {real = -457, imag = 0}, {real = 2005, imag = 0}, {real = 2726, imag = 0}, {real = 2934, imag = 0}, {real = 1082, imag = 0}, {real = -2858, imag = 0}, {real = -3351, imag = 0}, {real = 242, imag = 0}, {real = 1636, imag = 0}, {real = -26, imag = 0}, {real = -212, imag = 0}, {real = 1133, imag = 0}, {real = 652, imag = 0}, {real = -1601, imag = 0}, {real = -2166, imag = 0}, {real = 76, imag = 0}, {real = 1788, imag = 0}, {real = 825, imag = 0}, {real = -419, imag = 0}, {real = 323, imag = 0}, {real = 1735, imag = 0}, {real = 1169, imag = 0}, {real = -1277, imag = 0}, {real = -2273, imag = 0}, {real = -1147, imag = 0}, {real = -1072, imag = 0}, {real = -1239, imag = 0}, {real = 1322, imag = 0}, {real = 3269, imag = 0}, {real = 1551, imag = 0}, {real = -303, imag = 0}, {real = -1003, imag = 0}, {real = -1732, imag = 0}, {real = -327, imag = 0}, {real = 1366, imag = 0}, {real = -729, imag = 0}, {real = -1496, imag = 0}, {real = 2329, imag = 0}, {real = 2933, imag = 0}, {real = -1367, imag = 0}, {real = -3068, imag = 0}, {real = -1264, imag = 0}, {real = 664, imag = 0}, {real = 1939, imag = 0}, {real = 944, imag = 0}, {real = -1162, imag = 0}, {real = -322, imag = 0}, {real = 1527, imag = 0}, {real = 898, imag = 0}, {real = -767, imag = 0}, {real = -2806, imag = 0}, {real = -4157, imag = 0}, {real = -1127, imag = 0}, {real = 3855, imag = 0}, {real = 4987, imag = 0}, {real = 3427, imag = 0}, {real = 1371, imag = 0}, {real = -2086, imag = 0}, {real = -4200, imag = 0}, {real = -3127, imag = 0}, {real = -2346, imag = 0}, {real = -1305, imag = 0}, {real = 2501, imag = 0}, {real = 4407, imag = 0}, {real = 2055, imag = 0}, {real = 639, imag = 0}, {real = 278, imag = 0}, {real = -2268, imag = 0}, {real = -2898, imag = 0}, {real = 392, imag = 0}, {real = 1098, imag = 0}, {real = -1632, imag = 0}, {real = -1223, imag = 0}, {real = 1824, imag = 0}, {real = 1645, imag = 0}, {real = -860, imag = 0}, {real = -610, imag = 0}, {real = 2145, imag = 0}, {real = 2395, imag = 0}, {real = -1314, imag = 0}, {real = -4114, imag = 0}, {real = -2927, imag = 0}, {real = -509, imag = 0}, {real = 1718, imag = 0}, {real = 3979, imag = 0}, {real = 3001, imag = 0}, {real = -1062, imag = 0}, {real = -1898, imag = 0}, {real = 588, imag = 0}, {real = 592, imag = 0}, {real = -964, imag = 0}, {real = -426, imag = 0}...}
    rx_fdm_offset = {{real = 2280, imag = 0}, {real = 211, imag = 0}, {real = -226, imag = 0}, {real = 304, imag = 0}, {real = -1193, imag = 0}, {real = -1762, imag = 0}, {real = 378, imag = 0}, {real = 683, imag = 0}, {real = -1101, imag = 0}, {real = 498, imag = 0}, {real = 3092, imag = 0}, {real = 368, imag = 0}, {real = -2980, imag = 0}, {real = -740, imag = 0}, {real = 1834, imag = 0}, {real = 253, imag = 0}, {real = -1322, imag = 0}, {real = -550, imag = 0}, {real = 723, imag = 0}, {real = 1689, imag = 0}, {real = 1474, imag = 0}, {real = -439, imag = 0}, {real = -1808, imag = 0}, {real = -934, imag = 0}, {real = 595, imag = 0}, {real = 375, imag = 0}, {real = -1703, imag = 0}, {real = -2873, imag = 0}, {real = -887, imag = 0}, {real = 2491, imag = 0}, {real = 4061, imag = 0}, {real = 3081, imag = 0}, {real = 453, imag = 0}, {real = -2524, imag = 0}, {real = -4044, imag = 0}, {real = -3104, imag = 0}, {real = -190, imag = 0}, {real = 3102, imag = 0}, {real = 4029, imag = 0}, {real = 1231, imag = 0}, {real = -2280, imag = 0}, {real = -2456, imag = 0}, {real = 115, imag = 0}, {real = 1418, imag = 0}, {real = 356, imag = 0}, {real = -139, imag = 0}, {real = 690, imag = 0}, {real = 130, imag = 0}, {real = -1405, imag = 0}, {real = -1280, imag = 0}, {real = -863, imag = 0}, {real = -897, imag = 0}, {real = 1288, imag = 0}, {real = 3144, imag = 0}, {real = 453, imag = 0}, {real = -1828, imag = 0}, {real = 476, imag = 0}, {real = 1326, imag = 0}, {real = -1740, imag = 0}, {real = -2526, imag = 0}, {real = 74, imag = 0}, {real = 1179, imag = 0}, {real = 347, imag = 0}, {real = 401, imag = 0}, {real = 1322, imag = 0}, {real = 1466, imag = 0}, {real = 357, imag = 0}, {real = -1544, imag = 0}, {real = -2808, imag = 0}, {real = -1715, imag = 0}, {real = 555, imag = 0}, {real = 1034, imag = 0}, {real = 195, imag = 0}, {real = 319, imag = 0}, {real = 1358, imag = 0}, {real = 2647, imag = 0}, {real = 2891, imag = 0}, {real = 293, imag = 0}, {real = -3002, imag = 0}, {real = -3840, imag = 0}, {real = -3053, imag = 0}, {real = -1397, imag = 0}, {real = 1222, imag = 0}, {real = 3095, imag = 0}, {real = 3683, imag = 0}, {real = 2697, imag = 0}, {real = -913, imag = 0}, {real = -3832, imag = 0}, {real = -3053, imag = 0}, {real = -2097, imag = 0}, {real = -1873, imag = 0}, {real = 1320, imag = 0}, {real = 4948, imag = 0}, {real = 3847, imag = 0}, {real = 433, imag = 0}, {real = -777, imag = 0}, {real = -732, imag = 0}, {real = -1816, imag = 0}, {real = -2865, imag = 0}, {real = -1586, imag = 0}, {real = 1004, imag = 0}, {real = 2079, imag = 0}, {real = 1565, imag = 0}, {real = 1152, imag = 0}, {real = 764, imag = 0}, {real = -794, imag = 0}, {real = -3000, imag = 0}, {real = -3164, imag = 0}, {real = -457, imag = 0}, {real = 2005, imag = 0}, {real = 2726, imag = 0}, {real = 2934, imag = 0}, {real = 1082, imag = 0}, {real = -2858, imag = 0}, {real = -3351, imag = 0}, {real = 242, imag = 0}, {real = 1636, imag = 0}, {real = -26, imag = 0}, {real = -212, imag = 0}, {real = 1133, imag = 0}, {real = 652, imag = 0}, {real = -1601, imag = 0}, {real = -2166, imag = 0}, {real = 76, imag = 0}, {real = 1788, imag = 0}, {real = 825, imag = 0}, {real = -419, imag = 0}, {real = 323, imag = 0}, {real = 1735, imag = 0}, {real = 1169, imag = 0}, {real = -1277, imag = 0}, {real = -2273, imag = 0}, {real = -1147, imag = 0}, {real = -1072, imag = 0}, {real = -1239, imag = 0}, {real = 1322, imag = 0}, {real = 3269, imag = 0}, {real = 1551, imag = 0}, {real = -303, imag = 0}, {real = -1003, imag = 0}, {real = -1732, imag = 0}, {real = -327, imag = 0}, {real = 1366, imag = 0}, {real = -729, imag = 0}, {real = -1496, imag = 0}, {real = 2329, imag = 0}, {real = 2933, imag = 0}, {real = -1367, imag = 0}, {real = -3068, imag = 0}, {real = -1264, imag = 0}, {real = 664, imag = 0}, {real = 1939, imag = 0}, {real = 944, imag = 0}, {real = -1162, imag = 0}, {real = -322, imag = 0}, {real = 1527, imag = 0}, {real = 898, imag = 0}, {real = -767, imag = 0}, {real = -2806, imag = 0}, {real = -4157, imag = 0}, {real = -1127, imag = 0}, {real = 3855, imag = 0}, {real = 4987, imag = 0}, {real = 3427, imag = 0}, {real = 1371, imag = 0}, {real = -2086, imag = 0}, {real = -4200, imag = 0}, {real = -3127, imag = 0}, {real = -2346, imag = 0}, {real = -1305, imag = 0}, {real = 2501, imag = 0}, {real = 4407, imag = 0}, {real = 2055, imag = 0}, {real = 639, imag = 0}, {real = 278, imag = 0}, {real = -2268, imag = 0}, {real = -2898, imag = 0}, {real = 392, imag = 0}, {real = 1098, imag = 0}, {real = -1632, imag = 0}, {real = -1223, imag = 0}, {real = 1824, imag = 0}, {real = 1645, imag = 0}, {real = -860, imag = 0}, {real = -610, imag = 0}, {real = 2145, imag = 0}, {real = 2395, imag = 0}, {real = -1314, imag = 0}, {real = -4114, imag = 0}, {real = -2927, imag = 0}, {real = -509, imag = 0}, {real = 1718, imag = 0}, {real = 3979, imag = 0}, {real = 3001, imag = 0}, {real = -1062, imag = 0}, {real = -1898, imag = 0}, {real = 588, imag = 0}, {real = 592, imag = 0}, {real = -964, imag = 0}, {real = -426, imag = 0}...}
    inputPtr = 0x51c0004468ba
    __PRETTY_FUNCTION__ = "virtual std::shared_ptr<short int> FreeDVReceiveStep::execute(std::shared_ptr<short int>, int, int*)"

6 0x0000000000537a70 in operator() (__closure=0x506000718498, inSamples=std::shared_ptr (use count 4, weak count 0) = {...}, numSamples=160) at /home/bdm/git/freedv-gui/src/pipeline/ParallelStep.cpp:215

    numOutputSamples = 0
    result = std::shared_ptr<short> (empty) = {get() = 0x3f800000}
    step = 0x504000b84110

7 0x000000000053a3bb in std::invoke_impl<std::pair<std::sharedptr, int>, ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>&, std::shared_ptr, int>(std::invoke_other, struct {...} &) (__f=...) at /usr/include/c++/14/bits/invoke.h:61

8 0x0000000000539f0a in std::invoke_r<std::pair<std::sharedptr, int>, ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>&, std::shared_ptr, int>(struct {...} &) (fn=...) at /usr/include/c++/14/bits/invoke.h:139

9 0x000000000053980b in operator() (__closure=0x7fffbde40240) at /usr/include/c++/14/future:1499

    this = 0x506000718470
    __args#0 = std::shared_ptr<short> (empty) = {get() = 0x0}
    __args#1 = @0x7fffbdcf9ce0: 160

10 0x000000000053b007 in std::future_base::_Task_setter<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >::operator()(void) const (this=0x7fffbde40280) at /usr/include/c++/14/future:1416

11 0x000000000053ad6c in std::invoke_impl<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Task_setter<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >&>(std::__invoke_other, std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> > &) (__f=...) at /usr/include/c++/14/bits/invoke.h:61

12 0x000000000053a83f in std::invoke_r<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>, std::future_base::_Task_setter<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >&>(std::future_base::_Task_setter<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> > &) (fn=...) at /usr/include/c++/14/bits/invoke.h:138

13 0x000000000053a4ad in std::_Function_handler<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>(), std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> > >::_M_invoke(const std::_Any_data &) (functor=...) at /usr/include/c++/14/bits/std_function.h:291

14 0x000000000053d38d in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=0x7fffbde40280) at /usr/include/c++/14/bits/std_function.h:591

15 0x000000000053c073 in std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool) (this=0x506000718470, f=0x7fffbde40280, did_set=0x7fffbde40330) at /usr/include/c++/14/future:596

    __res = std::unique_ptr<std::__future_base::_Result_base> = {get() = 0x0}

16 0x0000000000544ede in std::invoke_impl<void, void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*, std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool>(std::invoke_memfun_deref, void (std::future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>&&, bool&&) (f=@0x7fffbde403a0: (void (std::future_base::_State_baseV2::)(class std::future_base::_State_baseV2 * const, class std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>()> , bool )) 0x53bfe6 <std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool)>, t=@0x7fffbde40340: 0x506000718470) at /usr/include/c++/14/bits/invoke.h:74

17 0x0000000000540846 in std::invoke<void (std::future_base::_State_baseV2::)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool), std::__future_base::_State_baseV2, std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool>(void (std::future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&) (fn=@0x7fffbde403a0: (void (std::future_base::_State_baseV2::)(class std::__future_base::_State_baseV2 const, class std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter>()> , bool )) 0x53bfe6 <std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool)>) at /usr/include/c++/14/bits/invoke.h:96

18 0x000000000053cd5c in std::call_once<void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool>(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&)::{lambda()#1}::operator()() const (__closure=0x7fffbdddf3c0) at /usr/include/c++/14/mutex:909

    __f = @0x7fffbde403a0: (void (std::__future_base::_State_baseV2::*)(class std::__future_base::_State_baseV2 * const, class std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>()> *, bool *)) 0x53bfe6 <std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>
    __args#0 = @0x7fffbde40340: 0x506000718470
    __args#1 = @0x7fffbde40360: 0x7fffbde40280
    __args#2 = @0x7fffbde40380: 0x7fffbde40330

19 0x0000000000540871 in std::once_flag::_Prepare_execution::_Prepare_execution<std::call_once<void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool>(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&)::{lambda()#1}>(void (std::future_base::_State_baseV2::*&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool))::{lambda()#1}::operator()() const (closure=0x0) at /usr/include/c++/14/mutex:845

20 0x0000000000540882 in std::once_flag::_Prepare_execution::_Prepare_execution<std::call_once<void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool>(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&)::{lambda()#1}>(void (std::future_base::_State_baseV2::*&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool))::{lambda()#1}::_FUN() () at /usr/include/c++/14/mutex:845

21 0x00007ffff44aba4b in pthread_once_slow (once_control=0x506000718488, init_routine=0x422330 <once_proxy@plt>) at pthread_once.c:116

    __cancel_routine = 0x7ffff44ab910 <clear_once_control>
    __clframe = {__cancel_routine = 0x7ffff44ab910 <clear_once_control>, __cancel_arg = 0x506000718488, __do_it = 1, __buffer = {__routine = 0x7ffff44ab8d0 <__pthread_cleanup_combined_routine_voidptr>, __arg = 0x7fffc05ff0c0, __canceltype = 0, __prev = 0x0}}
    val = <optimized out>
    newval = <optimized out>

22 0x00007ffff44abab9 in ___pthread_once (once_control=, init_routine=) at pthread_once.c:143

    val = <optimized out>

23 0x000000000053b6a9 in __gthread_once (once=0x506000718488, func=0x422330 __once_proxy@plt) at /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:713

24 0x000000000053cef2 in std::call_once<void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool>(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&) (once=..., f=@0x7fffbde403a0: (void (std::future_base::_State_baseV2::)(class std::__future_base::_State_baseV2 const, class std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter>()> , bool )) 0x53bfe6 <std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool)>) at /usr/include/c++/14/mutex:916

    __e = 32767
    __callable = {____f = @0x7fffbde403a0, ____args#0 = @0x7fffbde40340, ____args#1 = @0x7fffbde40360, ____args#2 = @0x7fffbde40380}
    __exec = {<No data fields>}

25 0x000000000053b97d in std::future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool) (this=0x506000718470, res=..., ignore_failure=false) at /usr/include/c++/14/future:435

    __did_set = false

26 0x00000000005399d1 in std::__future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr &&, int &&) (this=0x506000718470, args#0=..., args#1=@0x7fffbdcf9ce0: 160) at /usr/include/c++/14/future:1501

    __boundfn = {__this = 0x506000718470, ____args#0 = std::shared_ptr<short> (empty) = {get() = 0x0}, ____args#1 = @0x7fffbdcf9ce0}

27 0x0000000000540345 in std::packaged_task<std::pair<std::shared_ptr, int> (std::shared_ptr, int)>::operator()(std::shared_ptr, int) (this=0x515000649c48, __args#0=std::shared_ptr (empty) = {...}, __args#1=1102416563) at /usr/include/c++/14/future:1635

28 0x0000000000537773 in ParallelStep::executeRunnerThread_ (this=0x51100096a180, threadState=0x510000280140) at /home/bdm/git/freedv-gui/src/pipeline/ParallelStep.cpp:202

    taskEntry = warning: RTTI symbol not found for class 'std::_Sp_counted_ptr_inplace<std::__future_base::_Task_state<ParallelStep::enqueueTask_(ParallelStep::ThreadInfo*, IPipelineStep*, std::shared_ptr<short>, int)::{lambda(std::shared_ptr<short>, int)#1}, std::allocator<int>, std::pair<std::shared_ptr<short>, int> (std::shared_ptr<short>, int)>, std::allocator<int>, (__gnu_cxx::_Lock_policy)2>'

warning: RTTI symbol not found for class 'std::_Sp_counted_ptr_inplace<std::future_base::_Taskstate<ParallelStep::enqueueTask(ParallelStep::ThreadInfo, IPipelineStep, std::shared_ptr, int)::{lambda(std::shared_ptr, int)#1}, std::allocator, std::pair<std::shared_ptr, int> (std::shared_ptr, int)>, std::allocator, (gnu_cxx::_Lock_policy)2>' @0x515000649c48: {task = {_M_state = std::shared_ptr<struct std::__future_base::_Task_state_base<std::pair<std::shared_ptr, int>(std::shared_ptr, int)>> (use count 2, weak count 0) = {get() = 0x506000718470}}, inputSamples = std::shared_ptr (use count 4, weak count 0) = {get() = 0x51c000446880}, numInputSamples = 160} lock = {_M_device = 0x510000280148, _M_owns = false}

29 0x0000000000534939 in operator() (__closure=0x50300166e590, threadState=0x510000280140) at /home/bdm/git/freedv-gui/src/pipeline/ParallelStep.cpp:54

    this = 0x51100096a180

30 0x000000000053aee8 in std::invoke_impl<void, ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*>(std::invoke_other, struct {...} &&) (__f=...) at /usr/include/c++/14/bits/invoke.h:61

31 0x000000000053ad01 in std::__invoke<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*>(struct {...} &&) (__fn=...) at /usr/include/c++/14/bits/invoke.h:96

32 0x000000000053a6e9 in std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> >::_M_invoke<0, 1>(std::_Index_tuple<0, 1>) (this=0x50300166e588) at /usr/include/c++/14/bits/std_thread.h:301

33 0x000000000053a28e in std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> >::operator()(void) (this=0x50300166e588) at /usr/include/c++/14/bits/std_thread.h:308

34 0x0000000000539e92 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> > >::_M_run(void) (this=0x50300166e580) at /usr/include/c++/14/bits/std_thread.h:253

35 0x00007ffff46e7564 in std::execute_native_thread_routine (p=p@entry=0x50300166e580) at ../../../../../libstdc++-v3/src/c++11/thread.cc:104

    __t = std::unique_ptr<std::thread::_State> = {get() = <optimized out>}

36 0x00007ffff785df96 in asan_thread_start (arg=0x7fffdcab3000) at ../../../../libsanitizer/asan/asan_interceptors.cpp:234

    t = 0x7fffdcab3000
    self = 140736420906688
    args = {routine = 0x7ffff46e7550 <std::execute_native_thread_routine(void*)>, arg_retval = 0x50300166e580}
    sigset = {val = {0, 0, 72198327231315969, 140736895864832, 140736895864832, 0, 140736490097744, 24, 140736490097744, 1, 1, 140737346006620, 140736490099840, 30, 24, 140736490099840}}
    retval = <optimized out>

37 0x00007ffff44a66d7 in start_thread (arg=) at pthread_create.c:447

    ret = <optimized out>
    pd = <optimized out>
    out = <optimized out>
    unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736420906688, -4900114303849068032, 140736420906688, -272, 0, 140736490096912, -4900114303836485120, -4900158100012660224}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
    not_first_call = <optimized out>

38 0x00007ffff452a60c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

Is this a more useful backtrace?

tmiw commented 1 month ago

I actually expected something like this to be output:

==532020==ERROR: AddressSanitizer: heap-use-after-free on address 0x602000078f50 at pc 0x7f1d8de4fc11 bp 0x7f1d6d9052c0 sp 0x7f1d6d904a70
READ of size 2 at 0x602000078f50 thread T15
    #0 0x7f1d8de4fc10 in __interceptor_setlocale.part.0 (/lib64/libasan.so.8+0x4fc10)
    #1 0x7f1d8d10938a in netrigctl_open (/lib64/libhamlib.so.4+0x10938a)
    #2 0x7f1d8d09a877 in rig_open (/lib64/libhamlib.so.4+0x9a877)

(with the actual addresses, reason and stack trace of the issue substituted as appropriate)

We can investigate from another angle. Have you tried disabling multiple RX and forcing FreeDV to only decode i.e. 700D? Do you get a crash in another location?

Also, re: libasan, I had suggested to rebuild LPCNet, hamlib and/or codec2 with it if possible. But I suspect if the crash doesn't show up if you disable multi-RX and use a mode other than 2020/2020B, it's very likely something related LPCNet.

Tyrbiter commented 1 month ago

Yeah. I thought there wasn't an actual error showing from libasan.

The rebuild I did was to use the git master and build_linux.sh, I added the -fsanitize=address to the CMakeLists.txt file CMAKE_CXX_FLAGS so I think that should mean that codec2 and LPCNet are linked to libasan since the freedv binary contains everything except Hamlib. I couldn't work out how to get Hamlib to build with libasan linked in. Not much of a software engineer :(

I now have the same freedv binary running with multi-Rx off and 700E mode selected. I will report if I see a crash in this case.

Tyrbiter commented 1 month ago

Freedv-GUI ran overnight without any problems with multi-Rx off and 700E mode selected.

Looks like something in LPCNet disagreeing with something that changed in hamlib, I can try to identify it but I am going to need help with the process.

Tyrbiter commented 1 month ago

A couple of hamlib commits have been made in the last 24 hours, including one that has added in a 50ms wait after set_freq for Kenwood rigs.

The result is this, libasan has fired, freedv was not running under gdb:

2:rig.c(2413):rig_get_freq entered rig_get_freq called vfo=VFOA rig_get_freq(2431) called vfo=VFOA rig.c(2440) vfo=VFOA, curr_vfo=VFOA rig_get_freq(2553): vfo_opt=0, model=2041 **3:kenwood.c(2052):kenwood_get_freq entered kenwood_safe_transaction called, cmd=FA, expected=13 kenwood_transaction called cmd=FA kenwood.c(689):kenwood_transaction returning2(0) kenwood.c(767):kenwood_safe_transaction returning2(0) 3:kenwood.c(2122):kenwood_get_freq returning(0) rig_get_band called 2:rig_get_freq: elapsed=4ms 2:rig.c(2690):rig_get_freq returning(0) unpack_frame Got a frame that was too small (<5) to be valid AddressSanitizer:DEADLYSIGNAL

==184969==ERROR: AddressSanitizer: SEGV on unknown address 0x7f8ebfdba9a0 (pc 0x7f8eb780aade bp 0x7f8e837fa270 sp 0x7f8e837fa210 T19) ==184969==The signal is caused by a READ memory access. 2:rig.c(3422):rig_get_vfo entered *3:kenwood.c(1833):kenwood_get_vfo_if entered **4:kenwood.c(1201):kenwood_get_if entered kenwood_safe_transaction called, cmd=IF, expected=37 kenwood_transaction called cmd=IF kenwood.c(689):kenwood_transaction returning2(0) kenwood.c(767):kenwood_safe_transaction returning2(0) ***4:kenwood.c(1218):kenwood_get_if returning(0) kenwood_get_vfo_if: priv->tx_vfo=VFOA 3:kenwood.c(1881):kenwood_get_vfo_if returning(0) 2:rig_get_vfo: elapsed=6ms 2:rig.c(3485):rig_get_vfo returning(0) 2:rig.c(2949):rig_get_mode entered kenwood_get_mode called, curr_vfo=VFOA kenwood_safe_transaction called, cmd=SF0;, expected=15 kenwood_transaction called cmd=SF0; kenwood.c(689):kenwood_transaction returning2(0) kenwood.c(767):kenwood_safe_transaction returning2(0) kenwood2rmode called **3:rig.c(3108):rig_passband_normal entered rig_passband_normal: filter not found...return 0 3:rig.c(3130):rig_passband_normal returning(0) kenwood.c(2939):kenwood_get_mode returning2(0) 3:rig.c(3108):rig_passband_normal entered rig_passband_normal: filter not found...return 0 3:rig.c(3130):rig_passband_normal returning(0) 3:cache.c(40):rig_set_cache_mode entered 3:cache.c(154):rig_set_cache_mode returning(0) 2:rig_get_mode: elapsed=4ms 2:rig.c(3081):rig_get_mode returning(0) 2:rig.c(2413):rig_get_freq entered rig_get_freq called vfo=VFOA rig_get_freq(2431) called vfo=VFOA rig.c(2440) vfo=VFOA, curr_vfo=VFOA rig_get_freq(2553): vfo_opt=0, model=2041 **3:kenwood.c(2052):kenwood_get_freq entered kenwood_safe_transaction called, cmd=FA, expected=13 kenwood_transaction called cmd=FA kenwood.c(689):kenwood_transaction returning2(0) kenwood.c(767):kenwood_safe_transaction returning2(0) 3:kenwood.c(2122):kenwood_get_freq returning(0) rig_get_band called 2:rig_get_freq: elapsed=4ms 2:rig.c(2690):rig_get_freq returning(0)

0 0x7f8eb780aade in quant_pred_output /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:243

#1 0x7f8eb780bb94 in lpcnet_frame_to_features /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:420
#2 0x7f8eb780f6bc in lpcnet_dec (/lib64/liblpcnetfreedv.so.0.5+0xf6bc) (BuildId: 74d399fbec7c8fe8394f69664cb910b63cd2a1f3)
#3 0x7f8ebab3fabb in freedv_bits_to_speech (/lib64/libcodec2.so.1.2+0x2fabb) (BuildId: 5fcf7dae347ceda940698d7f927e43a68ddceaec)
#4 0x7f8ebab43e91 in freedv_comprx (/lib64/libcodec2.so.1.2+0x33e91) (BuildId: 5fcf7dae347ceda940698d7f927e43a68ddceaec)
#5 0x556916feec94 in FreeDVReceiveStep::execute(std::shared_ptr<short>, int, int*) /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/FreeDVReceiveStep.cpp:100
#6 0x55691701373d in operator() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:215
#7 0x55691701373d in __invoke_impl<std::pair<std::shared_ptr<short int>, int>, ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>&, std::shared_ptr<short int>, int> /usr/include/c++/14/bits/invoke.h:61
#8 0x55691701373d in __invoke_r<std::pair<std::shared_ptr<short int>, int>, ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>&, std::shared_ptr<short int>, int> /usr/include/c++/14/bits/invoke.h:139
#9 0x55691701373d in operator() /usr/include/c++/14/future:1499
#10 0x55691701373d in operator() /usr/include/c++/14/future:1416
#11 0x55691701373d in __invoke_impl<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr<short int>, int> >, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr<short int>, int> >, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>, std::allocator<int>, std::pair<std::shared_ptr<short int>, int>(std::shared_ptr<short int>, int)>::_M_run(std::shared_ptr<short int>&&, int&&)::<lambda()>, std::pair<std::shared_ptr<short int>, int> >&> /usr/include/c++/14/bits/invoke.h:61
#12 0x55691701373d in __invoke_r<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr<short int>, int> >, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>, std::allocator<int>, std::pair<std::shared_ptr<short int>, int>(std::shared_ptr<short int>, int)>::_M_run(std::shared_ptr<short int>&&, int&&)::<lambda()>, std::pair<std::shared_ptr<short int>, int> >&> /usr/include/c++/14/bits/invoke.h:138
#13 0x55691701373d in _M_invoke /usr/include/c++/14/bits/std_function.h:291
#14 0x556916fea44a in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const /usr/include/c++/14/bits/std_function.h:591
#15 0x556916fea44a in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) /usr/include/c++/14/future:596
#16 0x7f8eb72aba4a in __pthread_once_slow.isra.0 (/lib64/libc.so.6+0x9ca4a) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#17 0x7f8eb72abab8 in pthread_once@GLIBC_2.2.5 (/lib64/libc.so.6+0x9cab8) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#18 0x5569171a90f3 in __gthread_once /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:713
#19 0x5569171a90f3 in void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) [clone .constprop.0] /usr/include/c++/14/mutex:916
#20 0x55691700f68f in std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) /usr/include/c++/14/future:435
#21 0x55691700f68f in _M_run /usr/include/c++/14/future:1501
#22 0x55691700f68f in std::packaged_task<std::pair<std::shared_ptr<short>, int> (std::shared_ptr<short>, int)>::operator()(std::shared_ptr<short>, int) /usr/include/c++/14/future:1635
#23 0x55691700f68f in ParallelStep::executeRunnerThread_(ParallelStep::ThreadInfo*) /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:202
#24 0x55691700f68f in operator() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:54
#25 0x55691700f68f in __invoke_impl<void, ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep*)>, std::function<int(ParallelStep*)>, std::vector<IPipelineStep*>, std::shared_ptr<void>)::<lambda(ParallelStep::ThreadInfo*)>, ParallelStep::ThreadInfo*> /usr/include/c++/14/bits/invoke.h:61
#26 0x55691700f68f in __invoke<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep*)>, std::function<int(ParallelStep*)>, std::vector<IPipelineStep*>, std::shared_ptr<void>)::<lambda(ParallelStep::ThreadInfo*)>, ParallelStep::ThreadInfo*> /usr/include/c++/14/bits/invoke.h:96
#27 0x55691700f68f in _M_invoke<0, 1> /usr/include/c++/14/bits/std_thread.h:301
#28 0x55691700f68f in operator() /usr/include/c++/14/bits/std_thread.h:308
#29 0x55691700f68f in _M_run /usr/include/c++/14/bits/std_thread.h:253
#30 0x7f8eb74e7563 in execute_native_thread_routine (/lib64/libstdc++.so.6+0xe7563) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)
#31 0x7f8eba45df95 in asan_thread_start(void*) (/lib64/libasan.so.8+0x5df95) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)
#32 0x7f8eb72a66d6 in start_thread (/lib64/libc.so.6+0x976d6) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#33 0x7f8eb732a60b in __clone3 (/lib64/libc.so.6+0x11b60b) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)

AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:243 in quant_pred_output Thread T19 created by T16 here:

0 0x7f8eba4ef871 in pthread_create (/lib64/libasan.so.8+0xef871) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

#1 0x7f8eb74e7638 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xe7638) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)
#2 0x556917184e4b in FreeDVInterface::createReceivePipeline(int, int, std::function<int* ()>, std::function<int ()>, std::function<int ()>, std::function<float ()>, std::function<float* ()>) [clone .constprop.0] /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/freedv_interface.cpp:630
#3 0x55691702dbff in TxRxThread::initializePipeline_() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/TxRxThread.cpp:370
#4 0x55691703200a in TxRxThread::Entry() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/TxRxThread.cpp:463
#5 0x7f8eb897def5 in wxThreadInternal::PthreadStart(wxThread*) (/lib64/libwx_baseu-3.2.so.0+0x17def5) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#6 0x7f8eba45df95 in asan_thread_start(void*) (/lib64/libasan.so.8+0x5df95) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

Thread T16 created by T11 here:

0 0x7f8eba4ef871 in pthread_create (/lib64/libasan.so.8+0xef871) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

#1 0x7f8eb897f8c5 in wxThreadInternal::Create(wxThread*, unsigned int) (/lib64/libwx_baseu-3.2.so.0+0x17f8c5) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#2 0x7f8eb89800e1 in wxThread::Create(unsigned int) (/lib64/libwx_baseu-3.2.so.0+0x1800e1) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#3 0x556916f434ec in MainFrame::startRxStream() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:3004
#4 0x556916f48fe6 in MainFrame::performFreeDVOn_() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:2085
#5 0x556916f907d4 in operator() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:2310
#6 0x556916f907d4 in __invoke_impl<void, MainFrame::OnTogBtnOnOff(wxCommandEvent&)::<lambda()> > /usr/include/c++/14/bits/invoke.h:61
#7 0x556916f907d4 in __invoke<MainFrame::OnTogBtnOnOff(wxCommandEvent&)::<lambda()> > /usr/include/c++/14/bits/invoke.h:96
#8 0x556916f907d4 in _M_invoke<0> /usr/include/c++/14/bits/std_thread.h:301
#9 0x556916f907d4 in operator() /usr/include/c++/14/bits/std_thread.h:308
#10 0x556916f907d4 in _M_run /usr/include/c++/14/bits/std_thread.h:253
#11 0x7f8eb74e7563 in execute_native_thread_routine (/lib64/libstdc++.so.6+0xe7563) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)

Thread T11 created by T0 here:

0 0x7f8eba4ef871 in pthread_create (/lib64/libasan.so.8+0xef871) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

#1 0x7f8eb74e7638 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xe7638) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)
#2 0x7f8eb89a12de in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a12de) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#3 0x7f8eb89a349c in wxEvtHandler::SearchDynamicEventTable(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a349c) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#4 0x7f8eb89a37fc in wxEvtHandler::TryHereOnly(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a37fc) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#5 0x7f8eb89a38ae in wxEvtHandler::ProcessEventLocally(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a38ae) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#6 0x7f8eb89a39c1 in wxEvtHandler::ProcessEvent(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a39c1) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#7 0x7f8eb89a4561 in wxEvtHandler::SafelyProcessEvent(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a4561) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#8 0x7f8eb8fa4d17 in gtk_togglebutton_clicked_callback (/lib64/libwx_gtk3u_core-3.2.so.0+0x3a4d17) (BuildId: 2c1c3158c0e564d008125464323151952a271b43)
#9 0x7f8eb6445649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#10 0x7f8eb64755f2 in signal_emit_unlocked_R.isra.0 (/lib64/libgobject-2.0.so.0+0x415f2) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#11 0x7f8eb6466103 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32103) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#12 0x7f8eb6466360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#13 0x7f8eb6466422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#14 0x7f8eb68cb720 in gtk_button_do_release ../gtk/gtkbutton.c:1845
#15 0x7f8eb68cb720 in gtk_button_do_release ../gtk/gtkbutton.c:1832
#16 0x7f8eb68cb720 in gtk_real_button_released ../gtk/gtkbutton.c:1963
#17 0x7f8eb6445649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#18 0x7f8eb647571f in signal_emit_unlocked_R.isra.0 (/lib64/libgobject-2.0.so.0+0x4171f) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#19 0x7f8eb6466103 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32103) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#20 0x7f8eb6466360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#21 0x7f8eb6466422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#22 0x7f8eb68cb55c in multipress_released_cb ../gtk/gtkbutton.c:666
#23 0x7f8eb688a11b in _gtk_marshal_VOID__INT_DOUBLE_DOUBLEv gtk/gtkmarshalers.c:4804
#24 0x7f8eb6466253 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32253) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#25 0x7f8eb6466360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#26 0x7f8eb6466422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#27 0x7f8eb69a6fda in gtk_gesture_multi_press_end ../gtk/gtkgesturemultipress.c:287
#28 0x7f8eb6449c64 in g_cclosure_marshal_VOID__BOXEDv (/lib64/libgobject-2.0.so.0+0x15c64) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#29 0x7f8eb6466253 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32253) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#30 0x7f8eb6466360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#31 0x7f8eb6466422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#32 0x7f8eb699ec23 in _gtk_gesture_set_recognized ../gtk/gtkgesture.c:346
#33 0x7f8eb699ec23 in _gtk_gesture_check_recognized ../gtk/gtkgesture.c:387
#34 0x7f8eb69a69b2 in gtk_gesture_handle_event ../gtk/gtkgesture.c:787
#35 0x7f8eb69aa21d in gtk_gesture_single_handle_event ../gtk/gtkgesturesingle.c:222
#36 0x7f8eb69692d2 in gtk_event_controller_handle_event ../gtk/gtkeventcontroller.c:230
#37 0x7f8eb6b4ffcf in _gtk_widget_run_controllers ../gtk/gtkwidget.c:7447
#38 0x7f8eb688d633 in _gtk_marshal_BOOLEAN__BOXED gtk/gtkmarshalers.c:84
#39 0x7f8eb6445649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#40 0x7f8eb6475bcf in signal_emit_unlocked_R.isra.0 (/lib64/libgobject-2.0.so.0+0x41bcf) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#41 0x7f8eb6465968 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x31968) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#42 0x7f8eb6466360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#43 0x7f8eb6466422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#44 0x7f8eb6b5fe3b in gtk_widget_event_internal.part.0.lto_priv.0 ../gtk/gtkwidget.c:7812
#45 0x7f8eb69f4327 in propagate_event_up ../gtk/gtkmain.c:2588
#46 0x7f8eb69f4327 in propagate_event ../gtk/gtkmain.c:2691
#47 0x7f8eb69f50a9 in gtk_main_do_event (/lib64/libgtk-3.so.0+0x1f50a9) (BuildId: 2175bb7e99409e4d1be5535206bd5347a7e88d46)
#48 0x7f8eb700a806 in _gdk_event_emit ../gdk/gdkevents.c:73
#49 0x7f8eb700a806 in _gdk_event_emit ../gdk/gdkevents.c:67
#50 0x7f8eb70443cd in gdk_event_source_dispatch ../gdk/wayland/gdkeventsource.c:124
#51 0x7f8eb6342e8b in g_main_context_dispatch_unlocked.lto_priv.0 (/lib64/libglib-2.0.so.0+0x5ce8b) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
#52 0x7f8eb63a4c97 in g_main_context_iterate_unlocked.isra.0 (/lib64/libglib-2.0.so.0+0xbec97) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
#53 0x7f8eb6348f36 in g_main_loop_run (/lib64/libglib-2.0.so.0+0x62f36) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
#54 0x7f8eb69efb34 in gtk_main (/lib64/libgtk-3.so.0+0x1efb34) (BuildId: 2175bb7e99409e4d1be5535206bd5347a7e88d46)
#55 0x7f8eb8ef51f4 in wxGUIEventLoop::DoRun() (/lib64/libwx_gtk3u_core-3.2.so.0+0x2f51f4) (BuildId: 2c1c3158c0e564d008125464323151952a271b43)
#56 0x7f8eb88b3179 in wxEventLoopBase::Run() (/lib64/libwx_baseu-3.2.so.0+0xb3179) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#57 0x7f8eb888f09c in wxAppConsoleBase::MainLoop() (/lib64/libwx_baseu-3.2.so.0+0x8f09c) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#58 0x7f8eb88f0cbf in wxEntry(int&, wchar_t**) (/lib64/libwx_baseu-3.2.so.0+0xf0cbf) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#59 0x556916ee41f9 in main /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:184
#60 0x7f8eb7239087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#61 0x7f8eb723914a in __libc_start_main_alias_1 (/lib64/libc.so.6+0x2a14a) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#62 0x556916eead44 in _start (/usr/bin/freedv+0xdad44) (BuildId: f3c4c6082e9d6c0bc4ae77fe9096a2e1a9559642)

==184969==ABORTING

Does this provide enough information to determine where the problem lies? I see it mentions LPCNet's quant_pred_output function.

tmiw commented 1 month ago

Would you be able to record something like 5-10 minutes of raw audio from your rig (or however long it takes to trigger the issue) and try to feed it through freedv_rx? i.e.

freedv_rx 2020B input.raw /dev/null

IIRC the .raw has to be either in 8 or 16 kHz (I forget which for 2020B). You should be able to resample any .wav files in e.g. Audacity and export in raw format.

(This should hopefully rule out anything in freedv-gui or hamlib causing the problem.)

Tyrbiter commented 1 month ago

I have done this, first with a 10 minute recording and then with one made using multi-Rx enabled which terminated as freedv-gui segfaulted.

On both occasions freedv_rx ran to the end of the raw file with outputs like this, I used -v to get some more output:

Large 10minute file (~58MB) frame: 40246 sync: 0 nin: 720 snr: -5.00 dB bit errors: 0 clock_off: 0.00 foff: 0.00 frames decoded: 40246 output speech samples: 57954240

Smaller sub-30s (~57KB) frame: 40 sync: 0 nin: 720 snr: -5.00 dB bit errors: 0 clock_off: 0.00 foff: 0.00 frames decoded: 40 output speech samples: 57600

I don't think this gets us anywhere much, if you have any further suggestions I will try to carry them out.

tmiw commented 1 month ago

Yeah, it seems like something in hamlib or freedv-gui itself is at fault. Maybe try disabling hamlib in the latter and see if the crash still happens?

Tyrbiter commented 1 month ago

I disabled Hamlib control in Tools->CAT and PTT Config page. Ran freedv-gui, a minute or two later libasan fired, but the debug output line with unpack_frame just before it does is from a Hamlib source file which makes no sense to me:

bdm@deangelis:~$ freedv 2>&1 [2024-08-08 22:07:03] [connect] Successful connection [2024-08-08 22:07:03] [connect] WebSocket Connection 208.85.243.198:80 v-2 "WebSocket++/0.8.2" /socket.io/?EIO=4&transport=websocket&t=1723151223 101 Setting callsign to G8SEZ PulseAudioDevice[Thu 08 Aug 2024 22:07:44 BST]: connecting to record device alsa_input.usb-CMEDIA_Q9-1-00.mono-fallback PulseAudioDevice[Thu 08 Aug 2024 22:07:44 BST]: connecting to playback device alsa_output.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_CODEC-00.analog-stereo PulseAudioDevice[Thu 08 Aug 2024 22:07:44 BST]: connecting to record device alsa_input.usb-BurrBrown_from_Texas_Instruments_USB_AUDIO_CODEC-00.analog-stereo PulseAudioDevice[Thu 08 Aug 2024 22:07:44 BST]: connecting to playback device alsa_output.usb-Generic_Realtek_USB2.0_Audio-00.analog-stereo txRxThread: timeout while waiting for CV, tx = 1 txRxThread: timeout while waiting for CV, tx = 0 txRxThread: timeout while waiting for CV, tx = 1 txRxThread: timeout while waiting for CV, tx = 0 txRxThread: timeout while waiting for CV, tx = 1 txRxThread: timeout while waiting for CV, tx = 0 unpack_frame Got a frame that was too small (<5) to be valid AddressSanitizer:DEADLYSIGNAL

==86767==ERROR: AddressSanitizer: SEGV on unknown address 0x7f73399829d0 (pc 0x7f7222a0b69e bp 0x7f71ec5fa330 sp 0x7f71ec5fa278 T20) ==86767==The signal is caused by a READ memory access.

0 0x7f7222a0b69e in pitch_gain_decode /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:337

#1 0x7f7222a0bbb9 in lpcnet_frame_to_features /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:423
#2 0x7f7222a0f6bc in lpcnet_dec (/lib64/liblpcnetfreedv.so.0.5+0xf6bc) (BuildId: 74d399fbec7c8fe8394f69664cb910b63cd2a1f3)
#3 0x7f7225da0abb in freedv_bits_to_speech (/lib64/libcodec2.so.1.2+0x2fabb) (BuildId: 5fcf7dae347ceda940698d7f927e43a68ddceaec)
#4 0x7f7225da4e91 in freedv_comprx (/lib64/libcodec2.so.1.2+0x33e91) (BuildId: 5fcf7dae347ceda940698d7f927e43a68ddceaec)
#5 0x557107651c94 in FreeDVReceiveStep::execute(std::shared_ptr<short>, int, int*) /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/FreeDVReceiveStep.cpp:100
#6 0x55710767673d in operator() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:215
#7 0x55710767673d in __invoke_impl<std::pair<std::shared_ptr<short int>, int>, ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>&, std::shared_ptr<short int>, int> /usr/include/c++/14/bits/invoke.h:61
#8 0x55710767673d in __invoke_r<std::pair<std::shared_ptr<short int>, int>, ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>&, std::shared_ptr<short int>, int> /usr/include/c++/14/bits/invoke.h:139
#9 0x55710767673d in operator() /usr/include/c++/14/future:1499
#10 0x55710767673d in operator() /usr/include/c++/14/future:1416
#11 0x55710767673d in __invoke_impl<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr<short int>, int> >, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr<short int>, int> >, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>, std::allocator<int>, std::pair<std::shared_ptr<short int>, int>(std::shared_ptr<short int>, int)>::_M_run(std::shared_ptr<short int>&&, int&&)::<lambda()>, std::pair<std::shared_ptr<short int>, int> >&> /usr/include/c++/14/bits/invoke.h:61
#12 0x55710767673d in __invoke_r<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr<short int>, int> >, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_state<ParallelStep::enqueueTask_(ThreadInfo*, IPipelineStep*, std::shared_ptr<short int>, int)::<lambda(std::shared_ptr<short int>, int)>, std::allocator<int>, std::pair<std::shared_ptr<short int>, int>(std::shared_ptr<short int>, int)>::_M_run(std::shared_ptr<short int>&&, int&&)::<lambda()>, std::pair<std::shared_ptr<short int>, int> >&> /usr/include/c++/14/bits/invoke.h:138
#13 0x55710767673d in _M_invoke /usr/include/c++/14/bits/std_function.h:291
#14 0x55710764d44a in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const /usr/include/c++/14/bits/std_function.h:591
#15 0x55710764d44a in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) /usr/include/c++/14/future:596
#16 0x7f72224aba4a in __pthread_once_slow.isra.0 (/lib64/libc.so.6+0x9ca4a) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#17 0x7f72224abab8 in pthread_once@GLIBC_2.2.5 (/lib64/libc.so.6+0x9cab8) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#18 0x55710780c0f3 in __gthread_once /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:713
#19 0x55710780c0f3 in void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) [clone .constprop.0] /usr/include/c++/14/mutex:916
#20 0x55710767268f in std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) /usr/include/c++/14/future:435
#21 0x55710767268f in _M_run /usr/include/c++/14/future:1501
#22 0x55710767268f in std::packaged_task<std::pair<std::shared_ptr<short>, int> (std::shared_ptr<short>, int)>::operator()(std::shared_ptr<short>, int) /usr/include/c++/14/future:1635
#23 0x55710767268f in ParallelStep::executeRunnerThread_(ParallelStep::ThreadInfo*) /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:202
#24 0x55710767268f in operator() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:54
#25 0x55710767268f in __invoke_impl<void, ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep*)>, std::function<int(ParallelStep*)>, std::vector<IPipelineStep*>, std::shared_ptr<void>)::<lambda(ParallelStep::ThreadInfo*)>, ParallelStep::ThreadInfo*> /usr/include/c++/14/bits/invoke.h:61
#26 0x55710767268f in __invoke<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep*)>, std::function<int(ParallelStep*)>, std::vector<IPipelineStep*>, std::shared_ptr<void>)::<lambda(ParallelStep::ThreadInfo*)>, ParallelStep::ThreadInfo*> /usr/include/c++/14/bits/invoke.h:96
#27 0x55710767268f in _M_invoke<0, 1> /usr/include/c++/14/bits/std_thread.h:301
#28 0x55710767268f in operator() /usr/include/c++/14/bits/std_thread.h:308
#29 0x55710767268f in _M_run /usr/include/c++/14/bits/std_thread.h:253
#30 0x7f72226e7563 in execute_native_thread_routine (/lib64/libstdc++.so.6+0xe7563) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)
#31 0x7f722565df95 in asan_thread_start(void*) (/lib64/libasan.so.8+0x5df95) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)
#32 0x7f72224a66d6 in start_thread (/lib64/libc.so.6+0x976d6) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#33 0x7f722252a60b in __clone3 (/lib64/libc.so.6+0x11b60b) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)

AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:337 in pitch_gain_decode Thread T20 created by T17 here:

0 0x7f72256ef871 in pthread_create (/lib64/libasan.so.8+0xef871) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

#1 0x7f72226e7638 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xe7638) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)
#2 0x5571077e7e4b in FreeDVInterface::createReceivePipeline(int, int, std::function<int* ()>, std::function<int ()>, std::function<int ()>, std::function<float ()>, std::function<float* ()>) [clone .constprop.0] /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/freedv_interface.cpp:630
#3 0x557107690bff in TxRxThread::initializePipeline_() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/TxRxThread.cpp:370
#4 0x55710769500a in TxRxThread::Entry() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/TxRxThread.cpp:463
#5 0x7f7223b7def5 in wxThreadInternal::PthreadStart(wxThread*) (/lib64/libwx_baseu-3.2.so.0+0x17def5) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#6 0x7f722565df95 in asan_thread_start(void*) (/lib64/libasan.so.8+0x5df95) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

Thread T17 created by T12 here:

0 0x7f72256ef871 in pthread_create (/lib64/libasan.so.8+0xef871) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

#1 0x7f7223b7f8c5 in wxThreadInternal::Create(wxThread*, unsigned int) (/lib64/libwx_baseu-3.2.so.0+0x17f8c5) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#2 0x7f7223b800e1 in wxThread::Create(unsigned int) (/lib64/libwx_baseu-3.2.so.0+0x1800e1) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#3 0x5571075a64ec in MainFrame::startRxStream() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:3004
#4 0x5571075abfe6 in MainFrame::performFreeDVOn_() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:2085
#5 0x5571075f37d4 in operator() /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:2310
#6 0x5571075f37d4 in __invoke_impl<void, MainFrame::OnTogBtnOnOff(wxCommandEvent&)::<lambda()> > /usr/include/c++/14/bits/invoke.h:61
#7 0x5571075f37d4 in __invoke<MainFrame::OnTogBtnOnOff(wxCommandEvent&)::<lambda()> > /usr/include/c++/14/bits/invoke.h:96
#8 0x5571075f37d4 in _M_invoke<0> /usr/include/c++/14/bits/std_thread.h:301
#9 0x5571075f37d4 in operator() /usr/include/c++/14/bits/std_thread.h:308
#10 0x5571075f37d4 in _M_run /usr/include/c++/14/bits/std_thread.h:253
#11 0x7f72226e7563 in execute_native_thread_routine (/lib64/libstdc++.so.6+0xe7563) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)

Thread T12 created by T0 here:

0 0x7f72256ef871 in pthread_create (/lib64/libasan.so.8+0xef871) (BuildId: 79824421bd82bb3ef4addf048e1265e2a93cfc64)

#1 0x7f72226e7638 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/lib64/libstdc++.so.6+0xe7638) (BuildId: 79db3efd5f1273ca8c42abd22d1d9fd63cffe57c)
#2 0x7f7223ba12de in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a12de) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#3 0x7f7223ba349c in wxEvtHandler::SearchDynamicEventTable(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a349c) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#4 0x7f7223ba37fc in wxEvtHandler::TryHereOnly(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a37fc) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#5 0x7f7223ba38ae in wxEvtHandler::ProcessEventLocally(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a38ae) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#6 0x7f7223ba39c1 in wxEvtHandler::ProcessEvent(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a39c1) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#7 0x7f7223ba4561 in wxEvtHandler::SafelyProcessEvent(wxEvent&) (/lib64/libwx_baseu-3.2.so.0+0x1a4561) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#8 0x7f72241a4d17 in gtk_togglebutton_clicked_callback (/lib64/libwx_gtk3u_core-3.2.so.0+0x3a4d17) (BuildId: 2c1c3158c0e564d008125464323151952a271b43)
#9 0x7f72216ae649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#10 0x7f72216de5f2 in signal_emit_unlocked_R.isra.0 (/lib64/libgobject-2.0.so.0+0x415f2) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#11 0x7f72216cf103 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32103) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#12 0x7f72216cf360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#13 0x7f72216cf422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#14 0x7f7221acb720 in gtk_button_do_release ../gtk/gtkbutton.c:1845
#15 0x7f7221acb720 in gtk_button_do_release ../gtk/gtkbutton.c:1832
#16 0x7f7221acb720 in gtk_real_button_released ../gtk/gtkbutton.c:1963
#17 0x7f72216ae649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#18 0x7f72216de71f in signal_emit_unlocked_R.isra.0 (/lib64/libgobject-2.0.so.0+0x4171f) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#19 0x7f72216cf103 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32103) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#20 0x7f72216cf360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#21 0x7f72216cf422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#22 0x7f7221acb55c in multipress_released_cb ../gtk/gtkbutton.c:666
#23 0x7f7221a8a11b in _gtk_marshal_VOID__INT_DOUBLE_DOUBLEv gtk/gtkmarshalers.c:4804
#24 0x7f72216cf253 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32253) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#25 0x7f72216cf360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#26 0x7f72216cf422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#27 0x7f7221ba6fda in gtk_gesture_multi_press_end ../gtk/gtkgesturemultipress.c:287
#28 0x7f72216b2c64 in g_cclosure_marshal_VOID__BOXEDv (/lib64/libgobject-2.0.so.0+0x15c64) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#29 0x7f72216cf253 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x32253) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#30 0x7f72216cf360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#31 0x7f72216cf422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#32 0x7f7221b9ec23 in _gtk_gesture_set_recognized ../gtk/gtkgesture.c:346
#33 0x7f7221b9ec23 in _gtk_gesture_check_recognized ../gtk/gtkgesture.c:387
#34 0x7f7221ba69b2 in gtk_gesture_handle_event ../gtk/gtkgesture.c:787
#35 0x7f7221baa21d in gtk_gesture_single_handle_event ../gtk/gtkgesturesingle.c:222
#36 0x7f7221b692d2 in gtk_event_controller_handle_event ../gtk/gtkeventcontroller.c:230
#37 0x7f7221d4ffcf in _gtk_widget_run_controllers ../gtk/gtkwidget.c:7447
#38 0x7f7221a8d633 in _gtk_marshal_BOOLEAN__BOXED gtk/gtkmarshalers.c:84
#39 0x7f72216ae649 in g_closure_invoke (/lib64/libgobject-2.0.so.0+0x11649) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#40 0x7f72216debcf in signal_emit_unlocked_R.isra.0 (/lib64/libgobject-2.0.so.0+0x41bcf) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#41 0x7f72216ce968 in signal_emit_valist_unlocked (/lib64/libgobject-2.0.so.0+0x31968) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#42 0x7f72216cf360 in g_signal_emit_valist (/lib64/libgobject-2.0.so.0+0x32360) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#43 0x7f72216cf422 in g_signal_emit (/lib64/libgobject-2.0.so.0+0x32422) (BuildId: 327e1dbd4b402ab1171d32553c27b5a07e36af7d)
#44 0x7f7221d5fe3b in gtk_widget_event_internal.part.0.lto_priv.0 ../gtk/gtkwidget.c:7812
#45 0x7f7221bf4327 in propagate_event_up ../gtk/gtkmain.c:2588
#46 0x7f7221bf4327 in propagate_event ../gtk/gtkmain.c:2691
#47 0x7f7221bf50a9 in gtk_main_do_event (/lib64/libgtk-3.so.0+0x1f50a9) (BuildId: 2175bb7e99409e4d1be5535206bd5347a7e88d46)
#48 0x7f72222cc806 in _gdk_event_emit ../gdk/gdkevents.c:73
#49 0x7f72222cc806 in _gdk_event_emit ../gdk/gdkevents.c:67
#50 0x7f72223063cd in gdk_event_source_dispatch ../gdk/wayland/gdkeventsource.c:124
#51 0x7f72215abe8b in g_main_context_dispatch_unlocked.lto_priv.0 (/lib64/libglib-2.0.so.0+0x5ce8b) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
#52 0x7f722160dc97 in g_main_context_iterate_unlocked.isra.0 (/lib64/libglib-2.0.so.0+0xbec97) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
#53 0x7f72215b1f36 in g_main_loop_run (/lib64/libglib-2.0.so.0+0x62f36) (BuildId: 36b60dbd02e796145a982d0151ce37202ec05649)
#54 0x7f7221befb34 in gtk_main (/lib64/libgtk-3.so.0+0x1efb34) (BuildId: 2175bb7e99409e4d1be5535206bd5347a7e88d46)
#55 0x7f72240f51f4 in wxGUIEventLoop::DoRun() (/lib64/libwx_gtk3u_core-3.2.so.0+0x2f51f4) (BuildId: 2c1c3158c0e564d008125464323151952a271b43)
#56 0x7f7223ab3179 in wxEventLoopBase::Run() (/lib64/libwx_baseu-3.2.so.0+0xb3179) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#57 0x7f7223a8f09c in wxAppConsoleBase::MainLoop() (/lib64/libwx_baseu-3.2.so.0+0x8f09c) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#58 0x7f7223af0cbf in wxEntry(int&, wchar_t**) (/lib64/libwx_baseu-3.2.so.0+0xf0cbf) (BuildId: 207c953a8813f2945a5b7a6a2fe82844cb0f7e00)
#59 0x5571075471f9 in main /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/main.cpp:184
#60 0x7f7222439087 in __libc_start_call_main (/lib64/libc.so.6+0x2a087) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#61 0x7f722243914a in __libc_start_main_alias_1 (/lib64/libc.so.6+0x2a14a) (BuildId: 77c77fee058b19c6f001cf2cb0371ce3b8341211)
#62 0x55710754dd44 in _start (/usr/bin/freedv+0xdad44) (BuildId: f3c4c6082e9d6c0bc4ae77fe9096a2e1a9559642)

==86767==ABORTING

tmiw commented 1 month ago

I think it's weird that hamlib code is even executing at all. Can you put a breakpoint on the line in hamlib that prints the "Got a frame that was too small (<5) to be valid" message and send over the stack trace once that gets hit?

Tyrbiter commented 1 month ago

OK, this isn't the full stack trace for all the threads, but here is one for the thread that hit the breakpoint:

unpack_frame Got a frame that was too small (<5) to be valid [Switching to Thread 0x7fffc02006c0 (LWP 124895)]

Thread 23 "FreeDV PS" hit Breakpoint 1, unpack_frame (msg=, frame=, frame_len=) at ../rigs/commradio/frame.c:115 115 return -RIG_ETRUNC;

and here's the thread stack:

Thread 23 (Thread 0x7fffc02006c0 (LWP 124895) "FreeDV PS"):

0 unpack_frame (msg=, frame=, frame_len=) at ../rigs/commradio/frame.c:115

    msg_len = <optimized out>
    msg_crc = <optimized out>
    crc = <optimized out>
    __func__ = "unpack_frame"

1 0x00007ffff4c0bb6e in lpcnet_frame_to_features (q=q@entry=0x51700017fb80, frame=frame@entry=0x50e00003ace0 "", features_out=features_out@entry=0x7fffc01fa490) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_quant.c:419

    i = 0
    d = <optimized out>
    pitch_ind = 1179027475
    pitch_gain_ind = 1164673145
    indexes = {1168018239, 1174437765, 1178096192, 1175062679, 1165676516}
    fract = <optimized out>
    err = {0 <repeats 18 times>}

2 0x00007ffff4c0f6bd in lpcnet_dec (lf=, frame=0x50e00003ace0 "", pcm=, pcm@entry=0x7fffc01fdc80) at /usr/src/debug/lpcnetfreedv-0.5-5.fc40.x86_64/src/lpcnet_freedv.c:66

    d = <optimized out>
    q = 0x51700017fb80
    net = 0x521000263500
    in_features = {0 <repeats 55 times>}
    features = {7769.28516, 5133.81348, 3405.50439, 7642.70215, 8517.33691, 2781.84644, 4207.44141, 3768.02954, 5073.40576, 8223.87988, 7658.23291, 11796.5625, 8834.14746, 4012.99316, 6589.49316, 7967.02246, 7508.02588, 5710.95605, 2460.21387, 4672.1958, 8586.76953, 11549.2266, 1.66913953e+13, 3.0611365e-41, -3282.30225, 4021.28271, 9648.05078, -5527.92969, -720.90625, 14448.0977, 4579.34863, 8249.7041, 1292.70471, 16938.8906, -13076.4434, 3552.32324, 5928.40332, -6133.2583, 9165.9873, -2297.27368, -876.881592, -6176.8252, -12926.0449, 13240.8535, 3796.90576, 14491.7578, 1556.34595, -2514.00098, -1242.84204, -10475.8936, 11044.3525, 63.1137695, -21647.9824, 13368.4932, 3764.20312}

3 0x00007ffff76e1abc in freedv_bits_to_speech (f=f@entry=0x7fffe03dc800, speech_out=speech_out@entry=0x7fffc01fdc80, demod_in=demod_in@entry=0x7fffc01fa640, rx_status=14) at /usr/src/debug/codec2-1.2.0-4.fc40.x86_64/src/freedv_api.c:957

    i = <optimized out>
    bits_per_codec_frame = 52
    data_bits_per_frame = <optimized out>
    frames = 3
    nout = 1440
    decode_speech = <optimized out>

4 0x00007ffff76e5e92 in freedv_comprx (f=0x7fffe03dc800, speech_out=0x7fffc01fdc80, demod_in=0x7fffc01fac40) at /usr/src/debug/codec2-1.2.0-4.fc40.x86_64/src/freedv_api.c:824

    rx_status = <optimized out>
    demod_in_short = 0x7fffc01fa640

5 0x0000555555732c95 in FreeDVReceiveStep::execute (this=0x50400028ee10, inputSamples=Python Exception <class 'gdb.error'>: value has been optimized out

, numInputSamples=, numOutputSamples=0x7fffbdb86630) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/FreeDVReceiveStep.cpp:100 newOutputSamples = nin = nout = outputSamples = input_buf = 0x7fffc01fe840 output_buf = 0x0 rx_fdm = 0x7fffc01fc460 rx_fdm_offset = 0x7fffc01fac40 inputPtr = 0x51c0001ac14a

6 0x000055555575773e in operator() (__closure=, inSamples=std::shared_ptr (use count 4, weak count 0) = {...}, numSamples=) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:215

    numOutputSamples = <optimized out>
    result = Python Exception <class 'gdb.error'>: value has been optimized out

    step = <optimized out>
    step = <optimized out>
    numOutputSamples = <optimized out>
    result = Python Exception <class 'gdb.error'>: value has been optimized out

7 std::invoke_impl<std::pair<std::sharedptr, int>, ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>&, std::shared_ptr, int> (f=) at /usr/include/c++/14/bits/invoke.h:61

8 std::invoke_r<std::pair<std::sharedptr, int>, ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>&, std::shared_ptr, int> (fn=) at /usr/include/c++/14/bits/invoke.h:139

9 operator() (__closure=) at /usr/include/c++/14/future:1499

    this = <optimized out>
    __args#0 = <optimized out>
    __args#1 = <optimized out>
    this = <optimized out>
    __args#0 = <optimized out>
    __args#1 = <optimized out>

10 std::future_base::_Task_setter<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >::operator() (this=) at /usr/include/c++/14/future:1416

11 std::invoke_impl<std::unique_ptr<std::future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >&> (__f=) at /usr/include/c++/14/bits/invoke.h:61

12 std::invoke_r<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>, std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> >&> (__fn=) at /usr/include/c++/14/bits/invoke.h:138

13 std::_Function_handler<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter>(), std::future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<std::pair<std::shared_ptr, int> >, std::future_base::_Result_base::_Deleter>, std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run(std::shared_ptr&&, int&&)::<lambda()>, std::pair<std::shared_ptr, int> > >::_M_invoke(const std::_Any_data &) (functor=) at /usr/include/c++/14/bits/std_function.h:291

14 0x000055555572e44b in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const (this=) at /usr/include/c++/14/bits/std_function.h:591

15 std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool) (this=, f=, did_set=0x7fffbdc09020) at /usr/include/c++/14/future:596

    __res = std::unique_ptr<std::__future_base::_Result_base> = {get() = <optimized out>}

16 0x00007ffff46aba4b in pthread_once_slow (once_control=0x50600063f588, init_routine=0x7ffff48e5f60 <std::once_proxy()>) at pthread_once.c:116

    __cancel_routine = 0x7ffff46ab910 <clear_once_control>
    __clframe = {__cancel_routine = 0x7ffff46ab910 <clear_once_control>, __cancel_arg = 0x50600063f588, __do_it = 1, __buffer = {__routine = 0x7ffff46ab8d0 <__pthread_cleanup_combined_routine_voidptr>, __arg = 0x7fffc01ff2a0, __canceltype = 0, __prev = 0x0}}
    val = <optimized out>
    newval = <optimized out>

17 0x00007ffff46abab9 in ___pthread_once (once_control=, init_routine=) at pthread_once.c:143

    val = <optimized out>

18 0x00005555558ed0f4 in __gthread_once (once=, func=) at /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:713

19 std::call_once<void (std::future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool>(std::once_flag&, void (std::__future_base::_State_baseV2::&&)(std::function<std::unique_ptr<std::future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool), std::future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>&&, bool&&) [clone .constprop.0] (once=..., f=@0x7fffbdc09160: (void (std::future_base::_State_baseV2::)(class std::__future_base::_State_baseV2 const, class std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter>()> , bool )) 0x55555572e370 <std::future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool)>) at /usr/include/c++/14/mutex:916

    __e = <optimized out>
    __callable = {____f = <optimized out>, ____args#0 = <optimized out>, ____args#1 = <optimized out>, ____args#2 = <optimized out>}
    __exec = {<No data fields>}

20 0x0000555555753690 in std::future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::future_base::_Result_base::_Deleter> ()>, bool) (__ignore_failure=false, this=0x50600063f570, __res=...) at /usr/include/c++/14/future:435

    __did_set = <optimized out>
    __did_set = <optimized out>

21 std::future_base::_Taskstate<ParallelStep::enqueueTask(ThreadInfo, IPipelineStep, std::shared_ptr, int)::<lambda(std::shared_ptr, int)>, std::allocator, std::pair<std::shared_ptr, int>(std::shared_ptr, int)>::_M_run (this=0x50600063f570, args#0=..., __args#1=@0x7fffbdc09030: 160) at /usr/include/c++/14/future:1501

    __boundfn = {__this = <optimized out>, ____args#0 = <optimized out>, ____args#1 = <optimized out>}
    __boundfn = {__this = <optimized out>, ____args#0 = <optimized out>, ____args#1 = <optimized out>}

22 std::packaged_task<std::pair<std::shared_ptr, int> (std::shared_ptr, int)>::operator()(std::shared_ptr, int) (this=, __args#0=std::shared_ptr (empty) = {...}, __args#1=) at /usr/include/c++/14/future:1635

23 ParallelStep::executeRunnerThread_ (this=, threadState=0x510000164440) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:202

    taskEntry = <optimized out>
    lock = {_M_device = <optimized out>, _M_owns = <optimized out>}

24 operator() (__closure=, threadState=0x510000164440) at /usr/src/debug/freedv-1.9.10-0.0.9.fc40.x86_64/src/pipeline/ParallelStep.cpp:54

    this = <optimized out>
    this = <optimized out>

25 std::invoke_impl<void, ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> (f=) at /usr/include/c++/14/bits/invoke.h:61

26 std::__invoke<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> (__fn=) at /usr/include/c++/14/bits/invoke.h:96

27 std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> >::_M_invoke<0, 1> (this=) at /usr/include/c++/14/bits/std_thread.h:301

28 std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> >::operator() (this=) at /usr/include/c++/14/bits/std_thread.h:308

29 std::thread::_State_impl<std::thread::_Invoker<std::tuple<ParallelStep::ParallelStep(int, int, bool, std::function<int(ParallelStep)>, std::function<int(ParallelStep)>, std::vector<IPipelineStep>, std::shared_ptr)::<lambda(ParallelStep::ThreadInfo)>, ParallelStep::ThreadInfo*> > >::_M_run(void) (this=) at /usr/include/c++/14/bits/std_thread.h:253

30 0x00007ffff48e7564 in std::execute_native_thread_routine (p=p@entry=0x503000b62600) at ../../../../../libstdc++-v3/src/c++11/thread.cc:104

    __t = std::unique_ptr<std::thread::_State> = {get() = <optimized out>}

31 0x00007ffff785df96 in asan_thread_start (arg=0x7fffe02b5000) at ../../../../libsanitizer/asan/asan_interceptors.cpp:234

    t = 0x7fffe02b5000
    self = 140736416712384
    args = {routine = 0x7ffff48e7550 <std::execute_native_thread_routine(void*)>, arg_retval = 0x503000b62600}
    sigset = {val = {0, 0, 72198327231315969, 140736954560512, 140736954560512, 0, 140736485898912, 24, 140736485898912, 1, 140736456602784, 140737346006620, 140736485901008, 30, 24, 140736485901008}}
    retval = <optimized out>

32 0x00007ffff46a66d7 in start_thread (arg=) at pthread_create.c:447

    ret = <optimized out>
    pd = <optimized out>
    out = <optimized out>
    unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140736416712384, -4172358358453479010, 140736416712384, -272, 0, 140736485898080, -4172358358432507490, -4172401681649788514}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
    not_first_call = <optimized out>

33 0x00007ffff472a60c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78

If you need more than this, let me know.

Tyrbiter commented 1 month ago

Changing the function name in the new Hamlib code has fixed this. I don't think the compiler/linker should be able to cause this bug, but the rename fix is good enough.