GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Application crashes when the radio does not respond during connection · Issue #7642 · aethersdr/AetherSDR

Application crashes when the radio does not respond during connection #7642

New issue
Copy link
New issue
Copy link
Backlog
Backlog
Application crashes when the radio does not respond during connection#7642
Copy link
Labels
bugSomething isn't workingmaintainer-reviewRequires maintainer review before any action is takenpriority: highHigh priorityprotocolSmartSDR protocol

Description

@luczjanoo
luczjanoo
opened on Nov 28, 2026
Issue body actions

Report preparation

  • I used the AI-assisted bug report tool (Help → Support → File an Issue)
  • I have attached a support bundle or log file

What happened?

AetherSDR crashes when attempting to establish a network connection to an unresponsive Icom radio. Instead of handling the connection timeout gracefully, the application terminates with a segmentation fault.

Crash details:

  • Exception: EXC_BAD_ACCESS (SIGSEGV)
  • Invalid memory address: 0x0000000000000238
  • Crashed thread: AetherSDR-GUI (main thread)

Relevant stack trace:

QObject::thread() const
QMetaObject::invokeMethodImpl()
QTimer::singleShotImpl()
IcomSession::fail()
IcomStream::failed()

Suspected root cause (AI-assisted analysis):

There appears to be a potential use-after-free in IcomSession::fail().

The method emits disconnected(reason) before calling QTimer::singleShot() with this as its context object.

A synchronous signal handler may trigger IcomCivBackend::disconnectRadio(), which destroys the session via m_session.reset(). Execution then returns to IcomSession::fail(), potentially accessing an already destroyed object.

This would explain the segmentation fault in QObject::thread() during timer registration.

The suspected root cause has not been verified with a debugger.

What did you expect?

AetherSDR should handle an unresponsive Icom radio gracefully by displaying a connection timeout or connection failure message, safely releasing session resources, and returning to the disconnected state.

The application should remain operational and allow another connection attempt without requiring a restart.

Steps to reproduce

  1. Launch AetherSDR.
  2. Select a configured Icom radio.
  3. Ensure the radio is powered off or otherwise unreachable over the network.
  4. Attempt to connect to the radio.
  5. Wait for the connection attempt to time out.
  6. AetherSDR crashes with a segmentation fault.

AetherSDR version

26.11.4

Radio model & firmware

ICOM IC-7300MK2 1.03, IC-9700 (newet available firmware)

Operating system

macOS

OS version and hardware

macOS 27.2.1 (26B131), MacBook Air M5, ARM64, 24 GB RAM, Qt 6.12

