Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Segmentation fault in Qt 5.11 for Linux



  • Hi all,

    I am developing applications using Qt.
    I was testing to work in various environments,
    Problems occurred only in Fedora 28/29 x86 environment.
    Fedora 28 was operating normally at Qt 5.10 before update
    After updating to version 5.11, problems started to occur.

    In the following environment where Qt 5.11 was installed, no problem occurred.

    • Ubuntu 18.10 x86/64
    • Fedora 28/29 x64

    The crash place is where we create an instance of QApplication in main().
    I tried creating an empty project and tried it and it crash in the same place.

    I will attach the empty sample code actually crashed.

    main.cpp
    #include "mainwindow.h"
    #include <QApplication>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv); // <-------Crash!!
    MainWindow w;
    w.show();

    return a.exec();
    

    }

    mainwindow.cpp
    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }

    If there is a problem with Qt 5.11, I hope it will be fixed.

    please help me regarding this issue.


  • Qt Champions 2017

    Are you using the Qt creator to create this project & run it ? Can you also try coming & running the build from command line e.g qmake -project, qmake & make. Some times to different libraries in the path conflict arises & ends in crash without much informaiton.


  • Qt Champions 2019

    @TARO Please start your app through debugger and provide the stack trace when it crashes



  • Thank you for reply!

    I built it with CMake.

    I attach a log file :

    [test-user@localhost ~]$ gdb '/home/test-user/workspace/test_app/testapp'
    GNU gdb (GDB) Fedora 8.2-5.fc29
    Copyright (C) 2018 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    Type "show copying" and "show warranty" for details.
    This GDB was configured as "i686-redhat-linux-gnu".
    Type "show configuration" for configuration details.
    For bug reporting instructions, please see:
    http://www.gnu.org/software/gdb/bugs/.
    Find the GDB manual and other documentation resources online at:
    http://www.gnu.org/software/gdb/documentation/.

    For help, type "help".
    Type "apropos word" to search for commands related to "word"...
    Reading symbols from /home/test-user/workspace/test_app/testapp...(no debugging symbols found)...done.
    (gdb) run
    Starting program: /home/test-user/workspace/test_app/testapp
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/libthread_db.so.1".
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    [New Thread 0xb38ffb40 (LWP 3280)]
    warning: Error reading shared library list entry at 0xffffff50
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Error reading shared library list entry at 0xffffd630
    warning: Error reading shared library list entry at 0xffffe870
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Error reading shared library list entry at 0x69d0
    warning: Error reading shared library list entry at 0x7420
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    warning: Loadable section ".note.gnu.property" outside of ELF segments
    [New Thread 0xb1e2fb40 (LWP 3281)]
    [New Thread 0xb162eb40 (LWP 3282)]
    [New Thread 0xb0affb40 (LWP 3283)]
    [New Thread 0xb02feb40 (LWP 3284)]
    warning: Error reading shared library list entry at 0x1640

    Thread 1 "testapp" received signal SIGSEGV, Segmentation fault.
    memcpy () at ../sysdeps/i386/i686/memcpy.S:71
    71 rep
    Missing separate debuginfos, use: dnf debuginfo-install GConf2-3.2.6-21.fc29.i686 at-spi2-atk-2.30.0-1.fc29.i686 at-spi2-core-2.30.0-2.fc29.i686 atk-2.30.0-1.fc29.i686 bzip2-libs-1.0.6-28.fc29.i686 cairo-1.16.0-3.fc29.i686 cairo-gobject-1.16.0-3.fc29.i686 dbus-glib-0.110-3.fc29.i686 dbus-libs-1.12.10-1.fc29.i686 dconf-0.30.1-1.fc29.i686 expat-2.2.6-1.fc29.i686 fontconfig-2.13.1-3.fc29.i686 freetype-2.9.1-6.fc29.i686 fribidi-1.0.5-1.fc29.i686 gdk-pixbuf2-2.38.0-4.fc29.i686 glib2-2.58.1-1.fc29.i686 graphite2-1.3.10-6.fc29.i686 gtk3-3.24.1-1.fc29.i686 gvfs-client-1.38.1-1.fc29.i686 harfbuzz-1.8.7-1.fc29.i686 libICE-1.0.9-14.fc29.i686 libSM-1.2.3-1.fc29.i686 libX11-1.6.7-1.fc29.i686 libX11-xcb-1.6.7-1.fc29.i686 libXcomposite-0.4.4-15.fc29.i686 libXcursor-1.1.15-4.fc29.i686 libXdamage-1.1.4-15.fc29.i686 libXext-1.3.3-10.fc29.i686 libXfixes-5.0.3-8.fc29.i686 libXi-1.7.9-8.fc29.i686 libXrender-0.9.10-8.fc29.i686 libblkid-2.32.1-1.fc29.i686 libcap-2.25-12.fc29.i686 libdatrie-0.2.9-8.fc29.i686 libepoxy-1.5.3-1.fc29.i686 libffi-3.1-18.fc29.i686 libgcc-8.2.1-5.fc29.i686 libgcrypt-1.8.4-1.fc29.i686 libglvnd-1.1.0-2.fc29.i686 libglvnd-glx-1.1.0-2.fc29.i686 libgpg-error-1.31-2.fc29.i686 libicu-62.1-3.fc29.i686 libmount-2.32.1-1.fc29.i686 libpng-1.6.34-6.fc29.i686 libstdc++-8.2.1-5.fc29.i686 libuuid-2.32.1-1.fc29.i686 libwayland-client-1.16.0-1.fc29.i686 libwayland-egl-1.16.0-1.fc29.i686 libxkbcommon-x11-0.8.2-1.fc29.i686 lz4-libs-1.8.2-2.fc29.i686 pango-1.42.4-1.fc29.i686 pcre-8.42-5.fc29.i686 pcre2-10.32-4.fc29.i686 pcre2-utf16-10.32-4.fc29.i686 pixman-0.34.0-10.fc29.i686 qgnomeplatform-0.5-5.fc29.i686 qt5-qtbase-5.11.1-9.fc29.i686 qt5-qtbase-gui-5.11.1-9.fc29.i686 systemd-libs-239-6.git9f3aed1.fc29.i686 xcb-util-0.4.0-11.fc29.i686 xcb-util-image-0.4.0-11.fc29.i686 xcb-util-keysyms-0.4.0-9.fc29.i686 xcb-util-wm-0.4.1-14.fc29.i686 xz-libs-5.2.4-3.fc29.i686 zlib-1.2.11-14.fc29.i686
    (gdb) bt
    #0 memcpy () at ../sysdeps/i386/i686/memcpy.S:71
    #1 0x080ec0fc in ?? ()


  • Qt Champions 2019

    @TARO Can you provide output from ldd?

    ldd YOUR_EXECUTABLE
    


  • The problem was occurred too in Fedora 27 x86.
    The version of Qt may not matter.
    It may be caused by a library dependent on Qt.

    Even Fedora 27 worked a while ago a while ago.

    I attach a ldd output :
    linux-gate.so.1 (0xb7f0e000)
    libQt5Widgets.so.5 => /lib/libQt5Widgets.so.5 (0xb77d0000)
    libQt5Gui.so.5 => /lib/libQt5Gui.so.5 (0xb726c000)
    libQt5Core.so.5 => /lib/libQt5Core.so.5 (0xb6da7000)
    libstdc++.so.6 => /lib/libstdc++.so.6 (0xb6c23000)
    libm.so.6 => /lib/libm.so.6 (0xb6ae1000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb6ac4000)
    libc.so.6 => /lib/libc.so.6 (0xb6903000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb68e4000)
    libGL.so.1 => /lib/libGL.so.1 (0xb6883000)
    libpng16.so.16 => /lib/libpng16.so.16 (0xb684b000)
    libharfbuzz.so.0 => /lib/libharfbuzz.so.0 (0xb67ad000)
    libz.so.1 => /lib/libz.so.1 (0xb6794000)
    libsystemd.so.0 => /lib/libsystemd.so.0 (0xb6705000)
    libicui18n.so.57 => /lib/libicui18n.so.57 (0xb646d000)
    libicuuc.so.57 => /lib/libicuuc.so.57 (0xb62c1000)
    libicudata.so.57 => /lib/libicudata.so.57 (0xb4a43000)
    libpcre2-16.so.0 => /lib/libpcre2-16.so.0 (0xb49ca000)
    libdl.so.2 => /lib/libdl.so.2 (0xb49c5000)
    libgthread-2.0.so.0 => /lib/libgthread-2.0.so.0 (0xb49c2000)
    libglib-2.0.so.0 => /lib/libglib-2.0.so.0 (0xb48a4000)
    /lib/ld-linux.so.2 (0xb7f10000)
    libGLX.so.0 => /lib/libGLX.so.0 (0xb4882000)
    libX11.so.6 => /lib/libX11.so.6 (0xb473b000)
    libXext.so.6 => /lib/libXext.so.6 (0xb4727000)
    libGLdispatch.so.0 => /lib/libGLdispatch.so.0 (0xb46c9000)
    libfreetype.so.6 => /lib/libfreetype.so.6 (0xb4615000)
    libgraphite2.so.3 => /lib/libgraphite2.so.3 (0xb45e7000)
    libgcrypt.so.20 => /lib/libgcrypt.so.20 (0xb450b000)
    librt.so.1 => /lib/librt.so.1 (0xb4501000)
    liblzma.so.5 => /lib/liblzma.so.5 (0xb44d6000)
    liblz4.so.1 => /lib/liblz4.so.1 (0xb44bf000)
    libselinux.so.1 => /lib/libselinux.so.1 (0xb4495000)
    libpcre.so.1 => /lib/libpcre.so.1 (0xb441d000)
    libxcb.so.1 => /lib/libxcb.so.1 (0xb43f1000)
    libbz2.so.1 => /lib/libbz2.so.1 (0xb43e0000)
    libgpg-error.so.0 => /lib/libgpg-error.so.0 (0xb43c9000)
    libpcre2-8.so.0 => /lib/libpcre2-8.so.0 (0xb4341000)
    libXau.so.6 => /lib/libXau.so.6 (0xb433d000)



  • You can also try:
    $ export LD_LIBRARY_PATH="/path/to/Qt5.11/libs:$LD_LIBRARY_PATH"
    $ /home/test-user/workspace/test_app/testapp


  • Qt Champions 2019

    @TARO Your app links against Qt libs in /lib - is it Qt 5.11 you installed?



  • The link to the Qt library is correct.

    libQt5Core.so.5 => /lib/libQt5Core.so.5 (0xb6da7000)
    ->
    lrwxrwxrwx. 1 root root 20 10月 25 19:45 libQt5Core.so -> libQt5Core.so.5.11.1
    lrwxrwxrwx. 1 root root 20 10月 25 19:45 libQt5Core.so.5 -> libQt5Core.so.5.11.1
    lrwxrwxrwx. 1 root root 20 10月 25 19:45 libQt5Core.so.5.11 -> libQt5Core.so.5.11.1
    -rwxr-xr-x. 1 root root 5327412 10月 25 19:50 libQt5Core.so.5.11.1


  • Qt Champions 2017

    Please build your application in debug mode and then provide the stack trace. Also the loader seems to have problems reading the ELF header for whatever reason. Run readelf -Ws <appname> | grep qt_version after you have built in debug mode and post the result here.

    Any specific reason you installed a i686 arch and not x86_64?



  • Please build your application in debug mode and then provide the stack trace.
    ->I have already built it in debug mode.
    That is the log attached before.

    CMakeLists.txt
    PROJECT(testapp)
    cmake_minimum_required (VERSION 2.8.10.2)

    set(CMAKE_BUILD_TYPE Debug)
    SET(CMAKE_C_FLAGS_DEBUG "-g -O0")
    SET(CMAKE_CXX_FLAGS_DEBUG "-g -std=c++11 -O0")

    readelf -Ws <appname> | grep qt_version
    ->
    [test-user@localhost ~]$ readelf -Ws '/home/test-user/workspace/test_app/testapp' | grep qt_version
    14: 00000000 0 OBJECT GLOBAL DEFAULT UND qt_version_tag@Qt_5.11 (4)
    119: 00000000 0 OBJECT GLOBAL DEFAULT UND qt_version_tag@@Qt_5.11


  • Qt Champions 2017

    @TARO said in Segmentation fault in Qt 5.11 for Linux:

    I have already built it in debug mode.

    Are you sure? The stack trace doesn't agree with that:

    #0 memcpy () at ../sysdeps/i386/i686/memcpy.S:71
    #1 0x080ec0fc in ?? ()
    

Log in to reply