Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-125036

Exceptions not propagating for ARM Macs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 6.6.3
    • Core: Event loop
    • None
    • Any build for ARM Mac
    • macOS

    Description

      Our app has many sanity checks which give a message then throw a C++ exception on failure.  The exception is caught in the event loop: code below. It allows users to continue working or at worst save changes then exit on their own.

      Code works in Qt 5 for Intel Macs or Windows, and in Qt 6 for Windows. Exception does not reach QApplication::notify on ARM Macs, but terminates immediately.  This makes a worse user experience.

      In general, users should have control over exception handling on all platforms.  Exception throw should mean "get me out of here", not "die suddenly"

      Note that signals/slots do not pass exceptions on any platforms.  The reported problem happens with ALL exception throws, even if no signal/slot.

      bool Our_Application::notify(QObject* receiver, QEvent* event)
      {
          bool done = true;

          try
         

      {         done = QApplication::notify(receiver, event);     }

          catch (fatal_exception &fatal)
         

      {         throw;                // abort.  Good place for a breakpoint     }

          catch (our_exception &other)
         

      {         QApplication::beep();    // beep and continue.  Usually follows a nil test with error message     }

          catch (...)                // unknown error.  Try to continue.  Problem may not even be serious
         

      {         QApplication::beep();     }

          return done;
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            turtlesoft.com Casey McDermoqt
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes