Bug 348934 - Kwrite hangs while opening non-empty files via sftp
Summary: Kwrite hangs while opening non-empty files via sftp
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: kwrite (show other bugs)
Version: 5.0.0
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-09 16:28 UTC by Jakub
Modified: 2016-01-31 18:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub 2015-06-09 16:28:49 UTC
Kwrite seems to deadlock while opening files via sftp:

Thread 2 (Thread 0x7fffd989d700 (LWP 13258)):
#0  0x00007ffff133266d in poll () at ../sysdeps/unix/syscall-template.S:81
#1  0x00007fffe9a1e182 in _xcb_conn_wait (__timeout=-1, __nfds=1, __fds=0x7fffd989cbc0) at /usr/include/bits/poll2.h:46
#2  0x00007fffe9a1e182 in _xcb_conn_wait (c=c@entry=0x62f550, cond=cond@entry=0x62f590, vector=vector@entry=0x0, count=count@entry=0x0) at xcb_conn.c:459
#3  0x00007fffe9a1fd07 in xcb_wait_for_event (c=0x62f550) at xcb_in.c:623
#4  0x00007fffdb3e47d9 in QXcbEventReader::run() (this=0x638f30) at qxcbconnection.cpp:1114
#5  0x00007ffff1f3ce3e in QThreadPrivate::start(void*) (arg=0x638f30) at thread/qthread_unix.cpp:337
#6  0x00007fffeee3b555 in start_thread (arg=0x7fffd989d700) at pthread_create.c:333
#7  0x00007ffff133df3d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109

Thread 1 (Thread 0x7ffff7f41900 (LWP 13254)):
#0  0x00007ffff1338239 in syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1  0x00007ffff1f34fe8 in QBasicMutex::lockInternal() (op=0, val=3, timeout=0x0, addr=0x7ffff6de6360 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>) at thread/qmutex_linux.cpp:146
#2  0x00007ffff1f34fe8 in QBasicMutex::lockInternal() (timeout=-1, elapsedTimer=0x0, d_ptr=...) at thread/qmutex_linux.cpp:187
#3  0x00007ffff1f34fe8 in QBasicMutex::lockInternal() (this=this@entry=0x7ffff6de6360 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>) at thread/qmutex_linux.cpp:203
#4  0x00007ffff1f35089 in QMutex::lock() (this=this@entry=0x7ffff6de6360 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>) at thread/qmutex.cpp:217
#5  0x00007ffff6b58594 in KProtocolManager::proxiesForUrl(QUrl const&) (m=0x7ffff6de6360 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>, this=<synthetic pointer>) at /usr/include/qt5/QtCore/qmutex.h:128
#6  0x00007ffff6b58594 in KProtocolManager::proxiesForUrl(QUrl const&) (url=...) at ../../../src/core/kprotocolmanager.cpp:535
#7  0x00007ffff6b59984 in KProtocolManager::slaveProtocol(QUrl const&, QStringList&) (url=..., proxyList=...) at ../../../src/core/kprotocolmanager.cpp:654
#8  0x00007ffff6b488b2 in KIO::SchedulerPrivate::doJob(KIO::SimpleJob*) (this=0x1254c70, job=job@entry=0x1256690) at ../../../src/core/scheduler.cpp:954
#9  0x00007ffff6b48a85 in KIO::Scheduler::doJob(KIO::SimpleJob*) (job=job@entry=0x1256690) at ../../../src/core/scheduler.cpp:792
#10 0x00007ffff6b334c1 in KIO::SimpleJobPrivate::simpleJobInit() (this=<optimized out>) at ../../../src/core/simplejob.cpp:48
#11 0x00007ffff6b272ed in KIO::DirectCopyJob::DirectCopyJob(QUrl const&, QByteArray const&) (this=0x1256690, url=..., packedArgs=...) at ../../../src/core/job.cpp:279
#12 0x00007ffff6b2894e in KIO::FileCopyJobPrivate::startCopyJob(QUrl const&) (this=this@entry=0x12794d0, slave_url=...) at ../../../src/core/filecopyjob.cpp:219
#13 0x00007ffff6b2918b in KIO::FileCopyJobPrivate::startBestCopyMethod() (this=this@entry=0x12794d0) at ../../../src/core/filecopyjob.cpp:174
#14 0x00007ffff6b2959d in KIO::FileCopyJobPrivate::slotStart() (this=0x12794d0) at ../../../src/core/filecopyjob.cpp:159
#15 0x00007ffff6b2ab89 in KIO::FileCopyJob::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) (_o=<optimized out>, _c=<optimized out>, _id=<optimized out>, _a=<optimized out>) at ./moc_filecopyjob.cpp:116
#16 0x00007ffff214df41 in QObject::event(QEvent*) (this=0x1278f40, e=<optimized out>) at kernel/qobject.cpp:1245
#17 0x00007ffff306b77c in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=this@entry=0x621dc0, receiver=receiver@entry=0x1278f40, e=e@entry=0xa722d0) at kernel/qapplication.cpp:3720
#18 0x00007ffff3070e20 in QApplication::notify(QObject*, QEvent*) (this=0x7fffffffd760, receiver=0x1278f40, e=0xa722d0) at kernel/qapplication.cpp:3503
#19 0x00007ffff211c67b in QCoreApplication::notifyInternal(QObject*, QEvent*) (this=0x7fffffffd760, receiver=0x1278f40, event=event@entry=0xa722d0) at kernel/qcoreapplication.cpp:935
#20 0x00007ffff211e7b7 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (event=0xa722d0, receiver=<optimized out>) at kernel/qcoreapplication.h:228
#21 0x00007ffff211e7b7 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) (receiver=receiver@entry=0x0, event_type=event_type@entry=0, data=0x620c60) at kernel/qcoreapplication.cpp:1552
#22 0x00007ffff211ece8 in QCoreApplication::sendPostedEvents(QObject*, int) (receiver=receiver@entry=0x0, event_type=event_type@entry=0) at kernel/qcoreapplication.cpp:1410
#23 0x00007ffff2173763 in postEventSourceDispatch(GSource*, GSourceFunc, gpointer) (s=0x6636e0) at kernel/qeventdispatcher_glib.cpp:271
#24 0x00007fffedbe9a8a in g_main_context_dispatch (context=0x7fffd40016f0) at gmain.c:3122
#25 0x00007fffedbe9a8a in g_main_context_dispatch (context=context@entry=0x7fffd40016f0) at gmain.c:3737
#26 0x00007fffedbe9e20 in g_main_context_iterate (context=context@entry=0x7fffd40016f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3808
#27 0x00007fffedbe9ecc in g_main_context_iteration (context=0x7fffd40016f0, may_block=1) at gmain.c:3869
#28 0x00007ffff2173b6f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x6636c0, flags=...) at kernel/qeventdispatcher_glib.cpp:418
#29 0x00007ffff2119eba in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7fffffffd560, flags=..., flags@entry=...) at kernel/qeventloop.cpp:204
#30 0x00007ffff2121a2c in QCoreApplication::exec() () at kernel/qcoreapplication.cpp:1188
#31 0x00007ffff2633a8c in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1507
#32 0x00007ffff3067c15 in QApplication::exec() () at kernel/qapplication.cpp:2956
#33 0x00007ffff7bcf305 in kdemain(int, char**) (argc=2, argv=<optimized out>) at ../../kwrite/main.cpp:266
#34 0x00007ffff125c790 in __libc_start_main (main=0x4009a0 <main(int, char**)>, argc=2, argv=0x7fffffffd8b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffd8a8) at libc-start.c:289
#35 0x00000000004009d9 in _start ()

There are XCB related errors in .xsession-errors:
QXcbConnection: XCB error: 3 (BadWindow), sequence: 25829, resource id: 94371841, major code: 18 (ChangeProperty), minor code: 0
QXcbConnection: XCB error: 3 (BadWindow), sequence: 25833, resource id: 94371842, major code: 18 (ChangeProperty), minor code: 0
kwin_core: User timestamp, ASN: 52810931
kwin_core: User timestamp, final: 'ID: 94371847 ;WMCLASS: "kwrite" : "kwrite" ;Caption: "Untitled  — KWrite" ' : 52810931
kwin_core: Activation, compared: 'ID: 94371847 ;WMCLASS: "kwrite" : "kwrite" ;Caption: "Untitled  — KWrite" ' : 52810931 : 52810931 : true 

kwin_core: screens:  3 desktops:  1
kwin_core: Done.

Reproducible: Always

Steps to Reproduce:
1. Open reachable non-empty file using sftp.

Actual Results:  
Kwrite (and its window) hangs while opening file over sftp, doesn't react to closing, has to be interrupted to end.

Expected Results:  
File should be opened over sftp, allowing to modify remote version of it.

Proxy is configured (via systemsettings and /etc/environment), sftp resource is available in local network and is reachable via ssh.
versions:
kwrite.x86_64                        15.04.0-1.fc22 (5.0.0)
kate4-part.x86_64                    4.14.3-14.fc22
libkate.x86_64                       0.4.1-5.fc22
kio-extras.x86_64                    5.3.0-1.fc22

There might be some problems with ownership of folders .cache and .config in my home directory (due to unusual setup some files may be claimed by root user), that doesn't seem to be the cause however.
Comment 1 Christoph Cullmann 2016-01-31 18:31:07 UTC
Author: David Faure <faure@kde.org>
Date:   Fri May 15 01:52:15 2015 +0200

    Fix single-thread deadlocks when using proxies
    
    BUG: 346214
    FIXED-IN: 5.11
    CHANGELOG: fix deadlock when using network proxies
    
    Change-Id: I216d365f21fb2be886e8515cf255cf49c1bad115