Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Deployment problem on MAC OSX with macdeployqt Qt5.4.2 (and 5.3.2)
I have made the mac version of a Qt app.the app runs well but if I use macdeployQt the app crashes :
Process: neobe \ Path: /Users/USER/*/neobe.app/Contents/MacOS/neobe\ Identifier: com.dropcloud.neobe\ Version: ???\ Code Type: X86-64 (Native)\ Parent Process: ??? \ Responsible: neobe \ User ID: 501\ \ Date/Time: 2016-05-13 15:05:26.842 +0200\ OS Version: Mac OS X 10.10.4 (14E46)\ Report Version: 11\ Anonymous UUID: 06CA5466-106C-0CAA-8D38-69F4AA0B0DC5\ \ Sleep/Wake UUID: FAA27C1A-4249-405F-908E-9EBD13A6BB6F\ \ Time Awake Since Boot: 520000 seconds\ Time Since Wake: 84000 seconds\ \ Crashed Thread: 0 Dispatch queue: com.apple.main-thread\ \ Exception Type: EXC_CRASH (SIGABRT)\ Exception Codes: 0x0000000000000000, 0x0000000000000000\ \ Application Specific Information:\ abort() called\ \ Thread 0 Crashed:: Dispatch queue: com.apple.main-thread\ 0 libsystem_kernel.dylib 0x00007fff982c5286 __pthread_kill + 10\ 1 libsystem_c.dylib 0x00007fff8b318b53 abort + 129\ 2 org.qt-project.QtCore 0x000000010bb9b119 0x10bb78000 + 143641\ 3 org.qt-project.QtCore 0x000000010bb9c5d1 QMessageLogger::fatal(char const*, ...) const + 161\ 4 org.qt-project.QtGui 0x000000010b645247 QGuiApplicationPrivate::createPlatformIntegration() + 6359\ 5 org.qt-project.QtGui 0x000000010b64526b QGuiApplicationPrivate::createEventDispatcher() + 27\ 6 org.qt-project.QtCore 0x000000010bdb6901 QCoreApplication::init() + 113\ 7 org.qt-project.QtCore 0x000000010bdb6877 QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) + 39\ 8 org.qt-project.QtGui 0x000000010b6426de QGuiApplication::QGuiApplication(QGuiApplicationPrivate&) + 14\ 9 org.qt-project.QtWidgets 0x000000010b01155e QApplication::QApplication(int&, char**, int) + 206\ 10 com.dropcloud.neobe 0x000000010a4a54fd main + 45\ 11 com.dropcloud.neobe 0x000000010a3deeb4 start + 52\ \ Thread 1:: Dispatch queue: com.apple.libdispatch-manager\ 0 libsystem_kernel.dylib 0x00007fff982c6232 kevent64 + 10\ 1 libdispatch.dylib 0x00007fff914dfa6a _dispatch_mgr_thread + 52\ \ Thread 2:\ 0 libsystem_kernel.dylib 0x00007fff982c594a __workq_kernreturn + 10\ 1 libsystem_pthread.dylib 0x00007fff9746c40d start_wqthread + 13\ \ Thread 3:\ 0 libsystem_kernel.dylib 0x00007fff982c594a __workq_kernreturn + 10\ 1 libsystem_pthread.dylib 0x00007fff9746c40d start_wqthread + 13\ \ Thread 4:\ 0 libsystem_kernel.dylib 0x00007fff982c594a __workq_kernreturn + 10\ 1 libsystem_pthread.dylib 0x00007fff9746c40d start_wqthread + 13\ \ Thread 5:\ \ Thread 0 crashed with X86 Thread State (64-bit):\ rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx: 0x00007fff558252b8 rdx: 0x0000000000000000\ rdi: 0x000000000000130f rsi: 0x0000000000000006 rbp: 0x00007fff558252e0 rsp: 0x00007fff558252b8\ r8: 0x00007fff55825220 r9: 0x00007fff7b97f300 r10: 0x0000000008000000 r11: 0x0000000000000206\ r12: 0x000000010beadc88 r13: 0x00007fdfb950bd00 r14: 0x00007fff7b97f300 r15: 0x00007fff55825ca8\ rip: 0x00007fff982c5286 rfl: 0x0000000000000206 cr2: 0x00007fff79bccfd8\ \ Logical CPU: 0\ Error Code: 0x02000148\ Trap Number: 133\ \ \ Binary Images:\ 0x10a3da000 - 0x10ac03ff7 +com.dropcloud.neobe (???) <E0B91518-41C7-3D36-821D-5092F70221B8> /Users/USER/*/neobe.app/Contents/MacOS/neobe\ 0x10ad5c000 - 0x10af101e7 +libcrypto.1.0.0.dylib (0) <D23BE80E-993C-3905-A3A8-6D7E8D972277> /Users/USER/*/neobe.app/Contents/Frameworks/libcrypto.1.0.0.dylib\ 0x10af79000 - 0x10afbaff7 +libssl.1.0.0.dylib (0) <EAB38A56-AA4B-3D46-86CF-1B0D75E611C1> /Users/USER/*/neobe.app/Contents/Frameworks/libssl.1.0.0.dylib\ 0x10afd5000 - 0x10afe0ff7 +librsync.2.dylib (0) <1B3148B1-C683-3791-B7FA-614BC78BFB33> /Users/USER/*/neobe.app/Contents/Frameworks/librsync.2.dylib\ 0x10afe5000 - 0x10b4efff7 +org.qt-project.QtWidgets (5.4 - 5.4.2) <91FA984A-1421-3E72-838A-19294F0BB2EA> /Users/USER/*/neobe.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets\ 0x10b625000 - 0x10baa0ff7 +org.qt-project.QtGui (5.4 - 5.4.2) <FC22DB61-DAD1-3E0C-9A39-5079429C8E96> /Users/USER/*/neobe.app/Contents/Frameworks/QtGui.framework/Versions/5/QtGui\ 0x10bb78000 - 0x10c083fff +org.qt-project.QtCore (5.4 - 5.4.2) <56D39D2C-8220-3185-986B-D20776C1EEE5> /Users/USER/*/neobe.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore\ 0x10c111000 - 0x10c14afff +org.qt-project.QtXml (5.4 - 5.4.2) <0442022C-1ABA-3229-BB2C-C072232D2FF2> /Users/USER/*/neobe.app/Contents/Frameworks/QtXml.framework/Versions/5/QtXml\ 0x10c15e000 - 0x10c277ff7 +org.qt-project.QtNetwork (5.4 - 5.4.2) <1F11ED82-B81D-3C64-8471-E7C59AAA73D4> /Users/USER/*/neobe.app/Contents/Frameworks/QtNetwork.framework/Versions/5/QtNetwork\ 0x10c2ad000 - 0x10c2dafff +org.qt-project.QtSql (5.4 - 5.4.2) <E15BB91E-B30D-3028-917D-C1163485A07A> /Users/USER/*/neobe.app/Contents/Frameworks/QtSql.framework/Versions/5/QtSql\ 0x10c2ee000 - 0x10c2f2fff com.apple.agl (3.3.0 - AGL-3.3.0) <4E8F579B-A2E2-3A27-96D7-02A9465A78D8> /System/Library/Frameworks/AGL.framework/Versions/A/AGL\ 0x10c2ff000 - 0x10c305ff7 +libpopt.0.dylib (0) <CC9E3F11-11E7-381A-A543-651D0494F665> /Users/USER/*/neobe.app/Contents/Frameworks/libpopt.0.dylib\ 0x10dd2d000 - 0x10ddd3fff +libqcocoa.dylib (0) <6ADB44BB-79DB-3948-8C8D-BBB20F0B7B51> /Users/USER/*/libqcocoa.dylib\ 0x10de2f000 - 0x10e2aaff7 +org.qt-project.QtGui (5.4 - 5.4.2) <FC22DB61-DAD1-3E0C-9A39-5079429C8E96> /Users/USER/*/QtGui.framework/Versions/5/QtGui\ 0x10e3e1000 - 0x10e8ecfff +org.qt-project.QtCore (5.4 - 5.4.2) <56D39D2C-8220-3185-986B-D20776C1EEE5> /Users/USER/*/QtCore.framework/Versions/5/QtCore\
This app use the openssl dynamic libs and dynamic librsync.the app is linked too statically with the library chilkat.because I couldn't build with it dynamically.and the app uses Qtcore,Qtgui,Qtwidgets,Qtnetwork,QtSql(plugin sqlite),and Qxml.I have only the sql plugin of sqlite.
I use Qt5.4.2 but I have tried with Qt5.3.2 too.
I have not this problem with another app that uses only openssl and qtcore,qtgui,qtwidgets and qtnetworks.
I have used otool -L to see the dynamic libraries used by the app but it didn't learned me more ....
tha app runs well if I don't do macdeployqt.
Who has an idea to solve my problem?
Can you start the application once bundled from the command line ? You might get some more information about the crash.
@SGaist, Hi thanks, here is the information command line :
Class NotificationReceiver is implemented in both /Users/lionel/neobe5.4.2/neobe.app/Contents/Frameworks/QtWidgets.framework/Versions/5/QtWidgets and /Users/lionel/Qt5.4.2/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets. One of the two will be used. Which one is undefined.\ QObject::moveToThread: Current thread (0x7fccc043a180) is not the object's thread (0x7fccc0477b30).\ Cannot move to target thread (0x7fccc043a180)\ \ You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.\ This application failed to start because it could not find or load the Qt platform plugin "cocoa".\ \ Available platform plugins are: cocoa, minimal, offscreen.\ \ Reinstalling the application may fix this problem.\ Abort trap: 6}
it seems that there is a problem with the plugin cocoa. the plugin platform cocoa is in the app,so I don't understand this message.the plugin is in Contents/PlugIns/platforms.
And I don't understand, because I have made another package/app with macdeployqt that uses the plugin cocoa too and there isn't any problem with this another app.
-I have tried by putting the plugins subdirectories in the MacOS subdirectory of the bundle. it does nothing.
-The declaration of QApplication is the first line of the main function in the program
-I have modified the qt.conf file and I have still the error
so I don't know from what comes this error now
Hi, my problem was solved with Qt5.6.....
I think this problem comes from the SQL plugins,because I have an error on two libraries (libmysqlclient and libpq) when I run macdeployqt with Qt5.4.2 and Qt5.6.0 but the bundle crashes with Qt5.4.2 and the bundle is OK with Qt5.6.0. With Qt5.4.2 I had tried to remove the plugins other than sqlite (I use sqlite) from Qt installattion and then run macdeployqt but it crashes with unable to find or load plugin cocoa.
But my problem is solved I will use the Qt5.6.0 version for this application on MacOs.
IIRC, there's been several fixes in between to macdeployqt that might be related to that.
the package crashes on another Mac but I have not this other Mac here today and I cannot see the command line information.I think there are libraries of /usr/lib like libc++ or others or OpenGl that are not installed on this another mac.
Can I add libraries (of /usr/lib or other) to the bundle ?
What exact libraries are missing ?
@SGaist, Hi , I don't know if it comes from a missing library and I am not sure because the error message is :
QSqlError("-1", "Error opening database", "out of memory")
failed to connect.
Abort trap: 6
we use sqlite in the software and the plugin is in the bundle.
I have freed memory and even with 4Gb free memory I have this message
this is not a development Mac, and it is with MacOS 10.11.3 and 8 GB memory
I have copied the software on the desktop and I run it in command line.
On two other (developments) Mac the software is ok.
AFAIK, that's unrelated.
Where are your trying to open your database ?
Do you check that the open operation is successful before calling a query on it ?
Hi, @SGaist , I must add a new QMessageBox in the case it doesn't find the sqlite driver.
I think this case comes when it creates the log database and if it doesn't find the sqlite driver and then cannot open the database or when it opens the log database (if the file already exists and is corrupted).
@SGaist ,I have added a QMessageBox, if it doesn't find the sqldriver plugin and I have done an otool -L on the sqlite plugin and I have seen that it is linked with the libc++1.dylib and libSystemB.dylib.
is it possible that this two libraries are not on the Mac (10.11.3) or are not compatible with those of my development Mac (10.10.4) ?
@SGaist, HI, I have the same problem on a VM with an older MacOS(10.9),so I have the problem on 2 MacOSes where Qt was not installed before...so I think it needs a library or there is a problem with the bundle.
@SGaist, I have added Libraries = Frameworks to the qt.conf and I will test it on the VM
@SGaist, Hi it does nothing.
I have now added libsqlite3.dylib to the bundle and it is not ok .
but my bundle contains other qt sql plugins and perhaps should I remove them (mysql,postgres,odbc) of the bundle ?
I have tested without the other plugins in the bundle and I have still this error....
the software runs on two developments MacOs (with Qt and Xcode) and crashes on two other MacOS without Qt and Xcode.....
@SGaist, Hi, When I use macdeployqt (Qt5.6.0) I have this errors and warning :
WARNING: Plugin "libqsqlodbc.dylib" uses private API and is not Mac App store compliant.
WARNING: Plugin "libqsqlpsql.dylib" uses private API and is not Mac App store compliant.
ERROR: no file at "/opt/local/lib/mysql55/mysql/libmysqlclient.18.dylib"
ERROR: no file at "/usr/local/lib/libpq.5.dylib"
but I use only the sqlite plugin
Just remove the plugins you won't use.
Where did you put the SQLite library ?
Should I remove the other plugins from the bundle?
I have tried too with the libsqlite3.dylib in the bundle (in frameworks) but it did'nt solve the problem, I don't know if I should put it in the bundle.
I have tested without the other sql plugins and I have the same error...
The two MacOS on which that doesn't run are MacOS 10.9 and Mac OS 10.11.3 without Qt.
But the software and bundle was made on a Mac OS 10.10.4.
does the problem come from the MacOs version ?
No it should not.
Things I'd do now:
- Delete the bundle
- Do a full re-build
- Run macdeployqt on it
- Delete unused plugins
otool -Lon the remaining plugins
- Check whether there's any path to a non-system library that looks fishy
otool -Lon the application executable
- Check whether there's any path to a non-system library that looks fishy
already done several times the first three levels.
an otool -L on the sqlite plugin gives paths to Qt libraries with "@rpath" but I suppose it 's ok.
and the sqlite plugin is linked with /usr/lib/libcc++.1.dylib and /usr/lib/libSystem.B.dylib too (and QtCore and QtSql)
I have build with Qt5.5.1 and I have the same problem than with Qt5.6.0
We will try later with a VM with MacOS 10.10 to see if it is a version problem
We have the same error on a MacOS 10.10 without the development environment (Qt,Xcode)
Might be a silly question but did you check all the plugins and the application itself for which version of Qt they are linked to ?
If everything looks correct, then I'd check the framework themselves to see if for any reasons one is not from the correct version.
@SGaist , Hi I have deleted Qt5.4.2 and Qt5.5.1 from the hard disk and built again the software with Qt5.6.0.
I have the same error on another Mac...
OK the problem is solved , iHave found the solution: our software use a config path (/Users/user/.config/software/) in which there are one database log file that is created.the config path did'nt exist, that was the explanation of this error.
the software is ok now,we create the path at the beginning if it doesn't exist.
I use Qt5.6.0 for this software (I think I could have used Qt5.5.1 too).
Haaaa that's a tricky one…
Indeed, the Qt version used wouldn't matter in this case.
So, if I understand you correctly, the database path was pointing to an invalid location ?
@SGaist, we should have created the path because the subdirectory .config didn't exist,so the software could not create and open the log database file.We have corrected that and now it runs well and the software is ok (we have created the path /.config/software in the user directory).
But for the first problem I had with macdeployqt, it doesn't run well with Qt 5.4, and it is ok with Qt5.6 (and perhaps with Qt5.5).as Qt5.6 is a long term support release I think Qt5.6 is a good choice
macdeployt has received several fixes since 5.4. Indeed 5.6 is a good choice from a support/maintenance point of view.