Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package soapy-remote for openSUSE:Factory 
checked in at 2026-11-16 09:08:01
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/soapy-remote (Old)
 and      /work/SRC/openSUSE:Factory/.soapy-remote.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "soapy-remote"

Mon Nov 16 09:08:01 2026 rev:13 rq:1397529 version:0.5.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/soapy-remote/soapy-remote.changes        
2026-10-15 12:19:04.794407750 +0200
+++ /work/SRC/openSUSE:Factory/.soapy-remote.new.1251/soapy-remote.changes      
2026-11-16 09:13:28.772399094 +0100
@@ -1,0 +2,11 @@
+Sat Nov 14 07:47:57 UTC 2026 - Martin Pluskal <[email protected]>
+
+- Update to version 0.5.4:
+  * Report stream lifecycle RPC failures as error codes instead of
+    throwing, fixing host abort and scheduler deadlock on lost link
+  * Fail the RPC receive when the peer closes mid-payload, fixing
+    a spin at full CPU while holding the device mutex
+  * Bound stream header bytes and elems in acquireRecv, rejecting
+    oversized headers that could overrun the endpoint buffers
+
+-------------------------------------------------------------------

Old:
----
  soapy-remote-0.5.3.tar.gz

New:
----
  soapy-remote-0.5.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ soapy-remote.spec ++++++
--- /var/tmp/diff_new_pack.o3QgYW/_old  2026-11-16 09:13:29.461427981 +0100
+++ /var/tmp/diff_new_pack.o3QgYW/_new  2026-11-16 09:13:29.462428023 +0100
@@ -20,7 +20,7 @@
 %define soapy_modver 0.8-3
 %define soapy_modname soapysdr%{soapy_modver}-module-remote
 Name:           soapy-remote
-Version:        0.5.3
+Version:        0.5.4
 Release:        0
 Summary:        Remote device support for Soapy SDR
 License:        BSL-1.0

