Summary: | invalid proxy causes hang | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kio | Reporter: | Jonathan Riddell <jr> |
Component: | general | Assignee: | David Faure <faure> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | kde, kdelibs-bugs |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kio/9b600da2a5cb8b1881dd670144bf7218b17ccf2b | Version Fixed In: | 5.11 |
Sentry Crash Report: |
Description
Jonathan Riddell
2015-04-15 10:54:14 UTC
Can confirm this issue. It actually triggers on *any* proxy configuration, even valid ones. (Tested with a local mitmproxy instance.) Here's a backtrace with debuginfo: #0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38 #1 0x00007ffff64f0940 in _q_futex (op=<optimized out>, val=<optimized out>, timeout=<optimized out>, addr=<optimized out>) at thread/qmutex_linux.cpp:146 #2 lockInternal_helper<false> (timeout=<optimized out>, elapsedTimer=<optimized out>, d_ptr=...) at thread/qmutex_linux.cpp:187 #3 QBasicMutex::lockInternal (this=this@entry=0x7ffff7607e40 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>) at thread/qmutex_linux.cpp:203 #4 0x00007ffff64f09e9 in QMutex::lock (this=this@entry=0x7ffff7607e40 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>) at thread/qmutex.cpp:217 #5 0x00007ffff7382cc4 in QMutexLocker (m=0x7ffff7607e40 <(anonymous namespace)::Q_QGS_kProtocolManagerPrivate::innerFunction()::holder>, this=<synthetic pointer>) at /usr/include/x86_64-linux-gnu/qt5/QtCore/qmutex.h:128 #6 KProtocolManager::proxiesForUrl (url=...) at ../../../src/core/kprotocolmanager.cpp:535 #7 0x00007ffff738466d in KProtocolManager::slaveProtocol (url=..., proxyList=...) at ../../../src/core/kprotocolmanager.cpp:654 #8 0x00007ffff7375010 in KIO::SchedulerPrivate::doJob (this=0x887900, job=job@entry=0x8872e0) at ../../../src/core/scheduler.cpp:954 #9 0x00007ffff73753f5 in KIO::Scheduler::doJob (job=job@entry=0x8872e0) at ../../../src/core/scheduler.cpp:792 #10 0x00007ffff7361ba1 in KIO::SimpleJobPrivate::simpleJobInit (this=<optimized out>) at ../../../src/core/simplejob.cpp:48 #11 0x00007ffff736bab9 in KIO::TransferJob::TransferJob (this=0x8872e0, dd=...) at ../../../src/core/transferjob.cpp:32 #12 0x00007ffff736c2bc in newJob (flags=..., _staticData=..., packedArgs=..., command=67, url=...) at ../../../src/core/job_p.h:293 #13 KIO::get (url=..., reload=KIO::NoReload, flags=...) at ../../../src/core/transferjob.cpp:432 #14 0x0000000000406063 in ClientApp::doIt(QCommandLineParser const&) () #15 0x0000000000404452 in main () The root cause of this seems to be in KProtocolManager - KProtocolManager::slaveProtocol locks kProtocolManagerPrivate()->mutex (kprotocolmanager.cpp:646), then calls KProtocolManager::proxiesForUrl (line 654), which tries to lock the same non-recursive mutex (line 535), causing an instant deadlock. If proxies are turned off, slaveProtocol bails early (lines 638-39), which explains how this made it through testing. Git commit 9b600da2a5cb8b1881dd670144bf7218b17ccf2b by David Faure. Committed on 15/05/2015 at 00:26. Pushed by dfaure into branch 'master'. Fix single-thread deadlocks when using proxies FIXED-IN: 5.11 CHANGELOG: fix deadlock when using network proxies Change-Id: I216d365f21fb2be886e8515cf255cf49c1bad115 M +30 -0 autotests/kprotocolinfotest.cpp M +53 -27 src/core/kprotocolmanager.cpp http://commits.kde.org/kio/9b600da2a5cb8b1881dd670144bf7218b17ccf2b |