conda-forge / qt-feedstock

A conda-smithy repository for qt.
BSD 3-Clause "New" or "Revised" License
12 stars 57 forks source link

ButtonStyle QML crashes app with segfault #240

Open nnkwame opened 1 year ago

nnkwame commented 1 year ago

Solution to issue cannot be found in the documentation.

Issue

Including a ButtonStyle object in the following QML code for a button causes a segmentation fault (core dumped) with qt 5.15.8. The same example works on qt 5.15.4:

// src/MainWindow.qml
import QtQuick 2.2
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Window {
    id: appWindow
    visible: true
    color: "gray"

    width: 500
    height: 500
    minimumHeight: 500
    minimumWidth: 500

    Button {
        width: 40
        height: 35

        style: ButtonStyle {

            label: Image {
                source: "image-file-name-here.svg"
            }
        } // crash 

        onClicked:{
            console.log("do something")
        }
    }
}

The QML is called from:

// src/main.cpp
#include <iostream>

#include <QGuiApplication>
#include <QLoggingCategory>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QQuickView>

int main(int argc, char** argv)
{
    // Create gui
    QGuiApplication app(argc, argv);
    QQmlApplicationEngine appEngine;

    appEngine.load(QUrl(QStringLiteral("qrc:/MainWindow.qml")));
    QObject* appWindow = appEngine.rootObjects()[0];

    // run qt app
    return app.exec();
}

To build and run:

MainWindow.qml image-file-name-here.svg

 - run with `./test-crash`

crash output:

Loaded '/lib64/ld-linux-x86-64.so.2'. Symbols loaded. [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". ... Loaded '/home/nkw/qt-minimal-fail-example-test/.devenv/host/lib/./././libXdmcp.so.6'. Symbols loaded. [New Thread 0x7ffff340a700 (LWP 540930)] [New Thread 0x7ffff2bb0700 (LWP 540931)] [New Thread 0x7ffff23af700 (LWP 540933)]

Thread 4 "QQmlThread" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff23af700 (LWP 540933)] 0x00007ffff79fc372 in QQmlPropertyCache::property(int) const () from /home/nkw/qt-minimal-fail-example-test/.devenv/host/lib/libQt5Qml.so.5 Loaded '/home/nkw/qt-minimal-fail-example-test/.devenv/host/plugins/platforms/libqxcb.so'. Symbols loaded. ...


### Installed packages

