Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.10.1, 5.11.0
-
None
-
I built Qt 5.10.1 myself, linked against OpenSSL 1.1.0h. This was needed due to improved multithreading capabilities in OSSL 1.1.0.
This is the fragment of code I use:
manager = new QNetworkAccessManager(this);
std::string Loader::getContent(std::string inURL)\{
std::string result = "";
url = QUrl(inURL.c_str());
while(true)\{
QNetworkRequest request = QNetworkRequest(url);
QEventLoop loop;
connect(manager, SIGNAL(finished(QNetworkReply*)),&loop, SLOT(quit()));
QNetworkReply *netReply = manager->get(request);
loop.exec();
if(netReply->error() == QNetworkReply::NoError)\{
result = QByteArray(netReply->readAll()).constData();
netReply->deleteLater();
break;
}
else\{
DebugMsg << "Error loading: " << inURL << ". Retrying";
netReply->deleteLater();
}
}
return result;
}
Your help is kindly requested.I built Qt 5.10.1 myself, linked against OpenSSL 1.1.0h. This was needed due to improved multithreading capabilities in OSSL 1.1.0. This is the fragment of code I use: manager = new QNetworkAccessManager(this); std::string Loader::getContent(std::string inURL)\{ std::string result = ""; url = QUrl(inURL.c_str()); while(true)\{ QNetworkRequest request = QNetworkRequest(url); QEventLoop loop; connect(manager, SIGNAL(finished(QNetworkReply*)),&loop, SLOT(quit())); QNetworkReply *netReply = manager->get(request); loop.exec(); if(netReply->error() == QNetworkReply::NoError)\{ result = QByteArray(netReply->readAll()).constData(); netReply->deleteLater(); break; } else\{ DebugMsg << "Error loading: " << inURL << ". Retrying"; netReply->deleteLater(); } } return result; } Your help is kindly requested.
Description
I am using QNAM to crawl sites, which are SSL encrypted.
For example: https://sofifa.com
Now I see a memory leak in valgrind, coming from QSslCertificate:
==5614== 26 bytes in 2 blocks are definitely lost in loss record 233 of 1,060
==5614== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5614== by 0x8862711: ASN1_STRING_set (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886AFDF: asn1_d2i_ex_primitive (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886CD87: asn1_item_embed_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886B447: asn1_template_noexp_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886C16C: asn1_template_ex_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886B683: asn1_template_noexp_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886C16C: asn1_template_ex_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886CF91: ASN1_item_ex_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x886D89A: ASN1_item_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x89C074A: X509V3_EXT_d2i (in /usr/local/lib/libcrypto.so.1.1)
==5614== by 0x4185A38: QSslCertificate::subjectAlternativeNames() const (in /usr/local/Qt-5.10.1/lib/libQt5Network.so.5.10.1)
EDIT: Installing 5.11 did not solve the issue
==27818== 26 bytes in 2 blocks are definitely lost in loss record 899 of 2,231
==27818== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==27818== by 0xD32B711: ASN1_STRING_set (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD333FDF: asn1_d2i_ex_primitive (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD335D87: asn1_item_embed_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD334447: asn1_template_noexp_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD33516C: asn1_template_ex_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD334683: asn1_template_noexp_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD33516C: asn1_template_ex_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD335F91: ASN1_item_ex_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD33689A: ASN1_item_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0xD48974A: X509V3_EXT_d2i (in /usr/local/lib/libcrypto.so.1.1)
==27818== by 0x4186598: QSslCertificate::subjectAlternativeNames() const (in /home/mkuhlmann/qt5.11-GCC/lib/libQt5Network.so.5.11.0)
Attachments
Issue Links
- duplicates
-
QTBUG-57679 memory leak in QSslCertificate::subjectAlternativeNames?
- Closed