Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package indi for openSUSE:Factory checked in at 2025-12-18 18:35:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/indi (Old) and /work/SRC/openSUSE:Factory/.indi.new.1928 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "indi" Thu Dec 18 18:35:29 2025 rev:19 rq:1323482 version:2.1.7 Changes: -------- --- /work/SRC/openSUSE:Factory/indi/indi.changes 2025-12-05 16:58:10.036251829 +0100 +++ /work/SRC/openSUSE:Factory/.indi.new.1928/indi.changes 2025-12-18 18:36:50.747207789 +0100 @@ -1,0 +2,6 @@ +Thu Dec 18 07:37:44 UTC 2025 - Paolo Stivanin <[email protected]> + +- Add fix-safety-monitor.patch +- Add fix-infinite-loop.patch + +------------------------------------------------------------------- New: ---- fix-infinite-loop.patch fix-safety-monitor.patch ----------(New B)---------- New:- Add fix-safety-monitor.patch - Add fix-infinite-loop.patch New: - Add fix-safety-monitor.patch - Add fix-infinite-loop.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ indi.spec ++++++ --- /var/tmp/diff_new_pack.PUB3L2/_old 2025-12-18 18:36:51.375234174 +0100 +++ /var/tmp/diff_new_pack.PUB3L2/_new 2025-12-18 18:36:51.379234342 +0100 @@ -30,6 +30,10 @@ URL: https://www.indilib.org/ Source0: https://github.com/indilib/indi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: indi-rpmlintrc +# PATCH-FIX-UPSTREAM https://github.com/indilib/indi/commit/9ce200b65d65ae2d5e4d25796049273d99fcf41e +Patch0: fix-safety-monitor.patch +# PATCH-FIX-UPSTREAM https://github.com/indilib/indi/commit/7891ede769f350db0b8117e2a3182b204230a055 +Patch1: fix-infinite-loop.patch BuildRequires: cmake BuildRequires: gcc%{?force_gcc_version}-c++ >= 12 %if 0%{?suse_version} < 1600 ++++++ fix-infinite-loop.patch ++++++ >From 8d123d976aa0e68fbc0918db1119282a9f071102 Mon Sep 17 00:00:00 2001 From: Jasem Mutlaq <[email protected]> Date: Mon, 15 Dec 2025 17:52:39 +0300 Subject: [PATCH] Fix infinite loop when read=0 --- libs/indibase/connectionplugins/ttybase.cpp | 34 +++++++++++++++++++++ libs/indicore/indicom.c | 18 +++++++++++ 2 files changed, 52 insertions(+) diff --git a/libs/indibase/connectionplugins/ttybase.cpp b/libs/indibase/connectionplugins/ttybase.cpp index e6247782bd..bfee729ce1 100644 --- a/libs/indibase/connectionplugins/ttybase.cpp +++ b/libs/indibase/connectionplugins/ttybase.cpp @@ -166,6 +166,8 @@ TTYBase::TTY_RESPONSE TTYBase::read(uint8_t *buffer, uint32_t nbytes, uint8_t ti uint32_t numBytesToRead = nbytes; int bytesRead = 0; + int zero_read_count = 0; + const int MAX_ZERO_READS = 3; TTY_RESPONSE timeoutResponse = TTY_OK; *nbytes_read = 0; @@ -185,6 +187,21 @@ TTYBase::TTY_RESPONSE TTYBase::read(uint8_t *buffer, uint32_t nbytes, uint8_t ti if (bytesRead < 0) return TTY_READ_ERROR; + if (bytesRead == 0) + { + zero_read_count++; + if (zero_read_count >= MAX_ZERO_READS) + { + DEBUGFDEVICE(m_DriverName, m_DebugChannel, + "%s: Device not responding (zero bytes read %d times)", __FUNCTION__, MAX_ZERO_READS); + return TTY_READ_ERROR; + } + usleep(10000); // 10ms delay before retry + continue; + } + + zero_read_count = 0; // Reset counter on successful read + DEBUGFDEVICE(m_DriverName, m_DebugChannel, "%d bytes read and %d bytes remaining...", bytesRead, numBytesToRead - bytesRead); for (uint32_t i = *nbytes_read; i < (*nbytes_read + bytesRead); i++) @@ -210,6 +227,8 @@ TTYBase::TTY_RESPONSE TTYBase::readSection(uint8_t *buffer, uint32_t nsize, uint return TTY_ERRNO; int bytesRead = 0; + int zero_read_count = 0; + const int MAX_ZERO_READS = 3; TTY_RESPONSE timeoutResponse = TTY_OK; *nbytes_read = 0; memset(buffer, 0, nsize); @@ -230,6 +249,21 @@ TTYBase::TTY_RESPONSE TTYBase::readSection(uint8_t *buffer, uint32_t nsize, uint if (bytesRead < 0) return TTY_READ_ERROR; + if (bytesRead == 0) + { + zero_read_count++; + if (zero_read_count >= MAX_ZERO_READS) + { + DEBUGFDEVICE(m_DriverName, m_DebugChannel, + "%s: Device not responding (zero bytes read %d times)", __FUNCTION__, MAX_ZERO_READS); + return TTY_READ_ERROR; + } + usleep(10000); // 10ms delay before retry + continue; + } + + zero_read_count = 0; // Reset counter on successful read + DEBUGFDEVICE(m_DriverName, m_DebugChannel, "%s: buffer[%d]=%#X (%c)", __FUNCTION__, (*nbytes_read), *read_char, *read_char); (*nbytes_read)++; diff --git a/libs/indicore/indicom.c b/libs/indicore/indicom.c index 529db938db..f42e618058 100644 --- a/libs/indicore/indicom.c +++ b/libs/indicore/indicom.c @@ -597,6 +597,9 @@ int tty_read_expanded(int fd, char *buf, int nbytes, long timeout_seconds, long buffer = geminiBuffer; } + int zero_read_count = 0; + const int MAX_ZERO_READS = 3; + while (numBytesToRead > 0) { if ((err = tty_timeout_microseconds(fd, timeout_seconds, timeout_microseconds))) { @@ -610,6 +613,21 @@ int tty_read_expanded(int fd, char *buf, int nbytes, long timeout_seconds, long if (bytesRead < 0) return TTY_READ_ERROR; + if (bytesRead == 0) + { + zero_read_count++; + if (zero_read_count >= MAX_ZERO_READS) + { + if (tty_debug) + IDLog("%s: Device not responding (zero bytes read %d times)\n", __FUNCTION__, MAX_ZERO_READS); + return TTY_READ_ERROR; + } + usleep(10000); // 10ms delay before retry + continue; + } + + zero_read_count = 0; // Reset counter on successful read + if (tty_debug) { IDLog("%d bytes read and %d bytes remaining...\n", bytesRead, numBytesToRead - bytesRead); ++++++ fix-safety-monitor.patch ++++++ >From 7891ede769f350db0b8117e2a3182b204230a055 Mon Sep 17 00:00:00 2001 From: Jasem Mutlaq <[email protected]> Date: Thu, 4 Dec 2025 11:34:13 +0300 Subject: [PATCH] Fix critical bug in safety monitor where client status check did not trigger a callback --- drivers/auxiliary/safetymonitor_client.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/auxiliary/safetymonitor_client.cpp b/drivers/auxiliary/safetymonitor_client.cpp index 7f1893daf3..a38fe652ef 100644 --- a/drivers/auxiliary/safetymonitor_client.cpp +++ b/drivers/auxiliary/safetymonitor_client.cpp @@ -106,16 +106,13 @@ void SafetyMonitorClient::updateProperty(INDI::Property property) { if (property.getDeviceName() == m_DeviceName && property.isNameMatch("SAFETY_STATUS")) { - if (m_SafetyStatusLP.getState() != property.getState()) - { - m_SafetyStatusLP = property; - LOGF_INFO("Safety Monitor Client: Updated safety status from %s, state: %s", - m_DeviceName.c_str(), pstateStr(m_SafetyStatusLP.getState())); + m_SafetyStatusLP = property; + LOGF_INFO("Safety Monitor Client: Updated safety status from %s, state: %s", + m_DeviceName.c_str(), pstateStr(m_SafetyStatusLP.getState())); - // Notify parent driver of status change - if (m_StatusCallback) - m_StatusCallback(); - } + // Notify parent driver of status change + if (m_StatusCallback) + m_StatusCallback(); } }