```shell
# packages in environment at /home/nkw/qt-minimal-fail-example-test/.devenv/host:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
alsa-lib                  1.2.8                h166bdaf_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
ca-certificates           2022.12.7            ha878542_0    conda-forge
cairo                     1.16.0            h35add3b_1015    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
fftw                      3.3.10          nompi_hc118613_107    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 hab24e00_0    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
freetype                  2.12.1               hca18f0e_1    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
giflib                    5.2.1                h0b41bf4_3    conda-forge
glib                      2.76.1               h3eb15da_0    conda-forge
glib-tools                2.76.1               h3eb15da_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.0               h4243ec0_2    conda-forge
gstreamer                 1.22.0               h25f0c4b_2    conda-forge
gstreamer-orc             0.4.33               h166bdaf_0    conda-forge
harfbuzz                  6.0.0                h3ff4399_1    conda-forge
icu                       72.1                 hcb278e6_0    conda-forge
jack                      1.9.22               h11f4161_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
krb5                      1.20.1               h81ceb04_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libcap                    2.67                 he9d0100_0    conda-forge
libclang                  16.0.1          default_h62803fd_0    conda-forge
libclang13                16.0.1          default_h9b593c0_0    conda-forge
libcups                   2.3.3                h36d4200_3    conda-forge
libdb                     6.2.32               h9c3ff4c_0    conda-forge
libdeflate                1.18                 h0b41bf4_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libevent                  2.1.10               h28343ad_4    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.2                h27087fc_0    conda-forge
libgcc-ng                 12.2.0              h65d4601_19    conda-forge
libgcrypt                 1.10.1               h166bdaf_0    conda-forge
libgfortran-ng            12.2.0              h69a702a_19    conda-forge
libgfortran5              12.2.0              h337968e_19    conda-forge
libglib                   2.76.1               ha491796_0    conda-forge
libgomp                   12.2.0              h65d4601_19    conda-forge
libgpg-error              1.46                 h620e276_0    conda-forge
libiconv                  1.17                 h166bdaf_0    conda-forge
libjpeg-turbo             2.1.5.1              h0b41bf4_0    conda-forge
libllvm16                 16.0.1               hadd5161_0    conda-forge
libnsl                    2.0.0                h7f98852_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.39               h753d276_0    conda-forge
libpq                     15.2                 hb675445_0    conda-forge
libsndfile                1.2.0                hb75c966_0    conda-forge
libsqlite                 3.40.0               h753d276_0    conda-forge
libstdcxx-ng              12.2.0              h46fd767_19    conda-forge
libsystemd0               253                  h8c4010b_1    conda-forge
libtiff                   4.5.0                ha587672_6    conda-forge
libtool                   2.4.7                h27087fc_0    conda-forge
libudev1                  253                  h0b41bf4_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp                   1.3.0                hb47c5f0_0    conda-forge
libwebp-base              1.3.0                h0b41bf4_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxkbcommon              1.5.0                h79f4944_1    conda-forge
libxml2                   2.10.4               hfdac1af_0    conda-forge
libzlib                   1.2.13               h166bdaf_4    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
mpg123                    1.31.3               hcb278e6_0    conda-forge
mysql-common              8.0.32               ha901b37_1    conda-forge
mysql-libs                8.0.32               hd7da12d_1    conda-forge
ncurses                   6.3                  h27087fc_1    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.89                 he45b914_0    conda-forge
openssl                   3.1.0                h0b41bf4_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
pip                       23.1               pyhd8ed1ab_0    conda-forge
pixman                    0.40.0               h36c2ea0_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
pulseaudio                16.1                 hcb278e6_3    conda-forge
pulseaudio-client         16.1                 h5195f5e_3    conda-forge
pulseaudio-daemon         16.1                 ha8d29e2_3    conda-forge
python                    3.11.3          h2755cc3_0_cpython    conda-forge
qt                        5.15.8               hf11cfaa_0    conda-forge
qt-main                   5.15.8               h5c52f38_9    conda-forge
qt-webengine              5.15.8               h77d6d84_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
setuptools                67.6.1             pyhd8ed1ab_0    conda-forge
tk                        8.6.12               h27826a3_0    conda-forge
tzdata                    2023c                h71feb2d_0    conda-forge
wheel                     0.40.0             pyhd8ed1ab_0    conda-forge
xcb-util                  0.4.0                h166bdaf_0    conda-forge
xcb-util-image            0.4.0                h166bdaf_0    conda-forge
xcb-util-keysyms          0.4.0                h166bdaf_0    conda-forge
xcb-util-renderutil       0.3.9                h166bdaf_0    conda-forge
xcb-util-wm               0.4.1                h166bdaf_0    conda-forge
xkeyboard-config          2.38                 h0b41bf4_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.0.10               h7f98852_0    conda-forge
xorg-libsm                1.2.3             hd9c2040_1000    conda-forge
xorg-libx11               1.8.4                h0b41bf4_0    conda-forge
xorg-libxau               1.0.9                h7f98852_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xf86vidmodeproto     2.3.1             h7f98852_1002    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
zlib                      1.2.13               h166bdaf_4    conda-forge
zstd                      1.5.2                h3eb15da_6    conda-forge

Environment info

active environment : /home/nkw/qt-minimal-fail-example-test/.devenv/host
    active env location : /home/nkw/qt-minimal-fail-example-test/.devenv/host
            shell level : 4
       user config file : /home/nkw/.condarc
 populated config files : /home/nkw/.condarc
          conda version : 23.3.1
    conda-build version : 3.22.0
         python version : 3.9.16.final.0
       virtual packages : __archspec=1=x86_64
                          __cuda=11.4=0
                          __glibc=2.31=0
                          __linux=5.14.0=0
                          __unix=0=0
       base environment : /home/nkw/mambaforge  (writable)
      conda av data dir : /home/nkw/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/robostack/linux-64
                          https://conda.anaconda.org/robostack/noarch
                          https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
                          https://repo.anaconda.com/pkgs/main/linux-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/linux-64
                          https://repo.anaconda.com/pkgs/r/noarch
          package cache : /home/nkw/mambaforge/pkgs
                          /home/nkw/.conda/pkgs
       envs directories : /home/nkw/mambaforge/envs
                          /home/nkw/.conda/envs
               platform : linux-64
             user-agent : conda/23.3.1 requests/2.28.2 CPython/3.9.16 Linux/5.14.0-1059-oem ubuntu/20.04.6 glibc/2.31
                UID:GID : 1000:1000
             netrc file : /home/nkw/.netrc
           offline mode : False