Skip to content

Bug: Uncaught exceptions in NetworkManager worker thread cause std::terminate (Application Crash) #350

Closed

Description

@01SW

In C++, if an exception escapes a std::thread function, it triggers std::terminate(), which immediately crashes the program. The main thread cannot catch these exceptions using standard try/catch blocks.

This happens in NetworkManager.cpp inside the WaitForNewPackets function. Because this function runs in a background worker thread (m_thread_process), the throw; statements at the end of the catch blocks will crash the entire application whenever any network error occurs (like a packet parsing error or missing ZLIB), rather than allowing the program to handle it gracefully.

Activity

  1. adepierre commented on Apr 21, 2026

    @adepierre
    Owner

    Hello, yes I confirm this is the behaviour in C++ and the expected one in this case. Program should indeed terminate if you're trying to connect to a server with a different protocol version causing a protocol parsing error or a server with compression enabled without zlib available.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions