Bug 284148 - Crash when trying to export a patch to an existing file
Summary: Crash when trying to export a patch to an existing file
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Unclassified
Component: patchreview (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-16 02:45 UTC by David E. Narvaez
Modified: 2011-12-19 03:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Crash Log (17.38 KB, text/plain)
2011-10-17 11:48 UTC, David E. Narvaez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David E. Narvaez 2011-10-16 02:45:32 UTC
Version:           git master (using KDE 4.7.2) 
OS:                Linux

When trying export a diff to an existing file (by clicking Export Diff... -> Save As... in the Review) KDevelop crashes.

Reproducible: Always

Steps to Reproduce:
1. Modify a project that uses versioning
2. Right click in the project and click on Show Differences...
3. Go to Export Diff... -> Save As...
4. Choose an existing file

Actual Results:  
KDevelop crashes

Expected Results:  
The patch should be saved

When debugging, I noticed this is because the job is not linked to a UI and is unable to show a dialog for the user to decide what to do with the existing file.
Comment 1 David E. Narvaez 2011-10-17 11:45:18 UTC
To clarify my last comment, the problem is not that no UI is started, but a Bad Window error from X

X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x263b29e

I've seen far too many unsolved forum threads about this error, and even WONTFIX bugs here in KDE (see bug 180845) which indicates this might be a hard one to solve.
Comment 2 David E. Narvaez 2011-10-17 11:48:26 UTC
Created attachment 64633 [details]
Crash Log

Attaching crash log for sake of completeness.
Comment 3 Milian Wolff 2011-10-18 17:34:06 UTC
assigning to kdelibs as it looks like a nullptr dereference in KIO. @ David: If possible, please install debug symbols to get the line where it crashes.

pasting backtrace inline (please always do that in order to make it searchable):

Application: KDevelop (kdevelop), signal: Segmentation fault
[Current thread is 1 (Thread 0x7f07121cf760 (LWP 28943))]

Thread 16 (Thread 0x7f06f83ae700 (LWP 28956)):
#0  0x00007f070dfca81b in pthread_cond_timedwait () from /lib64/libpthread.so.0
#1  0x00007f070e257f11 in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f070aba9a2f in KDevelop::DUChainPrivate::CleanupThread::run (this=0x1900240) at /home/david/Projects/kdevplatform/language/duchain/duchain.cpp:282
#3  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#5  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 15 (Thread 0x7f06ebcd9700 (LWP 28959)):
#0  0x00007f070c679103 in select () from /lib64/libc.so.6
#1  0x00007f070e3229fb in QProcessManager::run() () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#3  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#4  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 14 (Thread 0x7f06e5034700 (LWP 28963)):
#0  0x00007f070c676cb3 in poll () from /lib64/libc.so.6
#1  0x00007f0707cfdd10 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f0707cfe1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f070e3718b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007f070e344d62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007f070e34514d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007f070e25445d in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#9  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 13 (Thread 0x7f06e4833700 (LWP 28964)):
#0  0x00007f070c676cb3 in poll () from /lib64/libc.so.6
#1  0x00007f0707cfdd10 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f0707cfe1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f070e3718b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007f070e344d62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007f070e34514d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007f070e25445d in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#9  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 12 (Thread 0x7f06dd6ce700 (LWP 28970)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070b840a64 in QTWTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib64/qt4/libQtScript.so.4
#2  0x00007f070b840a99 in QTWTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib64/qt4/libQtScript.so.4
#3  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#4  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 11 (Thread 0x7f06db45b700 (LWP 28978)):
#0  0x00007f070c676cb3 in poll () from /lib64/libc.so.6
#1  0x00007f0707cfdd10 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f0707cfe1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f070e3718b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007f070e344d62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007f070e34514d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007f070e25445d in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070e325108 in QInotifyFileSystemWatcherEngine::run() () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#10 0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 10 (Thread 0x7f06d9bbd700 (LWP 29035)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f07067d394d in WTF::TCMalloc_PageHeap::scavengerThread() () from /usr/lib64/qt4/libQtWebKit.so.4
#2  0x00007f07067d3a49 in WTF::TCMalloc_PageHeap::runScavengerThread(void*) () from /usr/lib64/qt4/libQtWebKit.so.4
#3  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#4  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 9 (Thread 0x7f06da3be700 (LWP 29036)):
#0  0x00007f070c676cb3 in poll () from /lib64/libc.so.6
#1  0x00007f0707cfdd10 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f0707cfe1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f070e3718b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007f070e344d62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007f070e34514d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007f070e25445d in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#9  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 8 (Thread 0x7f06d7473700 (LWP 29076)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070e257f9b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f0710609f24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#3  0x00007f071060c593 in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#4  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#5  0x00007f071060b387 in ThreadWeaver::ThreadRunHelper::run(ThreadWeaver::WeaverImpl*, ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#6  0x00007f071060b418 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#7  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#9  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 7 (Thread 0x7f06d6a5a700 (LWP 29167)):
#0  0x00007f070c676cb3 in poll () from /lib64/libc.so.6
#1  0x00007f0707cfdd10 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#2  0x00007f0707cfe1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#3  0x00007f070e3718b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#4  0x00007f070e344d62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#5  0x00007f070e34514d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#6  0x00007f070e25445d in QThread::exec() () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070e325108 in QInotifyFileSystemWatcherEngine::run() () from /usr/lib64/qt4/libQtCore.so.4
#8  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#10 0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 6 (Thread 0x7f06d6259700 (LWP 29168)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070e257f9b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f0710609f24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#3  0x00007f071060c593 in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#4  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#5  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#6  0x00007f071060b387 in ThreadWeaver::ThreadRunHelper::run(ThreadWeaver::WeaverImpl*, ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#7  0x00007f071060b418 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#8  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#10 0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 5 (Thread 0x7f06cffff700 (LWP 30856)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070e257f9b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f0710609f24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#3  0x00007f071060c593 in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#4  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#5  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#6  0x00007f071060b387 in ThreadWeaver::ThreadRunHelper::run(ThreadWeaver::WeaverImpl*, ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#7  0x00007f071060b418 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#8  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#10 0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 4 (Thread 0x7f06cf7fe700 (LWP 30857)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070e257f9b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f0710609f24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#3  0x00007f071060c593 in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#4  0x00007f071060b387 in ThreadWeaver::ThreadRunHelper::run(ThreadWeaver::WeaverImpl*, ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#5  0x00007f071060b418 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#6  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#8  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 3 (Thread 0x7f06ceffd700 (LWP 31026)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070e257f9b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f0710609f24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#3  0x00007f071060c593 in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#4  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#5  0x00007f071060c5ac in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#6  0x00007f071060b387 in ThreadWeaver::ThreadRunHelper::run(ThreadWeaver::WeaverImpl*, ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#7  0x00007f071060b418 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#8  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#9  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#10 0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 2 (Thread 0x7f06ce7fc700 (LWP 31027)):
#0  0x00007f070dfca49c in pthread_cond_wait () from /lib64/libpthread.so.0
#1  0x00007f070e257f9b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib64/qt4/libQtCore.so.4
#2  0x00007f0710609f24 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned(ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#3  0x00007f071060c593 in ThreadWeaver::WorkingHardState::applyForWork(ThreadWeaver::Thread*, ThreadWeaver::Job*) () from /usr/lib64/libthreadweaver.so.4
#4  0x00007f071060b387 in ThreadWeaver::ThreadRunHelper::run(ThreadWeaver::WeaverImpl*, ThreadWeaver::Thread*) () from /usr/lib64/libthreadweaver.so.4
#5  0x00007f071060b418 in ThreadWeaver::Thread::run() () from /usr/lib64/libthreadweaver.so.4
#6  0x00007f070e257405 in QThreadPrivate::start(void*) () from /usr/lib64/qt4/libQtCore.so.4
#7  0x00007f070dfc5bda in start_thread () from /lib64/libpthread.so.0
#8  0x00007f070c67f76d in clone () from /lib64/libc.so.6

Thread 1 (Thread 0x7f07121cf760 (LWP 28943)):
[KCrash Handler]
#6  0x0000000000000000 in ?? ()
#7  0x00007f07111dc037 in KIO::CopyJobPrivate::slotResultConflictCopyingFiles(KJob*) () from /usr/lib64/libkio.so.5
#8  0x00007f07111d7e6f in KIO::CopyJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5
#9  0x00007f070e35d91f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#10 0x00007f0711c6c282 in KJob::result(KJob*) () from /usr/lib64/libkdecore.so.5
#11 0x00007f0711c6c2c0 in KJob::emitResult() () from /usr/lib64/libkdecore.so.5
#12 0x00007f07112039a5 in KIO::SimpleJob::slotFinished() () from /usr/lib64/libkio.so.5
#13 0x00007f0711205447 in KIO::StatJob::slotFinished() () from /usr/lib64/libkio.so.5
#14 0x00007f07112053a9 in KIO::StatJob::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5
#15 0x00007f070e35d91f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#16 0x00007f07112ad9e1 in KIO::SlaveInterface::dispatch(int, QByteArray const&) () from /usr/lib64/libkio.so.5
#17 0x00007f07112aa96c in KIO::SlaveInterface::dispatch() () from /usr/lib64/libkio.so.5
#18 0x00007f071129dc9e in KIO::Slave::gotInput() () from /usr/lib64/libkio.so.5
#19 0x00007f071129e3d4 in KIO::Slave::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5
#20 0x00007f070e35d91f in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib64/qt4/libQtCore.so.4
#21 0x00007f07111d57cd in KIO::ConnectionPrivate::dequeue() () from /usr/lib64/libkio.so.5
#22 0x00007f07111d586d in KIO::Connection::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib64/libkio.so.5
#23 0x00007f070e357b6e in QObject::event(QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#24 0x00007f070d4d66ec in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#25 0x00007f070d4dba8d in QApplication::notify(QObject*, QEvent*) () from /usr/lib64/qt4/libQtGui.so.4
#26 0x00007f070eb443c6 in KApplication::notify(QObject*, QEvent*) () from /usr/lib64/libkdeui.so.5
#27 0x00007f070e345fdb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib64/qt4/libQtCore.so.4
#28 0x00007f070e348f31 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib64/qt4/libQtCore.so.4
#29 0x00007f070e371d53 in postEventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib64/qt4/libQtCore.so.4
#30 0x00007f0707cfd802 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#31 0x00007f0707cfdfe0 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#32 0x00007f0707cfe1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#33 0x00007f070e3718b3 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#34 0x00007f070d5872ae in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtGui.so.4
#35 0x00007f070e344d62 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#36 0x00007f070e34514d in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib64/qt4/libQtCore.so.4
#37 0x00007f070e349143 in QCoreApplication::exec() () from /usr/lib64/qt4/libQtCore.so.4
#38 0x000000000040a46a in main (argc=0, argv=0x7fff6ec6f6b8) at /home/david/Projects/kdevelop/app/main.cpp:479
Comment 4 David E. Narvaez 2011-10-18 19:14:19 UTC
You're right, sorry for the backtrace issue.

After reporting this I went on and did step by step debugging through kdelibs and tracked the issue  down to

http://api.kde.org/4.7-api/kdelibs-apidocs/kio/html/copyjob_8cpp_source.html#l01348

at that point nothing seemed wrong to me, although I might have missed something because I was kind of multitasking. I also tried reproducing it in a separate app to isolate the problem - no good.

I may be able to take a look at that again in a couple of days, hope this helps in the meantime.
Comment 5 David E. Narvaez 2011-10-19 11:52:31 UTC
Err, the error at that point seems to be at q->ui()->d
Comment 6 David E. Narvaez 2011-10-23 02:23:48 UTC
Full backtrace, including Qt debugging symbols:

Thread 1 (Thread 0x7fdb30bc0760 (LWP 18112)):
[KCrash Handler]
#6  0x0000000000000000 in ?? ()
#7  0x00007fdb2fb96456 in KIO::CopyJobPrivate::slotResultConflictCopyingFiles (this=0xb23b830, job=0xa9db780) at /home/david/Projects/kdelibs/kio/kio/copyjob.cpp:1355
#8  0x00007fdb2fb93d7d in KIO::CopyJob::qt_metacall (this=0xb51cc50, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7fffef759900) at /home/david/Projects/kdelibs/build/kio/copyjob.moc:121
#9  0x00007fdb2cba8fff in QMetaObject::metacall (object=0xb51cc50, cl=QMetaObject::InvokeMetaMethod, idx=43, argv=0x7fffef759900) at kernel/qmetaobject.cpp:237
#10 0x00007fdb2cbbe0db in QMetaObject::activate (sender=0xa9db780, m=0x7fdb309ed820, local_signal_index=3, argv=0x7fffef759900) at kernel/qobject.cpp:3278
#11 0x00007fdb30646c32 in KJob::result (this=<value optimized out>, _t1=0xa9db780) at /home/david/Projects/kdelibs/build/kdecore/kjob.moc:194
#12 0x00007fdb30646c75 in KJob::emitResult (this=0xa9db780) at /home/david/Projects/kdelibs/kdecore/jobs/kjob.cpp:312
#13 0x00007fdb2fbb77ff in KIO::SimpleJob::slotFinished (this=0xa9db780) at /home/david/Projects/kdelibs/kio/kio/job.cpp:494
#14 0x00007fdb2fbbb280 in KIO::StatJob::slotFinished (this=0xa9db780) at /home/david/Projects/kdelibs/kio/kio/job.cpp:896
#15 0x00007fdb2fbb8d35 in KIO::StatJob::qt_metacall (this=0xa9db780, _c=QMetaObject::InvokeMetaMethod, _id=2, _a=0x7fffef759be0) at /home/david/Projects/kdelibs/build/kio/jobclasses.moc:252
#16 0x00007fdb2cba8fff in QMetaObject::metacall (object=0xa9db780, cl=QMetaObject::InvokeMetaMethod, idx=42, argv=0x7fffef759be0) at kernel/qmetaobject.cpp:237
#17 0x00007fdb2cbbe0db in QMetaObject::activate (sender=0x6b18900, m=0x7fdb2ff93d60, local_signal_index=4, argv=0x0) at kernel/qobject.cpp:3278
#18 0x00007fdb2fc53169 in KIO::SlaveInterface::dispatch (this=<value optimized out>, _cmd=104, rawdata=...) at /home/david/Projects/kdelibs/kio/kio/slaveinterface.cpp:172
#19 0x00007fdb2fc51252 in KIO::SlaveInterface::dispatch (this=0x6b18900) at /home/david/Projects/kdelibs/kio/kio/slaveinterface.cpp:88
#20 0x00007fdb2fc4867d in KIO::Slave::gotInput (this=0x6b18900) at /home/david/Projects/kdelibs/kio/kio/slave.cpp:344
#21 0x00007fdb2fc48c1c in KIO::Slave::qt_metacall (this=0x6b18900, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0x7fffef75a060) at /home/david/Projects/kdelibs/build/kio/slave.moc:82
#22 0x00007fdb2cba8fff in QMetaObject::metacall (object=0x6b18900, cl=QMetaObject::InvokeMetaMethod, idx=30, argv=0x7fffef75a060) at kernel/qmetaobject.cpp:237
#23 0x00007fdb2cbbe0db in QMetaObject::activate (sender=0x76aac70, m=0x7fdb2ff8d840, local_signal_index=0, argv=0x0) at kernel/qobject.cpp:3278
#24 0x00007fdb2fb91734 in KIO::ConnectionPrivate::dequeue (this=0xb658340) at /home/david/Projects/kdelibs/kio/kio/connection.cpp:82
#25 0x00007fdb2fb917bd in KIO::Connection::qt_metacall (this=0x76aac70, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xb8934e0) at /home/david/Projects/kdelibs/build/kio/connection.moc:79
#26 0x00007fdb2cba8fff in QMetaObject::metacall (object=0x76aac70, cl=QMetaObject::InvokeMetaMethod, idx=5, argv=0xb8934e0) at kernel/qmetaobject.cpp:237
#27 0x00007fdb2cbb871e in QMetaCallEvent::placeMetaCall (this=0xb424ec0, object=0x76aac70) at kernel/qobject.cpp:535
#28 0x00007fdb2cbb99f9 in QObject::event (this=0x76aac70, e=0xb424ec0) at kernel/qobject.cpp:1217
#29 0x00007fdb2ba3ad00 in QApplicationPrivate::notify_helper (this=0x642ce0, receiver=0x76aac70, e=0xb424ec0) at kernel/qapplication.cpp:4509
#30 0x00007fdb2ba38324 in QApplication::notify (this=0x7fffef75b230, receiver=0x76aac70, e=0xb424ec0) at kernel/qapplication.cpp:3909
#31 0x00007fdb2d41ff76 in KApplication::notify (this=0x7fffef75b230, receiver=0x76aac70, event=0xb424ec0) at /home/david/Projects/kdelibs/kdeui/kernel/kapplication.cpp:311
#32 0x00007fdb2cba0e2b in QCoreApplication::notifyInternal (this=0x7fffef75b230, receiver=0x76aac70, event=0xb424ec0) at kernel/qcoreapplication.cpp:787
#33 0x00007fdb2cba4b5d in QCoreApplication::sendEvent (receiver=0x76aac70, event=0xb424ec0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#34 0x00007fdb2cba2064 in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=0, data=0x61bd50) at kernel/qcoreapplication.cpp:1428
#35 0x00007fdb2cba1c85 in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=0) at kernel/qcoreapplication.cpp:1321
#36 0x00007fdb2cbda8fb in QCoreApplication::sendPostedEvents () at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:220
#37 0x00007fdb2cbd98b4 in postEventSourceDispatch (s=0x6461f0) at kernel/qeventdispatcher_glib.cpp:277
#38 0x00007fdb2505e802 in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#39 0x00007fdb2505efe0 in g_main_context_iterate.clone.6 () from /usr/lib64/libglib-2.0.so.0
#40 0x00007fdb2505f1c1 in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#41 0x00007fdb2cbda1a3 in QEventDispatcherGlib::processEvents (this=0x642920, flags=...) at kernel/qeventdispatcher_glib.cpp:422
#42 0x00007fdb2bb13c7a in QGuiEventDispatcherGlib::processEvents (this=0x642920, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#43 0x00007fdb2cb9e98e in QEventLoop::processEvents (this=0x7fffef75ae70, flags=...) at kernel/qeventloop.cpp:149
#44 0x00007fdb2cb9eae2 in QEventLoop::exec (this=0x7fffef75ae70, flags=...) at kernel/qeventloop.cpp:201
#45 0x00007fdb2cba151e in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1064
#46 0x00007fdb2ba37e9c in QApplication::exec () at kernel/qapplication.cpp:3783
#47 0x000000000040a46a in main (argc=0, argv=0x7fffef75cfb8) at /home/david/Projects/kdevelop/app/main.cpp:479
Comment 7 David E. Narvaez 2011-10-24 02:39:28 UTC
Ok, here's the issue:

At KDevPlatform, in line 537 of runcontroller.cpp we reset the UI Delegate to be a K Ui Delegate[0]. Yet, the job in question is a CopyJob, which is a KIO Job, not a K Job. Thus, a CopyJob assumes it has a KIO Ui Delegate to ask for file renaming etc, and when it tries that, it tries to access it's internal UI Delegate, which is actually a K Ui Delegate, not a KIO one.

There are a couple of ways I can think of to solve this:

1. At KDevPlatform level, maybe not resetting the Ui Delegate if not needed (in the case of a CopyJob, it already has a KIO Ui Delegate)
2. At KDevPlatform, if we still want to reset the Ui Delegate, then we should try to guess via dynamic casts whether it's a KIO Job or a K Job (I've seen similar code in KDE PIM to distinguish different kinds of incicences)
3. At KDE Libs level, finding a way to block assigning a K Ui Delegate to a KIO Job - probably breaking the ABI so would need some discussion

I can do 1 or 2 (and maybe 3 if it's even possible) so what do you think?

[0] https://projects.kde.org/projects/extragear/kdevelop/kdevplatform/repository/revisions/8d45d2d116ea91f896177f21edffb0527b03d6d3/entry/shell/runcontroller.cpp#L537
Comment 8 Milian Wolff 2011-10-24 10:16:20 UTC
ouh looks nasty.

@kdelibs devs: should this not be handled more gracefully?

personally, I have no clue about this part yet, and would have to investigate. if you could try either 1) or 2) and see whether it helps, please put the patch on reviewboard and tell us your findings.

thanks
Comment 9 Andreas Pakulat 2011-11-28 22:00:48 UTC
Why does a plugin register a KIO job with the KDevelop run interface? I think a plugin should only register its own internal job-objects or job-objects obtained from the KDevPlatform API with the runcontroller. In particular it'll be surprising for the user that a KIO copy job is not showing up where its usually showing up. Maybe we should've created a KDevelop::JobController and a KDevelop::Job to make it clearer for plugin-authors they should only register those jobs and leave kio-jobs and others 'elsewhere'.

That being said, this clearly marks a bug in kdelibs, KIO::Job shouldn't crash if its ui-delegate is changed to something non-KIO. It either needs to be able to cope with the situation, or disallow changing the delegate in the first place (making the API private or re-implementing it and doing nothing in it).
Comment 10 David E. Narvaez 2011-12-19 03:02:51 UTC
Git commit 318d903a31aa02d5fe2ae0e3a7e69f3aae31b067 by David E. Narváez.
Committed on 19/12/2011 at 03:55.
Pushed by narvaez into branch 'master'.

Register Copy Job in KIO's Job Tracker

Avoid registering KIO Jobs in shell's runController.

BUG: 284148
REVIEW: 103454

M  +1    -1    plugins/patchreview/standardpatchexport.cpp

http://commits.kde.org/kdevplatform/318d903a31aa02d5fe2ae0e3a7e69f3aae31b067