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

            Bug ID: 360593
           Summary: Dead-lock with --help on Qt 5.6
           Product: Breeze
           Version: 5.5.95
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: grave
          Priority: NOR
         Component: QStyle
          Assignee: hugo.pere...@free.fr
          Reporter: mgraess...@kde.org

Running any application with --help will result in the following dead-lock:

pthread_cond_wait@@GLIBC_2.3.2 () at
../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
185     ../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: No such file or
directory.
(gdb) bt
#0  pthread_cond_wait@@GLIBC_2.3.2 () at
../sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:185
#1  0x00007ffff324c10b in QWaitConditionPrivate::wait
(time=18446744073709551615, this=0x6ba300) at
thread/qwaitcondition_unix.cpp:136
#2  QWaitCondition::wait (this=this@entry=0x6a3a48, mutex=mutex@entry=0x6a3a40,
time=time@entry=18446744073709551615) at thread/qwaitcondition_unix.cpp:208
#3  0x00007ffff324557b in QSemaphore::acquire (this=this@entry=0x7fffffffc660,
n=n@entry=1) at thread/qsemaphore.cpp:137
#4  0x00007ffff3438dcf in QMetaObject::activate (sender=sender@entry=0x6a3130,
signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0,
argv=argv@entry=0x7fffffffc6e0) at kernel/qobject.cpp:3698
#5  0x00007ffff3439467 in QMetaObject::activate (sender=sender@entry=0x6a3130,
m=m@entry=0x7ffff3652500 <QObject::staticMetaObject>,
local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffc6e0)
at kernel/qobject.cpp:3595
#6  0x00007ffff34394ff in QObject::destroyed (this=this@entry=0x6a3130,
_t1=_t1@entry=0x6a3130) at .moc/moc_qobject.cpp:213
#7  0x00007ffff343ff95 in QObject::~QObject (this=<optimized out>,
__in_chrg=<optimized out>) at kernel/qobject.cpp:913
#8  0x00007fffdc5e24fd in KStyle::~KStyle (this=0x6a3130, __in_chrg=<optimized
out>) at
/home/martin/src/kf5/frameworks/frameworkintegration/src/kstyle/kstyle.cpp:191
#9  0x00007fffdc82c233 in Breeze::Style::~Style (this=0x6a3130,
__in_chrg=<optimized out>) at
/home/martin/src/kf5/kde/workspace/breeze/kstyle/breezestyle.cpp:201
#10 0x00007fffdc82c262 in Breeze::Style::~Style (this=0x6a3130,
__in_chrg=<optimized out>) at
/home/martin/src/kf5/kde/workspace/breeze/kstyle/breezestyle.cpp:207
#11 0x00007fffdc850aeb in Breeze::StylePlugin::<lambda()>::operator()(void)
const (__closure=0x7fffffffc820) at
/home/martin/src/kf5/kde/workspace/breeze/kstyle/breezestyleplugin.cpp:43
#12 0x00007fffdc850e7a in QtPrivate::FunctorCall<QtPrivate::IndexesList<>,
QtPrivate::List<>, void, Breeze::StylePlugin::create(const
QString&)::<lambda()> >::call(Breeze::StylePlugin::<lambda()>, void **) (f=...,
arg=0x7fffffffc9e0)
    at /opt/qt5/include/QtCore/qobjectdefs_impl.h:495
#13 0x00007fffdc850e5b in QtPrivate::Functor<Breeze::StylePlugin::create(const
QString&)::<lambda()>, 0>::call<QtPrivate::List<>,
void>(Breeze::StylePlugin::<lambda()> &, void *, void **) (f=...,
arg=0x7fffffffc9e0)
    at /opt/qt5/include/QtCore/qobjectdefs_impl.h:552
#14 0x00007fffdc850e20 in
QtPrivate::QFunctorSlotObject<Breeze::StylePlugin::create(const
QString&)::<lambda()>, 0, QtPrivate::List<>, void>::impl(int,
QtPrivate::QSlotObjectBase *, QObject *, void **, bool *) (which=1,
this_=0x6bba20, 
    r=0x6a3130, a=0x7fffffffc9e0, ret=0x0) at
