-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation fault with trunk-recorder on Debian #59
Comments
Something is very confusing, the debug at the bottom... #1 0x00007f38ba5cc366 in SoapySDRPlay::readStream(SoapySDR::Stream*, void* const*, unsigned long, int&, long long&, long) () how can that be the case - why is it trying to use both?? Unless I'm misreading this? Can you not just get this to point to SoapySDR/SoapySDRPlay? |
osmosdr supports SoapySDR as a source... so any radio that SoapySDR supports can be used with osmosdr acting as a "pass-through". The data flow is SDRPlay -> SoapySDR -> osmosdr -> trunk-recorder. (Unfortunately trunk-recorder does not have native SoapySDR support.) Here is the osmosdr implementation: |
Set the sample rate to 2 MHz and see if the problem still exists. |
Unfortunately I won't be able to reproduce the problem with 2 MHz of bandwidth, as that is not wide enough for me to activate 3 or more recorder threads in trunk-recorder. I am recompiling everything with debugging symbols now in order to gather some more information. |
The siginfo si_addr is equal to _currentBuff, i.e. _currentBuff is set to an invalid address and SoapySDRPlay segfaults when we attempt to copy from that address into buff0. |
Attempt 2, I stared at this for a while and the buffer increment stuff in readstream looks fine. I'm a little suspicious of the buffer accounting in rx_callback:
But I'm not sure the So now the current tail buffer could be a buffer already given to the read thread, which in turn will now get resized and re-allocated larger than we expected to a new pointer because its size didnt get cleared because it was not yet released by the read thread. -- just a guess, but it seems like a buffer accounting issue. |
I just got a segfault with trunk-recorder running 2 recorder threads after about 30 hours of continuous operation. Normally, with 3 recorder threads, I get a segfault after somewhere between 10 seconds and 1 hour depending on how busy the receive threads are. The segfault always seems to happen when all available recorders are recording. My guess right now would be that the segfault is correlated with peak CPU usage, which makes sense if it is a race condition between the read and write threads. |
I can reproduce this issue. SoapySDRPlay: ccc0746 All other software is from Debian 10.4 x86-64. So far it seems that if I set For the core file, a gdb backtrace shows
|
I'm getting a similar segfault using linhpsdr (on Arch): g0orx/linhpsdr#84 |
I also have this issue on Windows (x86, MSVC). I get a crash in both GQrx and Quisk using SoapSDR. Here is the calll-stack when using SDRPlay in Quisk:
Very annoying since I have to unplug the SDRPlay from the USB-port and restart the SDRPlayAPI service to make the radio work again in e.g. SDRUno. Edit: |
For what it's worth, I updated to https://github.com/pothosware/SoapySDRPlay3/ and this issue appears to be fixed. I also pulled and rebuilt trunk-recorder, gr-osmosdr, and all of the soapy components. |
I'm getting a segfault from trunk-recorder:
I poked around the backtrace and it appears to point to SoapySDRPlay:
I have the 600 megabyte core dump file if anyone would like to examine it in more detail. (Or let me know what else you would like to see... happy to run any gdb commands to poke at the core dump on request.)
For what it's worth, I've reproduced this issue five times so far (and I have core dumps for four of those times... they all look the same to me). I have only been able to reproduce the issue when the radio system is busy and trunk-recorder is using 3 or more recorder threads. I've run for quite a long time with 2 recorder threads with no segfaults; when I switch back to 3 recorder threads, a segfault comes along within an hour or so (whenever the radio system gets busy).
Version information:
I am not sure whether to file this bug report under SoapySDRPlay, gr-osmosdr, or trunk-recorder... based on the backtrace, I decided to start with SoapySDRPlay.
Please let me know if there's any additional testing I can do, or any additional information I can provide.
The text was updated successfully, but these errors were encountered: