Cannot debug Linux installed version of application using VS2022
-
I can build my application using VS2022 Linux workload.
There are two options for debugging:
If I select Debug/DeepSkyStacker it works as expected.If I select Debug/DeepSkyStacker(Install), the application is installed to the install output directory:
-- Install configuration: "Debug" -- Writing /home/amonra/.vs/DSS/x64/Linux/Debug/./qt.conf -- Running generic Qt deploy tool on /home/amonra/.vs/DSS/out/build/DeepSkyStacker/DeepSkyStacker -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Core.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Core.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6DBus.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6DBus.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6EglFSDeviceIntegration.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6EglFSDeviceIntegration.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6EglFsKmsGbmSupport.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6EglFsKmsGbmSupport.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6EglFsKmsSupport.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6EglFsKmsSupport.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Gui.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Gui.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Network.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Network.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6OpenGL.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6OpenGL.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Svg.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Svg.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Widgets.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6Widgets.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6XcbQpa.so.6 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libQt6XcbQpa.so.6.8.0 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libicudata.so.73 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libicudata.so.73.2 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libicui18n.so.73 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libicui18n.so.73.2 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libicuuc.so.73 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./libicuuc.so.73.2 -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/egldeviceintegrations/libqeglfs-emu-integration.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/egldeviceintegrations/libqeglfs-kms-egldevice-integration.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/egldeviceintegrations/libqeglfs-kms-integration.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/egldeviceintegrations/libqeglfs-x11-integration.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqgif.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqico.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqjpeg.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/iconengines/libqsvgicon.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqsvg.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/xcbglintegrations/libqxcb-egl-integration.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/xcbglintegrations/libqxcb-glx-integration.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/networkinformation/libqglib.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/networkinformation/libqnetworkmanager.so -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/tls/libqopensslbackend.so -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_ar.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_bg.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_cs.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_da.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_de.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_en.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_es.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_fr.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_hr.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_hu.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_ja.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_ka.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_ko.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_nl.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_pl.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_pt_BR.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_ru.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_sk.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_tr.qm CMake Warning at /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:640 (message): No translations found for requested locale 'sl'. Call Stack (most recent call first): /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:305 (qt6_deploy_translations) /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:507 (_qt_internal_generic_deployqt) .qt/deploy_DeepSkyStacker_4da1dbdd5a.cmake:5 (qt6_deploy_runtime_dependencies) DeepSkyStacker/cmake_install.cmake:46 (include) cmake_install.cmake:57 (include) -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_uk.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_zh_CN.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_zh_TW.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_it.qm CMake Warning at /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:640 (message): No translations found for requested locale 'sv'. Call Stack (most recent call first): /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:305 (qt6_deploy_translations) /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:507 (_qt_internal_generic_deployqt) .qt/deploy_DeepSkyStacker_4da1dbdd5a.cmake:5 (qt6_deploy_runtime_dependencies) DeepSkyStacker/cmake_install.cmake:46 (include) cmake_install.cmake:57 (include) -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_ca.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_fa.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_fi.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_gd.qm CMake Warning at /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:640 (message): No translations found for requested locale 'gl'. Call Stack (most recent call first): /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:305 (qt6_deploy_translations) /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:507 (_qt_internal_generic_deployqt) .qt/deploy_DeepSkyStacker_4da1dbdd5a.cmake:5 (qt6_deploy_runtime_dependencies) DeepSkyStacker/cmake_install.cmake:46 (include) cmake_install.cmake:57 (include) -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_he.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_nn.qm -- Creating: /home/amonra/.vs/DSS/x64/Linux/Debug/translations/qt_lv.qm CMake Warning at /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:640 (message): No translations found for requested locale 'lt'. Call Stack (most recent call first): /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:305 (qt6_deploy_translations) /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:507 (_qt_internal_generic_deployqt) .qt/deploy_DeepSkyStacker_4da1dbdd5a.cmake:5 (qt6_deploy_runtime_dependencies) DeepSkyStacker/cmake_install.cmake:46 (include) cmake_install.cmake:57 (include) CMake Warning at /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:640 (message): No translations found for requested locale 'pt_PT'. Call Stack (most recent call first): /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:305 (qt6_deploy_translations) /opt/Qt/6.8.0/gcc_64/lib/cmake/Qt6Core/Qt6CoreDeploySupport.cmake:507 (_qt_internal_generic_deployqt) .qt/deploy_DeepSkyStacker_4da1dbdd5a.cmake:5 (qt6_deploy_runtime_dependencies) DeepSkyStacker/cmake_install.cmake:46 (include) cmake_install.cmake:57 (include) -- Up-to-date: /home/amonra/.vs/DSS/x64/Linux/Debug/./DeepSkyStacker
But when the debugger starts the application I get:
qt.qpa.xcb: could not connect to display qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: xcb.
libxcb-cursor0 is installed:
amonra@styx:/$ dpkg -L libxcb-cursor0 /. /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libxcb-cursor.so.0.0.0 /usr/share /usr/share/doc /usr/share/doc/libxcb-cursor0 /usr/share/doc/libxcb-cursor0/changelog.Debian.gz /usr/share/doc/libxcb-cursor0/copyright /usr/lib/x86_64-linux-gnu/libxcb-cursor.so.0 amonra@styx:/$
What is really odd it that I can go to the install directory and issue the command:
./DeepSkyStacker
and it runs normally.
-
-
Yes, DISPLAY not being set WAS the problem. I've reported this to the VS folks:
https://developercommunity.visualstudio.com/t/DISPLAY-environment-variable-not-set/10814502Thanks for all the help
David -
@JonB I did as you suggested and got:
qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms" ... qt.core.plugin.factoryloader: looking at "libqxcb.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "xcb" ] }, "archlevel": 1, "className": "QXcbIntegrationPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("xcb") qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/platforms" ... qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so" loaded library qt.qpa.xcb: could not connect to display qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: xcb.
I'm not sure that this tells me anything new - maybe it means more to you? If I run from the command line I get:
$ ./DeepSkyStacker 2024-12-17T09-33-11Z qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms" ... qt.core.plugin.factoryloader: looking at "libqxcb.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so, metadata= { "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3", "MetaData": { "Keys": [ "xcb" ] }, "archlevel": 1, "className": "QXcbIntegrationPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("xcb") qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/platforms" ... qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so" loaded library qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/platformthemes" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforminputcontexts" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/platforminputcontexts" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/styles" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/styles" ... Loading translator file [ "qt_en_GB" ] from path: "/home/amonra/.vs/DSS/x64/Linux/Debug/translations" *** Failed to install translator for file [ "qt_en_GB" ] Loading translator file [ "DeepSkyStacker_en_GB" ] from path: ":/i18n/" Loading translator file [ "DeepSkyStackerKernel_en_GB" ] from path: ":/i18n/" CPU Type: Intel(R) Xeon(R) W-10885M CPU @ 2.40GHz qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/iconengines" ... qt.core.plugin.factoryloader: looking at "libqsvgicon.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/iconengines/libqsvgicon.so, metadata= { "IID": "org.qt-project.Qt.QIconEngineFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz", "svg.gz" ] }, "archlevel": 1, "className": "QSvgIconPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz", "svg.gz") qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/iconengines" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats" ... qt.core.plugin.factoryloader: looking at "libqsvg.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqsvg.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "svg", "svgz" ], "MimeTypes": [ "image/svg+xml", "image/svg+xml-compressed" ] }, "archlevel": 1, "className": "QSvgPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("svg", "svgz") qt.core.plugin.factoryloader: looking at "libqjpeg.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqjpeg.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "jpg", "jpeg", "jfif" ], "MimeTypes": [ "image/jpeg", "image/jpeg", "image/jpeg" ] }, "archlevel": 1, "className": "QJpegPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("jpg", "jpeg", "jfif") qt.core.plugin.factoryloader: looking at "libqgif.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqgif.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "gif" ], "MimeTypes": [ "image/gif" ] }, "archlevel": 1, "className": "QGifPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("gif") qt.core.plugin.factoryloader: looking at "libqico.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqico.so, metadata= { "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface", "MetaData": { "Keys": [ "ico", "cur" ], "MimeTypes": [ "image/vnd.microsoft.icon", "image/vnd.microsoft.icon" ] }, "archlevel": 1, "className": "QICOPlugin", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList("ico", "cur") qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/imageformats" ... qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqsvg.so" loaded library qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqjpeg.so" loaded library qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqgif.so" loaded library qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/imageformats/libqico.so" loaded library qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/accessible" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/accessible" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/networkaccess" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/networkaccess" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/tls" ... qt.core.plugin.factoryloader: looking at "libqopensslbackend.so" qt.core.plugin.loader: Found metadata in lib /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/tls/libqopensslbackend.so, metadata= { "IID": "org.qt-project.Qt.QTlsBackend", "archlevel": 1, "className": "QTlsBackendOpenSSL", "debug": false, "version": 395264 } qt.core.plugin.factoryloader: Got keys from plugin meta data QList() qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/tls" ... qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/tls/libqopensslbackend.so" loaded library qt.core.library: "crypto" loaded library qt.core.library: "ssl" loaded library qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/accessiblebridge" ... qt.core.plugin.factoryloader: checking directory path "/home/amonra/.vs/DSS/x64/Linux/Debug/accessiblebridge" ... Latest version is: "DeepSkyStackerVersion=5.1.6\n" __GI___sigaction at :? __strcpy_avx2 at ./string/../sysdeps/x86_64/multiarch/strcpy-avx2.S:365 (anonymous namespace)::qtMessageLogger(QtMsgType, QMessageLogContext const&, QString const&) at /home/amonra/.vs/DSS/DeepSkyStacker/../DeepSkyStackerKernel/QMessageLogger.h:20 qInstallMessageHandler(void (*)(QtMsgType, QMessageLogContext const&, QString const&)) at ??:? qt_message_output(QtMsgType, QMessageLogContext const&, QString const&) at ??:? QDebug::~QDebug() at ??:? QLibrary::resolve(char const*) at ??:? QLibrary::resolve(char const*) at ??:? __cxa_finalize at ./stdlib/cxa_finalize.c:83
Not quite sure why I'm seeing a traceback at the end there (I need to investigate that), but all the plugins appear to load normally.
David
-
@Perdrix said in Cannot debug Linux installed version of application using VS2022:
qt.qpa.xcb: could not connect to display
This is the issue. Is the environment configured properly (like DISPLAY variable set)?
-
@Perdrix
So in the failing case you have"/home/amonra/.vs/DSS/x64/Linux/Debug/platforms" ... qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so" loaded library qt.qpa.xcb: could not connect to display qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
while in the succeeding case you have
qt.core.library: "/home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so" loaded library
without any mention of failure on "xcb-cursor0 or libxcb-cursor0".
I therefore infer that, although you say "libxcb-cursor0 is installed", for whatever reason that is found and works when you run it directly from the install directory but not from the debugger. So something like their environments or search paths are different. If you run
ldd /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so
does that give information about where it finds its dependent shared libraries likelibxcb-cursor0
? -
I've no idea that Visual Studio does in the session where it runs the remote debugger. It certainly sets DISPLAY when I use Debug/DeepSkyStacker as that works.
As for the SIGSEGV the code in question is:
void qtMessageLogger(QtMsgType type, const QMessageLogContext& context, const QString& msg) { static thread_local size_t bufferSize = 2048; static thread_local std::unique_ptr<char[]> charBuffer = std::make_unique<char[]>(bufferSize); // 2kB char buffer allocated (thread safe) on first usage of this logger. QByteArray localMsg = msg.toLocal8Bit(); const char* file = context.file != nullptr ? context.file : ""; if (const size_t len = strlen(file); len >= bufferSize) { bufferSize = std::max(len + 1, 2 * bufferSize); // Double size of buffer, but at least as large as len. charBuffer = std::make_unique<char[]>(bufferSize); // Free the current buffer and allocate the new (larger) one. } char* const name = charBuffer.get(); strcpy(name, file);
I can't see any obvious errors in those lines of code, but if that is taking down a thread that's running the plugin initialisation ...
David
-
amonra@styx:~$ ldd /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/libqxcb.so linux-vdso.so.1 (0x00007ffff14f1000) libQt6XcbQpa.so.6 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libQt6XcbQpa.so.6 (0x00007f1e4be6a000) libQt6Gui.so.6 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libQt6Gui.so.6 (0x00007f1e4b3da000) libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f1e4b341000) libQt6Core.so.6 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libQt6Core.so.6 (0x00007f1e4ac6a000) libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f1e4ac23000) libxkbcommon-x11.so.0 => /lib/x86_64-linux-gnu/libxkbcommon-x11.so.0 (0x00007f1e4ac16000) libxcb-cursor.so.0 => /lib/x86_64-linux-gnu/libxcb-cursor.so.0 (0x00007f1e4aa00000) libxcb-icccm.so.4 => /lib/x86_64-linux-gnu/libxcb-icccm.so.4 (0x00007f1e4ac0f000) libxcb-image.so.0 => /lib/x86_64-linux-gnu/libxcb-image.so.0 (0x00007f1e4ac09000) libxcb-keysyms.so.1 => /lib/x86_64-linux-gnu/libxcb-keysyms.so.1 (0x00007f1e4a9fb000) libxcb-randr.so.0 => /lib/x86_64-linux-gnu/libxcb-randr.so.0 (0x00007f1e4a9e8000) libxcb-render-util.so.0 => /lib/x86_64-linux-gnu/libxcb-render-util.so.0 (0x00007f1e4a9e1000) libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f1e4a9dc000) libxcb-sync.so.1 => /lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f1e4a9d2000) libxcb-xfixes.so.0 => /lib/x86_64-linux-gnu/libxcb-xfixes.so.0 (0x00007f1e4a9c8000) libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f1e4a9b9000) libxcb-shape.so.0 => /lib/x86_64-linux-gnu/libxcb-shape.so.0 (0x00007f1e4a9b4000) libxcb-xkb.so.1 => /lib/x86_64-linux-gnu/libxcb-xkb.so.1 (0x00007f1e4a994000) libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f1e4a96a000) libX11-xcb.so.1 => /lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f1e4a965000) libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f1e4a825000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1e4a820000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1e4a81b000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1e4a5ac000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1e4a4c5000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1e4a4a1000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1e4a278000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f1e4a13e000) libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f1e4a139000) libEGL.so.1 => /lib/x86_64-linux-gnu/libEGL.so.1 (0x00007f1e4a124000) libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f1e4a0da000) libQt6DBus.so.6 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libQt6DBus.so.6 (0x00007f1e4a008000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1e49fec000) libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f1e49f24000) libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f1e49e6a000) libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f1e49e36000) libicui18n.so.73 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libicui18n.so.73 (0x00007f1e49ae7000) libicuuc.so.73 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libicuuc.so.73 (0x00007f1e498cf000) libicudata.so.73 => /home/amonra/.vs/DSS/x64/Linux/Debug/plugins/platforms/../../libicudata.so.73 (0x00007f1e47a41000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f1e47972000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1e4796b000) /lib64/ld-linux-x86-64.so.2 (0x00007f1e4bf31000) libxcb-util.so.1 => /lib/x86_64-linux-gnu/libxcb-util.so.1 (0x00007f1e47962000) libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f1e4795c000) libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f1e47954000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f1e478dc000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f1e478ab000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f1e478a2000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f1e47854000) libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f1e47819000) libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f1e47809000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f1e477f1000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f1e4772a000) libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f1e47707000) libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f1e476fa000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f1e476cd000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f1e476ad000) libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f1e476a2000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f1e47564000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f1e4753e000) amonra@styx:~$
-
@Perdrix
You might tryldd /lib/x86_64-linux-gnu/libxcb-cursor.so.0
to see what that depends on. But you are doing this from the command line where the code works anyway, so I'm not sure what this would tell us, it really needs to be run from whatever the debugger environment is.Looking again at the error message:
qt.qpa.xcb: could not connect to display qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
I am now wondering whether the mention of
libxcb-cursor0
might be spurious here, a message it outputs whenever xcb fails for any reason?Usually you get
qt.qpa.xcb: could not connect to display
whenever your XorgDISPLAY
environment variable is missing/does not name an acceptable display. Maybe this is the actual cause, the variable being different/missing from the debugger launch? Where it does work have a look at your environment variables, what isDISPLAY
? Usually it is:0.0
. In the working case try setting this "bad" --- remove it or set it to:10.10
orrubbish
--- and then run your "working" code. Do you now get behaviour/message similar to "bad" case? Now check what this is from the debugger environment and address if that is the issue. -
@Perdrix said in Cannot debug Linux installed version of application using VS2022:
I'll add some debug code to the start of main() to show what DISPLAY is set to in the environment.
Indeed. But I'm not 100% sure whether it gets as far as
main()
when libraries cannot be loaded.Please also try as I say making the "good" case have a rubbish
DISPLAY
variable. If that reproduces the error message from the "bad" case it is likely to be the issue. -
Yes, DISPLAY not being set WAS the problem. I've reported this to the VS folks:
https://developercommunity.visualstudio.com/t/DISPLAY-environment-variable-not-set/10814502Thanks for all the help
David -
-
@Perdrix
Yes, I think messageqt.qpa.xcb: could not connect to display
is the clue. I think that when xcb fails to load, their misleading message about
libxcb-cursor0
notwithstanding, you get an explicit "failed to load" but not "could not connect to display". I think you only get that one whenDISPLAY
is wrong.