++++++ soapy-remote-0.5.3.tar.gz -> soapy-remote-0.5.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.5.3/Changelog.txt 
new/SoapyRemote-soapy-remote-0.5.4/Changelog.txt
--- old/SoapyRemote-soapy-remote-0.5.3/Changelog.txt    2026-10-10 
16:29:13.000000000 +0200
+++ new/SoapyRemote-soapy-remote-0.5.4/Changelog.txt    2026-11-13 
09:06:22.000000000 +0100
@@ -1,3 +1,10 @@
+Release 0.5.4 (2026-11-13)
+==========================
+
+- Fixed bound stream header bytes and elems in acquireRecv (#114)
+- Fixed fail RPC receive when the peer closes mid-payload (#113)
+- Fixed report stream lifecycle RPC failures as error codes (#112)
+
 Release 0.5.3 (2026-10-10)
 ==========================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.5.3/client/Streaming.cpp 
new/SoapyRemote-soapy-remote-0.5.4/client/Streaming.cpp
--- old/SoapyRemote-soapy-remote-0.5.3/client/Streaming.cpp     2026-10-10 
16:29:13.000000000 +0200
+++ new/SoapyRemote-soapy-remote-0.5.4/client/Streaming.cpp     2026-11-13 
09:06:22.000000000 +0100
@@ -13,6 +13,7 @@
 #include <ciso646>
 #include <algorithm> //std::min, std::find
 #include <memory> //unique_ptr
+#include <exception> //std::exception
 
 std::vector<std::string> SoapyRemoteDevice::__getRemoteOnlyStreamFormats(const 
int direction, const size_t channel) const
 {
@@ -330,13 +331,23 @@
 {
     auto data = (ClientStreamData *)stream;
 
-    std::lock_guard<std::mutex> lock(_mutex);
-    SoapyRPCPacker packer(_sock);
-    packer & SOAPY_REMOTE_CLOSE_STREAM;
-    packer & data->streamId;
-    packer();
+    //closeStream() returns void, so a failure of the remote call can only be
+    //reported through the logger. This call is made from destructors (see
+    //~soapy_source_c() in gr-osmosdr), where an exception would terminate.
+    try
+    {
+        std::lock_guard<std::mutex> lock(_mutex);
+        SoapyRPCPacker packer(_sock);
+        packer & SOAPY_REMOTE_CLOSE_STREAM;
+        packer & data->streamId;
+        packer();
 
-    SoapyRPCUnpacker unpacker(_sock);
+        SoapyRPCUnpacker unpacker(_sock);
+    }
+    catch (const std::exception &ex)
+    {
+        SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyRemoteDevice::closeStream() 
FAIL: %s", ex.what());
+    }
 
     //cleanup local stream data
     delete data->endpoint;
@@ -358,19 +369,31 @@
 {
     auto data = (ClientStreamData *)stream;
 
-    std::lock_guard<std::mutex> lock(_mutex);
-    SoapyRPCPacker packer(_sock);
-    packer & SOAPY_REMOTE_ACTIVATE_STREAM;
-    packer & data->streamId;
-    packer & flags;
-    packer & timeNs;
-    packer & int(numElems);
-    packer();
+    //The stream API reports failures through its return value
+    //(see SoapySDR/Device.hpp). This call is made from the constructor of
+    //gr::block_executor (GNU Radio), where an exception on the block thread
+    //leaves the scheduler barrier unsatisfied (deadlock) instead of failing.
+    try
+    {
+        std::lock_guard<std::mutex> lock(_mutex);
+        SoapyRPCPacker packer(_sock);
+        packer & SOAPY_REMOTE_ACTIVATE_STREAM;
+        packer & data->streamId;
+        packer & flags;
+        packer & timeNs;
+        packer & int(numElems);
+        packer();
 
-    SoapyRPCUnpacker unpacker(_sock);
-    int result = 0;
-    unpacker & result;
-    return result;
+        SoapyRPCUnpacker unpacker(_sock);
+        int result = 0;
+        unpacker & result;
+        return result;
+    }
+    catch (const std::exception &ex)
+    {
+        SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyRemoteDevice::activateStream() 
FAIL: %s", ex.what());
+        return SOAPY_SDR_STREAM_ERROR;
+    }
 }
 
 int SoapyRemoteDevice::deactivateStream(
@@ -380,18 +403,30 @@
 {
     auto data = (ClientStreamData *)stream;
 
-    std::lock_guard<std::mutex> lock(_mutex);
-    SoapyRPCPacker packer(_sock);
-    packer & SOAPY_REMOTE_DEACTIVATE_STREAM;
-    packer & data->streamId;
-    packer & flags;
-    packer & timeNs;
-    packer();
+    //The stream API reports failures through its return value
+    //(see SoapySDR/Device.hpp). This call is made from the destructor of
+    //gr::block_executor (GNU Radio), which is noexcept: an exception thrown
+    //here aborts the whole application instead of returning an error code.
+    try
+    {
+        std::lock_guard<std::mutex> lock(_mutex);
+        SoapyRPCPacker packer(_sock);
+        packer & SOAPY_REMOTE_DEACTIVATE_STREAM;
+        packer & data->streamId;
+        packer & flags;
+        packer & timeNs;
+        packer();
 
-    SoapyRPCUnpacker unpacker(_sock);
-    int result = 0;
-    unpacker & result;
-    return result;
+        SoapyRPCUnpacker unpacker(_sock);
+        int result = 0;
+        unpacker & result;
+        return result;
+    }
+    catch (const std::exception &ex)
+    {
+        SoapySDR::logf(SOAPY_SDR_ERROR, "SoapyRemoteDevice::deactivateStream() 
FAIL: %s", ex.what());
+        return SOAPY_SDR_STREAM_ERROR;
+    }
 }
 
 int SoapyRemoteDevice::readStream(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SoapyRemote-soapy-remote-0.5.3/common/SoapyRPCUnpacker.cpp 
new/SoapyRemote-soapy-remote-0.5.4/common/SoapyRPCUnpacker.cpp
--- old/SoapyRemote-soapy-remote-0.5.3/common/SoapyRPCUnpacker.cpp      
2026-10-10 16:29:13.000000000 +0200
+++ new/SoapyRemote-soapy-remote-0.5.4/common/SoapyRPCUnpacker.cpp      
2026-11-13 09:06:22.000000000 +0100
@@ -109,6 +109,12 @@
         {
             throw std::runtime_error("SoapyRPCUnpacker::recv(payload) FAIL: 
"+std::string(_sock.lastErrorMsg()));
         }
+        //recv() returns 0 when the peer has closed the connection,
+        //the rest of the payload will never arrive
+        if (ret == 0)
+        {
+            throw std::runtime_error("SoapyRPCUnpacker::recv(payload) FAIL: 
connection closed by peer");
+        }
         bytesReceived += ret;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/SoapyRemote-soapy-remote-0.5.3/common/SoapyStreamEndpoint.cpp 
new/SoapyRemote-soapy-remote-0.5.4/common/SoapyStreamEndpoint.cpp
--- old/SoapyRemote-soapy-remote-0.5.3/common/SoapyStreamEndpoint.cpp   
2026-10-10 16:29:13.000000000 +0200
+++ new/SoapyRemote-soapy-remote-0.5.4/common/SoapyStreamEndpoint.cpp   
2026-11-13 09:06:22.000000000 +0100
@@ -201,6 +201,13 @@
     auto header = (const StreamDatagramHeader*)data.buff.data();
     size_t bytes = ntohl(header->bytes);
 
+    // The length is peer-controlled and must fit the endpoint buffer.
+    if (bytes > data.buff.size())
+    {
+        SoapySDR::logf(SOAPY_SDR_ERROR, "StreamEndpoint::acquireRecv(%d 
bytes), FAILED: buffer is %d bytes", int(bytes), int(data.buff.size()));
+        return SOAPY_SDR_STREAM_ERROR;
+    }
+
     if (_datagramMode and bytes > bytesRecvd)
     {
         SoapySDR::logf(SOAPY_SDR_ERROR, "StreamEndpoint::acquireRecv(%d 
bytes), FAILED %d\n"
@@ -211,7 +218,7 @@
     else while (bytesRecvd < bytes)
     {
         ret = _streamSock.recv(data.buff.data()+bytesRecvd, 
std::min<size_t>(SOAPY_REMOTE_SOCKET_BUFFMAX, bytes-bytesRecvd));
-        if (ret < 0)
+        if (ret <= 0)
         {
             SoapySDR::logf(SOAPY_SDR_ERROR, "StreamEndpoint::acquireRecv(), 
FAILED %s", _streamSock.lastErrorMsg());
             return SOAPY_SDR_STREAM_ERROR;
@@ -221,6 +228,13 @@
 
     const int numElemsOrErr = int(ntohl(header->elems));
 
+    // The element count is peer-controlled; it must fit one channel buffer.
+    if (numElemsOrErr > 0 and size_t(numElemsOrErr) > _buffSize)
+    {
+        SoapySDR::logf(SOAPY_SDR_ERROR, "StreamEndpoint::acquireRecv(%d 
elems), FAILED: buffer holds %d", int(numElemsOrErr), int(_buffSize));
+        return SOAPY_SDR_STREAM_ERROR;
+    }
+
     //dropped or out of order packets
     //TODO return an error code, more than a notification
     if (uint32_t(_lastRecvSequence) != uint32_t(ntohl(header->sequence)))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/SoapyRemote-soapy-remote-0.5.3/debian/changelog 
new/SoapyRemote-soapy-remote-0.5.4/debian/changelog
--- old/SoapyRemote-soapy-remote-0.5.3/debian/changelog 2026-10-10 
16:29:13.000000000 +0200
+++ new/SoapyRemote-soapy-remote-0.5.4/debian/changelog 2026-11-13 
09:06:22.000000000 +0100
@@ -1,3 +1,9 @@
+soapyremote (0.5.4-1) unstable; urgency=high
+
+  * Release 0.5.4 (2026-11-13)
+
+ -- Christian W. Zuckschwerdt <[email protected]>  Fri, 13 Nov 2026 08:00:00 -0000
+
 soapyremote (0.5.3-1) unstable; urgency=low
 
   * Release 0.5.3 (2026-10-10)

Reply via email to