Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Random application crash on Apple Silicon M1 (Qt 6.2.3)
Forum Updated to NodeBB v4.3 + New Features

Random application crash on Apple Silicon M1 (Qt 6.2.3)

Scheduled Pinned Locked Moved Unsolved General and Desktop
66 Posts 10 Posters 17.2k Views 6 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #56

    Do you have the same issue if you use a Qt version coming from the online installer rather that brew ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    S 1 Reply Last reply
    0
    • S sultan

      I'm still having the same issue, same crash stack trace, on Mac OS 12.6.3 with Qt 6.4.2. I haven't yet gotten to trace my way to the root cause, though it looks like this will be a PITA to debug.

      D Offline
      D Offline
      DerReisende
      wrote on last edited by
      #57

      @sultan have you tried to completely remove homebrew from your system and then reinstall only the needed library for your app? I have seen a CERN ROOT framework crash that was related to a "wrong" library being somewhere in LD_LIBRARY_PATH which was causing the crashes similar to these described here.

      S 1 Reply Last reply
      1
      • SGaistS SGaist

        Do you have the same issue if you use a Qt version coming from the online installer rather that brew ?

        S Offline
        S Offline
        sultan
        wrote on last edited by
        #58

        @SGaist I am using the Qt 6.4.2 from the online official installer for Mac

        1 Reply Last reply
        0
        • D DerReisende

          @sultan have you tried to completely remove homebrew from your system and then reinstall only the needed library for your app? I have seen a CERN ROOT framework crash that was related to a "wrong" library being somewhere in LD_LIBRARY_PATH which was causing the crashes similar to these described here.

          S Offline
          S Offline
          sultan
          wrote on last edited by
          #59

          @DerReisende I think you're on the right track here. When launching the application from Qt Creator, it consistently crashes (after some random delay) when the computer has been rebooted recently. When launching the application from command line (going into the .app bundle's Contents/MacOS directory and invoking the executable from there), it never crashes. So there is definitely some library mismatch happening when launching through Qt creator that is avoided when launching from the command line.

          For reference, when launching from the command line (where it doesn't crash), PATH=opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin and LD_LIBRARY_PATH is not set. When launching from Qt Creator (where it crashes), PATH=/Users/sultan/Qt/6.4.2/macos/bin:/usr/bin:/bin:/usr/sbin:/sbin, QTDIR=/Users/sultan/Qt/6.4.2/macos, and LD_LIBRARY_PATH is again not set.

          S 1 Reply Last reply
          1
          • S sultan

            @DerReisende I think you're on the right track here. When launching the application from Qt Creator, it consistently crashes (after some random delay) when the computer has been rebooted recently. When launching the application from command line (going into the .app bundle's Contents/MacOS directory and invoking the executable from there), it never crashes. So there is definitely some library mismatch happening when launching through Qt creator that is avoided when launching from the command line.

            For reference, when launching from the command line (where it doesn't crash), PATH=opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin and LD_LIBRARY_PATH is not set. When launching from Qt Creator (where it crashes), PATH=/Users/sultan/Qt/6.4.2/macos/bin:/usr/bin:/bin:/usr/sbin:/sbin, QTDIR=/Users/sultan/Qt/6.4.2/macos, and LD_LIBRARY_PATH is again not set.

            S Offline
            S Offline
            sultan
            wrote on last edited by
            #60

            @sultan said in Random application crash on Apple Silicon M1 (Qt 6.2.3):

            @DerReisende I think you're on the right track here. When launching the application from Qt Creator, it consistently crashes (after some random delay) when the computer has been rebooted recently. When launching the application from command line (going into the .app bundle's Contents/MacOS directory and invoking the executable from there), it never crashes. So there is definitely some library mismatch happening when launching through Qt creator that is avoided when launching from the command line.

            For reference, when launching from the command line (where it doesn't crash), PATH=opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin and LD_LIBRARY_PATH is not set. When launching from Qt Creator (where it crashes), PATH=/Users/sultan/Qt/6.4.2/macos/bin:/usr/bin:/bin:/usr/sbin:/sbin, QTDIR=/Users/sultan/Qt/6.4.2/macos, and LD_LIBRARY_PATH is again not set.

            It seems just launching the application from Finder (by clicking on the .app bundle) also works properly with no crash - at least I have not been able to reproduce any crashes that way, whereas I've been able to reproduce this crash almost a dozen times today when launching the app via Qt Creator (soon after a reboot).

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jcelerier
              wrote on last edited by jcelerier
              #61

              Same crash here, happened consistently as soon as I did a filesystem save operation in my soft: i could fix it by unchecking "Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEORK_PATH" in Qt Creator's Project > Run tab.

              @sultan note that LD_LIBRARY_PATH is for ELF platforms, MacOS uses DYLD_LIBRARY_PATH

              Trying on a terminal, I can see that just adding /opt/homebrew/lib to DYLD_LIBRARY_PATH is sufficient to trigger the crash.

              J 1 Reply Last reply
              0
              • J jcelerier

                Same crash here, happened consistently as soon as I did a filesystem save operation in my soft: i could fix it by unchecking "Add build library search path to DYLD_LIBRARY_PATH and DYLD_FRAMEORK_PATH" in Qt Creator's Project > Run tab.

                @sultan note that LD_LIBRARY_PATH is for ELF platforms, MacOS uses DYLD_LIBRARY_PATH

                Trying on a terminal, I can see that just adding /opt/homebrew/lib to DYLD_LIBRARY_PATH is sufficient to trigger the crash.

                J Offline
                J Offline
                jcelerier
                wrote on last edited by
                #62

                Continuing my investigations:
                here are 2 runs of my app, one with DYLD_LIBRARY_PATH=/opt/homebrew/lib and one without, using DYLD_PRINT_LIBRARIES=1 to see the libs that macOS loads:

                the one that is ok: https://paste.ofcode.org/YgwDFyPekpfvAQXbLp5wYk

                the one that crashes: https://paste.ofcode.org/et4HZsbsAGkLPMV2QcPd2w

                the interesting thing: if I diff them, the only difference is that the one that crashes DOES NOT load the following libraries ; everything else is exactly the same:

                84,85d83
                < dyld[]: <271619EF-D975-32A9-9B21-2CEE5C381F47> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
                < dyld[]: <2790BC66-2CD0-30E7-B81D-B11D9E6330B5> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
                243d240
                < dyld[]: <80591A2A-E778-357E-B1BE-A5042EF1BE6F> /usr/lib/liblzma.5.dylib
                469d465
                < dyld[]: <E736DF38-E016-342B-A030-80A029E8E3FD> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
                481d476
                < dyld[]: <EAAE7B56-3345-35A0-B22B-4F7A7C35A3AE> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib

                SGaistS 1 Reply Last reply
                0
                • J jcelerier

                  Continuing my investigations:
                  here are 2 runs of my app, one with DYLD_LIBRARY_PATH=/opt/homebrew/lib and one without, using DYLD_PRINT_LIBRARIES=1 to see the libs that macOS loads:

                  the one that is ok: https://paste.ofcode.org/YgwDFyPekpfvAQXbLp5wYk

                  the one that crashes: https://paste.ofcode.org/et4HZsbsAGkLPMV2QcPd2w

                  the interesting thing: if I diff them, the only difference is that the one that crashes DOES NOT load the following libraries ; everything else is exactly the same:

                  84,85d83
                  < dyld[]: <271619EF-D975-32A9-9B21-2CEE5C381F47> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
                  < dyld[]: <2790BC66-2CD0-30E7-B81D-B11D9E6330B5> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
                  243d240
                  < dyld[]: <80591A2A-E778-357E-B1BE-A5042EF1BE6F> /usr/lib/liblzma.5.dylib
                  469d465
                  < dyld[]: <E736DF38-E016-342B-A030-80A029E8E3FD> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
                  481d476
                  < dyld[]: <EAAE7B56-3345-35A0-B22B-4F7A7C35A3AE> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by SGaist
                  #63

                  @jcelerier it seems a bit more convoluted than that.

                  For example, both run have lzma loaded but from two different locations. I am wondering whether there is some incompatibility between loaded libraries (not necessarily lzma maybe others as well).

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • J Offline
                    J Offline
                    jcelerier
                    wrote on last edited by
                    #64

                    still happening as of Qt 6.7.1 :/

                    1 Reply Last reply
                    0
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #65

                      Do you still have similar dependencies loaded from different places ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        sarkara
                        wrote on last edited by
                        #66

                        While investigating a similar crash from a different (non-QT) app, I narrowed it down to libpng from Homebrew. I opened a discussion on https://github.com/orgs/Homebrew/discussions/5420.

                        1 Reply Last reply
                        0

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved