Bug 218710 - Compiled against LibreSSL 2.5.3, audio/mumble crashes when trying to access any server
Summary: Compiled against LibreSSL 2.5.3, audio/mumble crashes when trying to access a...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: kde
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2017-04-17 17:42 UTC by Peter Kien
Modified: 2018-01-19 00:25 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (kde)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kien 2017-04-17 17:42:22 UTC
Hello, ;)

...and here's the backtrace (looks like a QT-related issue doesn't it?):

(gdb) bt
#0  0x00000008013ccd8c in X509_STORE_add_cert () from /usr/local/lib/libcrypto.so.41
#1  0x00000008042595ee in QSslSocket::qt_metacall () from /usr/local/lib/qt4/libQtNetwork.so.4
#2  0x000000080425ba0e in QSslSocket::qt_metacall () from /usr/local/lib/qt4/libQtNetwork.so.4
#3  0x0000000804257304 in QSslSocket::writeData () from /usr/local/lib/qt4/libQtNetwork.so.4
#4  0x00000008047a9b32 in QMetaObject::activate () from /usr/local/lib/qt4/libQtCore.so.4
#5  0x000000080423bf5f in QAbstractSocket::hostFound () from /usr/local/lib/qt4/libQtNetwork.so.4
#6  0x000000080423b12b in QAbstractSocket::disconnectFromHost ()
   from /usr/local/lib/qt4/libQtNetwork.so.4
#7  0x000000080424564a in QLocalServer::qt_metacall () from /usr/local/lib/qt4/libQtNetwork.so.4
#8  0x000000080360f42c in QApplicationPrivate::notify_helper () from /usr/local/lib/qt4/libQtGui.so.4
#9  0x0000000803611a52 in QApplication::notify () from /usr/local/lib/qt4/libQtGui.so.4
#10 0x0000000804791886 in QCoreApplication::notifyInternal () from /usr/local/lib/qt4/libQtCore.so.4
#11 0x00000008047bec10 in QEventDispatcherGlib::QEventDispatcherGlib ()
   from /usr/local/lib/qt4/libQtCore.so.4
#12 0x0000000806bdd7b5 in g_main_context_dispatch () from /usr/local/lib/libglib-2.0.so.0
#13 0x0000000806bddae4 in g_main_context_pending () from /usr/local/lib/libglib-2.0.so.0
#14 0x0000000806bddb74 in g_main_context_iteration () from /usr/local/lib/libglib-2.0.so.0
#15 0x00000008047be65e in QEventDispatcherGlib::processEvents () from /usr/local/lib/qt4/libQtCore.so.4
#16 0x000000080478ee82 in QEventLoop::exec () from /usr/local/lib/qt4/libQtCore.so.4
#17 0x000000080468908a in QThread::exec () from /usr/local/lib/qt4/libQtCore.so.4
#18 0x00000000004b4d78 in ?? ()
#19 0x000000080468acac in QThreadStorageData::finish () from /usr/local/lib/qt4/libQtCore.so.4
#20 0x0000000805434b55 in thread_start (curthread=<value optimized out>)
    at /usr/src/lib/libthr/thread/thr_create.c:289
#21 0x0000000000000000 in ?? ()
Comment 1 Bernard Spil freebsd_committer 2017-04-18 19:02:01 UTC
This is worth a try. Many structs have been made opaque. Should not access members directly but use getters and setters.

--- src/network/ssl/qsslsocket_openssl.cpp.orig	2017-04-18 20:42:48.949679000 +0200
+++ src/network/ssl/qsslsocket_openssl.cpp	2017-04-18 20:43:29.947710000 +0200
@@ -363,7 +363,7 @@ init_context:
         //
         // See also: QSslContext::fromConfiguration()
         if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
-            q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
+            q_X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), (X509 *)caCertificate.handle());
         }
     }
 

See https://github.com/openssl/openssl/blob/OpenSSL_1_0_1-stable/ssl/ssl_lib.c#L3070

X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *ctx)
{
    return (ctx->cert_store);
}
Comment 2 Peter Kien 2017-04-18 19:12:02 UTC
Thank you, Bernard. Your patch (for net/qt4-network) solved the problem.
Comment 3 Peter Kien 2017-05-03 16:56:01 UTC
Hello everyone,


I think the issue is fixed since LibreSSL 2.5.3_1

(Bernard's patch for qt4-network is no longer necessary. Also: this particular patch broke other ports, such as games/anki.)
Comment 4 Thibault Payet 2017-06-01 18:39:06 UTC
(In reply to Peter Kien from comment #3)
With libressl 2.5.4 , I still have the issue. Note that I did not apply the patch, so I think that the patch may be needed.
Comment 5 Thibault Payet 2017-06-11 14:25:55 UTC
With last version of mumble I don't have this issue anymore
Comment 6 Walter Schwarzenfeld freebsd_triage 2018-01-19 00:25:25 UTC
I assume this fixed and close here.