Open MarhyCZ opened 8 months ago
So I also tried to cmake RTLSDR-Airband with Debug flag -DCMAKE_BUILD_TYPE=Debug
and run it with gdb.
SoapySDR: device 'driver=airspy,device_id=0' initialized
[New LWP 57]
[New LWP 58]
[LWP 58 exited]
Thread 6 "rtl_airband" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 57]
0x0000007ff7e0c744 in SoapySDRDevice_setupStream () from /usr/local/lib/libSoapySDR.so.0.8-3
backtrace shows:
#0 0x0000007ff7e0c744 in SoapySDRDevice_setupStream () from /usr/local/lib/libSoapySDR.so.0.8-3
#1 0x000000555556b46c in soapysdr_rx_thread (ctx=0x7ff7f3ce70) at /app/RTLSDR-Airband-4.2.0/src/input-soapysdr.cpp:315
#2 0x0000007ff7f9f118 in start (p=0x7ff6aa96a0) at src/thread/pthread_create.c:207
#3 0x0000007ff7f9d4c8 in __clone () at src/thread/aarch64/clone.s:28
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I also tried to build the SoapySDR libs with debug and run the Airband again:
(gdb) bt
#0 0x0000007ff7de3e9c in SoapySDRDevice_setupStream (device=<error reading variable: Cannot access memory at address 0x7ff6a1b368>,
direction=<error reading variable: Cannot access memory at address 0x7ff6a1b364>,
format=<error reading variable: Cannot access memory at address 0x7ff6a1b358>,
channels=<error reading variable: Cannot access memory at address 0x7ff6a1b350>,
numChans=<error reading variable: Cannot access memory at address 0x7ff6a1b348>,
args=<error reading variable: Cannot access memory at address 0x7ff6a1b340>) at /app/SoapySDR/lib/DeviceC.cpp:161
#1 0x000000555556b46c in soapysdr_rx_thread (ctx=0x7ff7f3ce70) at /app/RTLSDR-Airband-4.2.0/src/input-soapysdr.cpp:315
#2 0x0000007ff7f9f118 in start (p=0x7ff6a696b8) at src/thread/pthread_create.c:207
#3 0x0000007ff7f9d4c8 in __clone () at src/thread/aarch64/clone.s:28
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I started something similar in #444 with debian:bookworm-slim
and ran into issues with compile flags and different CPU support on the build vs run machine.
Are you building the docker container and running it on the same machine? What is the underlying hardware? One thing you can try is adding -DPLATFORM=native
to the cmake
command for rtl_airband, that will pass the -march=native
flag to the compiler.
It's interesting that using debian:bookworm-slim
is working for you but alpine:latest
is not. It looks like alpine has a pre-built soapy-sdr
package, it may be worth trying that one rather than building your own.
Thanks for a really quick reply! I will let you know after I try all of it.
Its true, that I am using github actions and compiling it for aarch64 (64 bit ARM for Raspberry PI..). But it is not cross compiling. The Actions create QEMU virtual machine with the same architecture.
But I will also try it in a Linux VM on x86.
I have already tried the prebuilt packages, that was my first try in "fixing it", but no fun.
Anyways its not dealbreaking when it works without issues on Debian base, but I will try to narrow the problem!
Hi, I tried to dockerize RTLSDR-Airband with alpine linux as a base image. It worked great using just librtlsdr driver. But when I also built it with SoapySDR support and then tried to use it, it segfaults just before starting the device.
The device works when I try to probe it inside alpine container and test rate using SoapySDRUtil. But RTLSDR-Airband segfaults. Can it be that Alpine uses smaller stack memory?
This works:
But when starting RTLSDR-Airband -> Last 2 lines from debug:
First I tried to use multi-stage build to make more optimized images, but in order to minimize errors, I also built it in one go. Still same error. When I used much bigger debian as a base, it worked right away. The alpine is nice that it gives 18-20MB image size.
Alpine Linux Dockerfile (using just one stage)
Working debian base:
rtl_airband.conf