-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS segfault on launch due to relocatable Qt #9920
Comments
Commented by: Be-ing We just updated the build environment to Qt 5.14.1. Can you test if the latest build from our build server crashes too? http://downloads.mixxx.org/builds/master/release/mixxx-2.3.0-alpha-pre-master-release-macintel64-latest.dmg |
Commented by: Be-ing Also can you attach a backtrace? |
Commented by: Be-ing Did you build with scons or cmake? |
Commented by: bengl3rt I reproduce the crash with the bundle in the linked DMG also. Built with icons. |
Commented by: bengl3rt built with scons* darn autocorrect |
Commented by: bengl3rt Yes it looks like it reproduces with that hash. Backtraces attached. |
Commented by: Be-ing Interesting backtrace... can you try renaming the file ~/Library/Application Support/Mixxx/samplers.xml ? If that doesn't fix it, try building with the old build environment that has Qt 5.12.0: http://downloads.mixxx.org/builds/buildserver/2.3.x-macosx/2.3-j00004-497fe02e-osx10.11-x86_64-release.tar.gz |
Commented by: Be-ing Err, that build environment has Qt 5.12.4, not 5.12.0. There was a major performance issue on macOS with 5.12.0. |
Commented by: bengl3rt That file doesn't exist, I've never launched Mixxx successfully on this machine (and have only attempted bleeding edge builds/bundles).
The build against the older Qt doesn't appear to want to launch at all:
Abort trap: 6 |
Commented by: Be-ing Are you able to build Mixxx installing the dependencies from Homebrew? |
Commented by: foss-4 Confirmed. Opening todays master http://downloads.mixxx.org/builds/master/release/mixxx-2.3.0-alpha-pre-master-git7224-release-macintel64.dmg results in crash (available 30 days): mixxx-2.3.0-alpha-pre-master-git7221-release-macintel64.dmg 2020-04-05 mixxx-2.3.0-alpha-pre-master-git7219-release-macintel64.dmg 2020-04-04 So breaking change was introduced 2020-04-04. |
Commented by: Be-ing Thanks for testing. Two Jenkins jobs ran between those builds: https://builds.renegadetech.mixxx.org/job/master-release/architecture=amd64,platform=macosx/1042/ So I think the problem is with the new build environment. |
Commented by: Be-ing I can't explain the problem with the old build environment reported in comment #11, but it's different from the segmentation fault originally reported in this bug. |
Commented by: Be-ing Qt 5.14.2 was released 2 days after I updated the build environment. A new build environment with Qt 5.14.2 is building now: I also set Jenkins to clear the workspace before each build. Hopefully between those two changes this will work. |
Commented by: Be-ing New macOS build with Qt 5.14.2 is here: |
Commented by: Be-ing New build environment with Qt 5.14.2 is here: |
Commented by: foss-4 Still crashing :( |
Commented by: bengl3rt Not sure which env/QT version you wanted me to build against, so I used the newest one from today:
I am seeing a different (but consistent) crashpoint than the one posted by Foss-4. (lldb) bt
|
Commented by: Be-ing Yeah that backtrace looks totally different from the one in #19 :( Maybe try running scons with vinylcontrol=0 ? I am somehow doubting that VinylControlProcessor is actually the problem... |
Commented by: Be-ing Ben, can you try the build that Foss-4 said was the last working one in #13? http://downloads.mixxx.org/builds/master/release/mixxx-2.3.0-alpha-pre-master-git7219-release-macintel64.dmg |
Commented by: foss-4 https://bin.disroot.org/?4c8197a04598f47d#⁠9LUsniUyCPHCvBeASoWsMopjJHLRi2RtMHNC6q5hq4Kr |
Commented by: daschuer I am not sure if you are on the right track.
.. in "libdyld" This is is MacOSs dynamic linker. I guess the crash disappears if we use here
while(false) Interestingly we have not a single debug info in the call stack. But the thread name is already set. This means we have passed
So maybe we are in the thread destroy code somehow. |
Commented by: daschuer If you search the web for "stack_not_16_byte_aligned_error" you find some explanations mentions AVX issues. Does the new QT version make more use of these registers? |
Commented by: Be-ing Maybe it is a compiler bug? |
Commented by: bengl3rt Using the bundle in mixxx-2.3.0-alpha-pre-master-git7232-release-macintel64.dmg, I reproduce the logging-related crash that's patched out on the macos_segfault_hack branch:
However, building locally from either master OR the macos_segfault_hack branch, I get the crash in the VinylControlProcessor thread. Good news (?) is that |
Commented by: bengl3rt I am indeed running a version of clang that the VLC folks would consider troublesome:
|
Commented by: Be-ing What if you build master locally using dependencies from Homebrew rather than our prebuilt environment? |
Commented by: daschuer If this is a Compiler Bug, it would be interesting which statement triggers the bug. Typically such issue come and go depending which memory is sllig ef before. Do we have the prove that the Qt version triggers the issue? Does the release include any avx register optimisation? |
Commented by: Be-ing
As reported in comment #13, the crashes started when the new build environment was first used. The change to the build environment was upgrading Qt. AFAIK nothing else changed on the build server that would change the produced build environment. |
Commented by: Be-ing Ben, if you update XCode and build master using our prebuilt environment, does it still crash? |
Commented by: bengl3rt Nope, master builds and runs happily on the same build of macOS with the same environment but a newer clang (different machine cause the other one is out of disk space): ben@Banger-Factory mixxx % sw_vers |
Commented by: Be-ing Well that's interesting. The Clang version string that you said is working (1100.0.33.17) corresponds to XCode 11.3.1, but the Clang version that didn't work (1103.0.32.29) corresponds to XCode 11.4. On that VLC bug report, they said that XCode 11.0 through 11.2 had the bug. The user who reported that bug with VLC said that it worked with the same compiler you say works with XCode 11.3.1. Maybe there is some other difference between the machines you built on. Can you try the latest build from our build server on the machine you did the working build? http://downloads.mixxx.org/builds/master/release/mixxx-2.3.0-alpha-pre-master-git7243-release-macintel64.dmg Another puzzling aspect to this is that the version of clang on our build server is 900.0.31. I can't find what version of XCode this version of clang corresponds to that table on Wikipedia nor searching the web. The closest match is XCode 9.0. Perhaps this is actually an old bug that was present in Clang for a long time but somehow didn't come out until building Mixxx with Qt 5.14. |
Commented by: bengl3rt The build in mixxx-2.3.0-alpha-pre-master-git7243-release-macintel64.dmg does not launch on the machine (Banger-Factory) that produced the working build using clang 1100.0.33.17, instead crashing here: Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_ACCESS (SIGSEGV) Termination Signal: Segmentation fault: 11 VM Regions Near 0x10:
|
Commented by: rryan Versions on the build server VM:
iOS Simulator SDKs: macOS SDKs: tvOS SDKs: tvOS Simulator SDKs: watchOS SDKs: watchOS Simulator SDKs:
|
Commented by: rryan Here is qobject.cpp compiler invocation in Qt 5.12.? (build 5 from Sep 2019): /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -include.pch/QtCore/c++_x86_64 -pipe -stdlib=libc++ -g -O3 -std=c++1y -fapplication-extension -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.12 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Winconsistent-missing-override -Wobjc-interface-ivars -Wobjc-method-access -Wobjc-multiple-method-names -Werror=unguarded-availability -Werror=unguarded-availability-new -Werror=unsupported-availability-guard -fPIC -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty -I../3rdparty/double-conversion/include -I../3rdparty/double-conversion/include/double-conversion -I../3rdparty/forkfd -I../3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.12.3 -I../../include/QtCore/5.12.3/QtCore -I.moc -I.tracegen -I../3rdparty/pcre2/src -I/Users/mixxx/bs-2.3-mac/amd64/environment/2.3-j00005-0a61174e-osx10.11-x86_64-release/include -I../../mkspecs/macx-clang -o .obj/qobject.o kernel/qobject.cpp Here is the qobject.cpp compiler invocation in Qt 5.14.2 (build 8) /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -include.pch/QtCore_x86_64.pch/c++_x86_64 -pipe -stdlib=libc++ -g -O3 -std=c++1y -fapplication-extension -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.13 -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -Winconsistent-missing-override -Wobjc-interface-ivars -Wobjc-method-access -Wobjc-multiple-method-names -Werror=unguarded-availability -Werror=unguarded-availability-new -Werror=unsupported-availability-guard -fPIC -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty -I../3rdparty/double-conversion/include -I../3rdparty/harfbuzz/src -I../3rdparty/forkfd -I../3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.14.2 -I../../include/QtCore/5.14.2/QtCore -I.moc -I.tracegen -I../3rdparty/pcre2/src -I/Users/mixxx/bs-2.3-mac/amd64/environment/2.3-j00008-c18d8fda-osx10.11-x86_64-release/include -I../../mkspecs/macx-clang -o .obj/qobject.o kernel/qobject.cpp |
Commented by: rryan The main diff I see is -mmacosx-version-min=10.12 vs -mmacosx-version-min=10.13. |
Commented by: rryan The git7247 release build also segfaults for me on startup: https://paste.debian.net/1139828/ I built 81a62fc locally with the 2.3-j00008-c18d8fda-osx10.11-x86_64-release environment on 10.14.6 with Xcode 11.3.1. A debug build with optimize=portable launches fine, but many debug assertions are failing. I'm building in release mode with optimize=native now. |
Commented by: rryan build=release optimize=native also works on 81a62fc with the 2.3-j00008-c18d8fda-osx10.11-x86_64-release environment on 10.14.6 with Xcode 11.3.1. The build is disturbingly slow and laggy -- with no decks playing the CPU usage is very high and it takes a few seconds for actions to complete (like opening the sidebar in Deere, or opening preferences). |
Commented by: rryan I can reproduce with a locally built binary if I bundle (not just build). It looks like some bad interaction between QCoreApplication initialization and QLibraryLoader. Looking at the code it's crashing around: I'll build the environment locally so I can stick some printlines in Qt. |
Commented by: Be-ing Great, thank you for looking into this tricky bug RJ. |
Commented by: rryan My locally built environment (macOS 10.5 SDK, Xcode 11.3.1) successfully repros the issue. The crash happens on this line: I believe this is because we don't ship Qt as frameworks on macOS, we ship the raw library dylibs outside of a framework. So the "bundle" lookups on this line: This code was added in this commit (9/2019): And it looks like they already tried to mitigate the crash when the bundle is not found: It would be nice if they fell back on the dlopen approach instead of just crashing... Here's my list of fixes, in order to try:
|
Commented by: rryan I'm trying -no-relocatable now. |
Commented by: rryan https://www.qt.io/blog/qt-is-relocatable (The flag is -no-feature-relocatable) We already have relocatable Qt builds via this script: |
Commented by: Be-ing We use our own build of Qt, so patching Qt is an option. We could submit the fix upstream too. |
Commented by: rryan Yea, upstreaming a patch makes sense if they consider this a bug. We are kind of doing something unusual by shipping standalone libraries while building with frameworks enabled. I think disabling the framework build makes sense given we're shipping without frameworks, but it might imply other changes in the build or packaging setup and so I think the most direct short term fix is -no-feature-relocatable. |
Commented by: rryan Building with -no-feature-relocatable fixes the crash on start for me. |
Issue closed with status Fix Released. |
Reported by: bengl3rt
Date: 2020-04-06T21:22:01Z
Status: Fix Released
Importance: Critical
Launchpad Issue: lp1871238
Attachments: backtraces.txt, 5fe4c858eb.txt
Using the latest environment,
2.3-j00006-b887bce2-osx10.11-x86_64-release.tar.gz
a build from scratch of mixxx master branch segfaults at launch:
The text was updated successfully, but these errors were encountered: