Skip to content

SoapyRemoteServer dies with SEGV on client disconnect #33

@bernerus

Description

@bernerus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions