When a DownloadTask is run then it segfaults randomly inside on Qt. Sometimes it dies in QNetworkRequest req{url};, sometimes in if (!httpUser.isEmpty() && !httpPass.isEmpty()) { or auto *rep = netmgr.get(req);.
And it only happens on Linux. Tested using Qt 5.2 and 5.4.
(gdb) r
Starting program: /mnt/hgfs/netrom/git/efdl/build_linux14/bin/efdl -c 1 --chunk-size 2000000 --show-http-headers --verbose http://download.keyshot.com/keyshot_mac64_5.1.66.pkg
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff3e00700 (LWP 48119)]
Downloading http://download.keyshot.com/keyshot_mac64_5.1.66.pkg
HEAD http://download.keyshot.com/keyshot_mac64_5.1.66.pkg
[New Thread 0x7ffff2fc7700 (LWP 48120)]
[New Thread 0x7ffff27c6700 (LWP 48121)]
CODE 206
HEADERS [x-amz-id-2: OAh5l8fQEy4drSavXJK1R7OLFike8gR5O8tZvZnyw4Gp2M6DBLStna0hC8RNJLkN] [x-amz-request-id: 6124F59586E126FE] [Date: Sun, 22 Mar 2015 19:01:55 GMT] [Last-Modified: Thu, 18 Dec 2014 08:51:06 GMT] [ETag: "6257aa911d5ba667215200c3d2ce1138-8"] [Accept-Ranges: bytes] [Content-Range: bytes 0-0/473279315] [Content-Type: application/octet-stream] [Content-Length: 1] [Server: AmazonS3]
File size 451.4 MB [application/octet-stream]
RESUMABLE
Saving to /mnt/hgfs/netrom/git/efdl/build_linux14/keyshot_mac64_5.1.66.pkg
CHUNK SIZE 1.9 MB
CHUNKS 237
[ Starting up download.. ]
[New Thread 0x7ffff1795700 (LWP 48129)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff1795700 (LWP 48129)]
0x00007ffff7ad5668 in QUrl::operator=(QUrl const&) () from /usr/local/Qt-5.4.0/lib/libQt5Core.so.5
(gdb) bt
0 0x00007ffff7ad5668 in QUrl::operator=(QUrl const&) () from /usr/local/Qt-5.4.0/lib/libQt5Core.so.5
1 0x00007ffff7f175b0 in QNetworkRequest::QNetworkRequest(QUrl const&) () from /usr/local/Qt-5.4.0/lib/libQt5Network.so.5
2 0x0000000000434c18 in efdl::DownloadTask::run (this=0x687110) at /mnt/hgfs/netrom/git/efdl/src/core/DownloadTask.cpp:22
3 0x00007ffff7954f8f in ?? () from /usr/local/Qt-5.4.0/lib/libQt5Core.so.5
4 0x00007ffff6dbe182 in start_thread (arg=0x7ffff1795700) at pthread_create.c:312
5 0x00007ffff70cf00d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
(gdb) f 2
2 0x0000000000434c18 in efdl::DownloadTask::run (this=0x687110) at /mnt/hgfs/netrom/git/efdl/src/core/DownloadTask.cpp:22
22 QNetworkRequest req{url};
(gdb) l
17 void DownloadTask::onProgress(qint64 received, qint64 total) {
18 emit progress(num, received, total);
19 }
20
21 void DownloadTask::run() {
22 QNetworkRequest req{url};
23 req.setRawHeader("Accept-Encoding", "identity");
24
25 // Only set range information if appropriate.
26 qint64 start = range.first, end = range.second;
(gdb) info threads
Id Target Id Frame
(*) 5 Thread 0x7ffff1795700 (LWP 48129) "efdl::DownloadT" 0x0000000000434c18 in efdl::DownloadTask::run (this=0x687110) at /mnt/hgfs/netrom/git/efdl/src/core/DownloadTask.cpp:22
4 Thread 0x7ffff27c6700 (LWP 48121) "Thread (pooled)" pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238
3 Thread 0x7ffff2fc7700 (LWP 48120) "Qt HTTP thread" 0x00007ffff70c6a09 in __pselect (nfds=10, readfds=0x7fffe4000a78, writefds=0x7fffe4000d08, exceptfds=0x7fffe4000f98,
timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:77
2 Thread 0x7ffff3e00700 (LWP 48119) "Qt bearer threa" 0x00007ffff70c6a09 in __pselect (nfds=7, readfds=0x7fffec000a78, writefds=0x7fffec000d08, exceptfds=0x7fffec000f98,
timeout=, sigmask=) at ../sysdeps/unix/sysv/linux/pselect.c:77
1 Thread 0x7ffff7e86780 (LWP 48115) "efdl" 0x00007ffff79594b0 in QByteArray::append(char) () from /usr/local/Qt-5.4.0/lib/libQt5Core.so.5
When a
DownloadTaskis run then it segfaults randomly inside on Qt. Sometimes it dies inQNetworkRequest req{url};, sometimes inif (!httpUser.isEmpty() && !httpPass.isEmpty()) {orauto *rep = netmgr.get(req);.And it only happens on Linux. Tested using Qt 5.2 and 5.4.