Random application crash on Apple Silicon M1 (Qt 6.2.3)
-
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.
-
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.
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 -
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@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).
-
Do you still have similar dependencies loaded from different places ?
-
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.