https://bugs.kde.org/show_bug.cgi?id=373779

            Bug ID: 373779
           Summary: QFileDialog integration causes crashes on program exit
           Product: frameworks-kio
           Version: 5.29.0
          Platform: Gentoo Packages
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: fa...@kde.org
          Reporter: gerbils...@gerbilsoft.com
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

In a pure Qt application, if a QFileDialog is used to open a file, the program
will crash when it exits. If the user cancels the QFileDialog, the crash won't
happen.

Test case:

#include <QApplication>
#include <QFileDialog>

int main(int argc, char *argv[])
{
        QApplication app(argc, argv);
        QString filename = QFileDialog::getOpenFileName(nullptr, "Select
File");
        printf("file == %s\n", filename.toUtf8().constData());
}

Compile with:
gcc getOpenFileName-test.cpp -O getOpenFileName-test -fpic -fPIC -I
/usr/include/qt5/QtWidgets -I /usr/include/qt5 -lQt5Widgets -lQt5Gui -lQt5Core

GDB backtrace:
Thread 1 "getOpenFileName" received signal SIGSEGV, Segmentation fault.
0x00007ffff6fe9bc4 in QHash<QRegExpEngineKey, QCache<QRegExpEngineKey,
QRegExpEngine>::Node>::deleteNode2(QHashData::Node*) () from
/usr/lib64/libQt5Core.so.5
(gdb) bt
#0  0x00007ffff6fe9bc4 in QHash<QRegExpEngineKey, QCache<QRegExpEngineKey,
QRegExpEngine>::Node>::deleteNode2(QHashData::Node*) () from
/usr/lib64/libQt5Core.so.5
#1  0x00007ffff70ae7a9 in QHashData::free_helper(void (*)(QHashData::Node*)) ()
from /usr/lib64/libQt5Core.so.5
#2  0x00007ffff6ff466c in (anonymous
namespace)::Q_QGS_globalEngineCache::innerFunction()::Holder::~Holder() () from
/usr/lib64/libQt5Core.so.5
#3  0x00007ffff62c2a80 in __run_exit_handlers (status=0, listp=0x7ffff66235b8
<__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, 
    run_dtors=run_dtors@entry=true) at exit.c:83
#4  0x00007ffff62c2ada in __GI_exit (status=<optimized out>) at exit.c:105
#5  0x00007ffff62ad2a8 in __libc_start_main (main=0x400be6 <main>, argc=1,
argv=0x7fffffffd988, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd978) at
../csu/libc-start.c:323
#6  0x0000000000400b1a in _start ()

This crash does not occur if QFileDialog::DontUseNativeDialog is set.

My system has KDE Frameworks 5.29 and KDE Applications 16.12.0.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to