/opt/qt5/include/QtCore/qobject_impl.h:192
#15 0x00007ffff3438ebe in QtPrivate::QSlotObjectBase::call (a=0x7fffffffc9e0,
r=0x6a3130, this=<optimized out>) at
../../include/QtCore/../../src/corelib/kernel/qobject_impl.h:124
#16 QMetaObject::activate (sender=sender@entry=0x6a84f0,
signalOffset=<optimized out>, local_signal_index=local_signal_index@entry=0,
argv=argv@entry=0x7fffffffc9e0) at kernel/qobject.cpp:3715
#17 0x00007ffff3439467 in QMetaObject::activate (sender=sender@entry=0x6a84f0,
m=m@entry=0x7ffff3652500 <QObject::staticMetaObject>,
local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x7fffffffc9e0)
at kernel/qobject.cpp:3595
#18 0x00007ffff34394ff in QObject::destroyed (this=this@entry=0x6a84f0,
_t1=_t1@entry=0x6a84f0) at .moc/moc_qobject.cpp:213
#19 0x00007ffff343ff95 in QObject::~QObject (this=<optimized out>,
__in_chrg=<optimized out>) at kernel/qobject.cpp:913
#20 0x00007fffdc850bfe in Breeze::StylePlugin::~StylePlugin (this=0x6a84f0,
__in_chrg=<optimized out>) at
/home/martin/src/kf5/kde/workspace/breeze/kstyle/breezestyleplugin.cpp:52
#21 0x00007fffdc850c2e in Breeze::StylePlugin::~StylePlugin (this=0x6a84f0,
__in_chrg=<optimized out>) at
/home/martin/src/kf5/kde/workspace/breeze/kstyle/breezestyleplugin.cpp:54
#22 0x00007ffff3403cd9 in QLibraryPrivate::unload (this=this@entry=0x6ba740,
flag=flag@entry=QLibraryPrivate::UnloadSys) at plugin/qlibrary.cpp:551
#23 0x00007ffff33f9ec2 in QFactoryLoaderPrivate::~QFactoryLoaderPrivate
(this=0x6ba530, __in_chrg=<optimized out>) at plugin/qfactoryloader.cpp:88
#24 0x00007ffff33f9ff9 in QFactoryLoaderPrivate::~QFactoryLoaderPrivate
(this=0x6ba530, __in_chrg=<optimized out>) at plugin/qfactoryloader.cpp:91
#25 0x00007ffff344037c in QScopedPointerDeleter<QObjectData>::cleanup
(pointer=<optimized out>) at
../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:54
#26 QScopedPointer<QObjectData, QScopedPointerDeleter<QObjectData>
>::~QScopedPointer (this=0x7ffff42ce8c8 <(anonymous
namespace)::Q_QGS_loader::innerFunction()::holder+8>, __in_chrg=<optimized
out>)
    at ../../include/QtCore/../../src/corelib/tools/qscopedpointer.h:101
#27 QObject::~QObject (this=<optimized out>, __in_chrg=<optimized out>) at
kernel/qobject.cpp:893
#28 0x00007ffff33f9169 in QFactoryLoader::~QFactoryLoader (this=0x7ffff42ce8c0
<(anonymous namespace)::Q_QGS_loader::innerFunction()::holder>,
__in_chrg=<optimized out>) at plugin/qfactoryloader.cpp:226
#29 0x00007ffff3e5a0a9 in (anonymous namespace)::Q_QGS_loader::Holder::~Holder
(this=<optimized out>, __in_chrg=<optimized out>) at
styles/qstylefactory.cpp:70
#30 0x00007ffff259be02 in __run_exit_handlers (status=status@entry=0,
listp=0x7ffff2904698 <__exit_funcs>,
run_list_atexit=run_list_atexit@entry=true) at exit.c:82
#31 0x00007ffff259be55 in __GI_exit (status=status@entry=0) at exit.c:104
#32 0x00007ffff325bdcf in QCommandLineParser::showHelp
(this=this@entry=0x7fffffffce50, exitCode=exitCode@entry=0) at
tools/qcommandlineparser.cpp:1010
#33 0x00007ffff325beb5 in QCommandLineParser::process
(this=this@entry=0x7fffffffce50, arguments=...) at
tools/qcommandlineparser.cpp:590
#34 0x00007ffff325bfcf in QCommandLineParser::process (this=0x7fffffffce50,
app=...) at tools/qcommandlineparser.cpp:602
#35 0x0000000000415612 in main ()

I investigated a little bit and a problem seems to be that QFactoryLoader
gained a dtor in 5.6 performing a QMutexLock and from destroying the Style
another lock is invoked which results in the dead lock.

Reproducible: Always

Steps to Reproduce:
1. gdb --args kwrite --help
2. run
3. wait

Actual Results:  
Application doesn't exit, interrupting in gdb gives backtrace as above

Expected Results:  
application exits cleanly

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

Reply via email to