Activity

  1. luczjanoo
    added
    bugSomething isn't working
    on Nov 28, 2026
  2. aethersdr-agent
    added
    claude-activeAetherClaude is actively working on this issue
    maintainer-reviewRequires maintainer review before any action is taken
    priority: highHigh priority
    protocolSmartSDR protocol
    on Nov 28, 2026
  3. aethersdr-agent commented on Nov 28, 2026

    @aethersdr-agent
    aethersdr-agentBot
    on Nov 28, 2026 – with AetherSDR-Agent
    Contributor
    More actions

    Thanks for the report. The crash log had enough in it to trace this in the source, and the AI's guess is correct. It is a use-after-free, and I found the exact chain that triggers it.

    Root cause

    IcomSession::fail() (src/core/backends/icom/IcomSession.cpp:186-211) does this:

    if (was || !reason.isEmpty())
        emit disconnected(reason);          // runs the handlers synchronously
    ...
    QTimer::singleShot(0, this, [this] { stop(); m_failing = false; });   // `this` may already be freed

    When the radio doesn't answer, here is what happens, all on the GUI thread and all synchronously:

    1. IcomStream::failed → IcomSession::fail("…no answer…")
    2. emit disconnected(reason) → IcomCivBackend::onSessionDisconnected() (IcomCivBackend.cpp:1764). Its last line is emit connectionError(reason).
    3. → RadioModel::onConnectionError() (RadioModel.cpp:8965) → emit connectionError(msg)
    4. → MainWindow::onConnectionError() (MainWindow.cpp:7481). If the connect was started from the radio chooser or drawer, m_pendingRadioTarget is set (performRadioSwitch, MainWindow_Session.cpp:508), so it calls failRadioSwitch(msg).
    5. failRadioSwitch() (MainWindow_Session.cpp:551-554) sees we're not connected and calls m_radioModel.disconnectFromRadio() directly.
    6. → IcomCivBackend::disconnectRadio() → m_session->stop(); m_session.reset(); (IcomCivBackend.cpp:1105-1108). This destroys the IcomSession.
    7. Control returns to step 2, inside the destroyed object's fail(). QTimer::singleShot(0, this, …) then calls this->thread() on freed memory and crashes.

    Your stack trace matches step 7 frame for frame (IcomSession::fail → QTimer::singleShotImpl → invokeMethodImpl → QObject::thread()). The bad address 0x238 is a field read through a null d_ptr, which fits freed memory that macOS's allocator has zeroed.

    Two related points:

    • The headless target (ModelRadioConnectionTarget) already defers its disconnectRadio(), so it isn't affected. Only the GUI radio-switch path tears down synchronously.
    • ~IcomSession() already calls stop(). When the session is destroyed during the emit, the deferred teardown has nothing left to do, so skipping it is safe.

    Proposed fix

    src/core/backends/icom/IcomSession.cpp, fail(): keep a guard across the emit and return early if a handler destroyed the session:

    const QPointer<IcomSession> self(this);
    if (was || !reason.isEmpty())
        emit disconnected(reason);
    if (!self)
        return;   // a handler tore the session down; ~IcomSession() already ran stop()
    QTimer::singleShot(0, this, [this] { stop(); m_failing = false; });

    Optional second layer: in MainWindow::failRadioSwitch(), defer the disconnectFromRadio() call with QTimer::singleShot(0, …) so a backend's error emit can never destroy the backend's own session mid-call. The other backends (HL2, ANAN, Flex) are exposed to the same re-entry pattern. I'd still keep the IcomSession guard, since it costs nothing and protects every other subscriber too.

    Regression test: tests/icom_session_lease_test.cpp (or a small new test) can connect a handler to IcomSession::disconnected that deletes the session, then trigger fail() through a stream failure. Without the guard this crashes under ASan; with it, the test passes and nothing fires after the session is destroyed.

    Handoff summary

    • Known: a deterministic use-after-free on any failed Icom connect started from the radio chooser. It also covers an unreachable or powered-off IC-7300MK2 or IC-9700. The code dates back to the original backend (feat(icom): Add Icom CIV backend for networked Icom radios #4784) and is platform-independent. macOS just makes it crash reliably.
    • Fix: a QPointer guard after emit disconnected() in IcomSession::fail(), optionally a deferred disconnectFromRadio() in failRadioSwitch(), plus a regression test.
    • Workaround until then: connecting from the Connection panel instead of the radio chooser or drawer most likely avoids the synchronous teardown. Make sure the radio is powered on and reachable before you connect.

    🤖 aethersdr-agent · cost: $0.6994 · model: claude-opus-5-5


    📍 Citation health check (Foundry Constitution Principle I): 1 resolved, 6 unresolved against /Users/aetherclaude/workspace/AetherSDR at origin/main.

    Unresolved citations (6)
    Citation Reason
    IcomCivBackend.cpp:1105-1108 file not found in workspace
    IcomCivBackend.cpp:1764 file not found in workspace
    MainWindow.cpp:7481 file not found in workspace
    MainWindow_Session.cpp:508 file not found in workspace
    MainWindow_Session.cpp:551-554 file not found in workspace
    RadioModel.cpp:8965 file not found in workspace
  4. aethersdr-agent
    removed
    claude-activeAetherClaude is actively working on this issue
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmaintainer-reviewRequires maintainer review before any action is takenpriority: highHigh priorityprotocolSmartSDR protocol

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.