Skip to content
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

SoapyRemoteServer dies with SEGV on client disconnect #33

Open
bernerus opened this issue Oct 19, 2021 · 1 comment
Open

SoapyRemoteServer dies with SEGV on client disconnect #33

bernerus opened this issue Oct 19, 2021 · 1 comment

Comments

@bernerus
Copy link

When shutting down a remote client to HackRF, that connects both as a receiver and transmitter, 4 out of 5 times, the remote server dies from a SEGV in SoapyHackRF::hackrf_rx_callback on the memcpy statement.

I have dig into this and found this is caused by a thread started in the hackrf library continues to call the RX callback routine when the RX stream is closed. It is definitely some kind of race condition, depending on the order in which the threads are deleted. So when the transfer thread started by libhackrf happend so exit first, no problem occurs.
Problem is that SoapyHackRF does not have any handle for that thread.

I have put in a workaround in my code:

if (!_rx_stream.opened)  // Workaround to avoid SEGV on client disconnect.
		return(0);

right after locking the mutex, which seems to at least avoid the SEGV.
This is probably not the correct solution thogh.

@mossmann
Copy link
Contributor

mossmann commented Oct 1, 2022

@bernerus The latest HackRF release includes several stability improvements. Can you please let us know if you still have trouble with this release?
https://github.com/greatscottgadgets/hackrf/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants