Qt app consistently crashing on OS X Monterey (12.6)
-
Hi,
I have been working on this app for quite a while -- it has been 'stable' until recently. It seems it is crashing somewhere deep in the OS. I tried the 'usual' stuff (reboot OSX, recompile from scratch), but to no avail. The app crashes randomly, it may stay stable for hours on end, and then it'd just crash. Attached is the OS X problem report.
I am not sure if these crashes are inherent to the OSX version, as the app would stay up for days (if not weeks) in previous OSX versions.
Any help is very much appreciated.
-
Hi,
Are you using a custom cursor in your application ?
-
It looks like png plugin fails. It could be system png plugin has bug. Can you try Qt png plugin:
https://doc.qt.io/qt-5/plugins-howto.html#static-plugins -
@SGaist a database cursor? Nope. Not sure what other cursors are out there.
-
No, a mouse cursor.
-
@SGaist Oh...! No, not using a custom mouse cursor.
-
It looks like png plugin fails. It could be system png plugin has bug. Can you try Qt png plugin:
https://doc.qt.io/qt-5/plugins-howto.html#static-plugins@JoeCFD Thanks for the suggestion -- do I follow instructions for static plugin.
-
It looks like png plugin fails. It could be system png plugin has bug. Can you try Qt png plugin:
https://doc.qt.io/qt-5/plugins-howto.html#static-plugins@JoeCFD Not sure how this is all to work automagically. The documentation states:
To cause static plugins actually being linked and instantiated, Q_IMPORT_PLUGIN() macros are also needed in application code, but those are automatically generated by qmake and added to your application project.However, after recreating the project (including doing a
run qmake) I don't see any references in the generated Qt code in thebuilddirectory. Am I still supposed to do a call toQ_IMPORT_PLUGIN()somewhere in my code?Thanks for any help or pointers.
Roy
-
This post is deleted!
-
This post is deleted!
@zaidmughal I am trying to. I have no idea how to accomplish this. Please see my other post about leveraging this Qt plug-in.
-
Can you provide the exact Qt version you are using ?
Can you provide a minimal compilable example that shows this behaviour ? -
Can you provide the exact Qt version you are using ?
Can you provide a minimal compilable example that shows this behaviour ?@SGaist that would take a lot of time and Murphy's law (and experience) tells me that this bug won't appear again.
I do have some questions on how to include plug-ins -- not sure if I need to callQ_IMPORT_PLUGINsomewhere in my code, and with what parameters. Unlike the documentation stated, I don't see any generated code that callesQ_IMPORT_PLUGINanywhere.This is the Qt version in use:

-
That's the Qt Creator version. It has nothing to do with the Qt Kit you are using to build your application.
Q_IMPORT_PLUGIN is to be used when working in a static build context.
-
That's the Qt Creator version. It has nothing to do with the Qt Kit you are using to build your application.
Q_IMPORT_PLUGIN is to be used when working in a static build context.
This post is deleted! -
That's the Qt Creator version. It has nothing to do with the Qt Kit you are using to build your application.
Q_IMPORT_PLUGIN is to be used when working in a static build context.
@SGaist Got it. Looks like 5.15.2 is used.
Also, I guess I am using a 'static build context' -- what is the exact parameter to be given toQ_IMPORT_PLUGINto use the Qt PNG plugin? -
Something like
Q_IMPORT_PLUGIN(qpng). -
@SGaist said in Qt app consistently crashing on OS X Monterey (12.6):
Q_IMPORT_PLUGIN(qpng)
Anything else I need to do?
Am getting link errors as follows:"qt_static_plugin_qpng()", referenced from: main::StaticqpngPluginInstance::StaticqpngPluginInstance() in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)I am doing this in my
main.cpp.
I also think that Qt does NOT ship with apngplugin.
I can't believe I am the only/first one to do something like that.