[PyQt] Segfault on exit with QSslSocket and qInstallMessageHandler

Florian Bruhin me at the-compiler.org
Fri Jun 2 17:12:28 BST 2017


Hi,

When running the PyQt wheels with OpenSSL 1.1, a lot of stuff gets
logged because symbols can't be resolved (as they're built against 1.0).

This logging seems to cause a segfault on exit:

	from PyQt5.QtCore import qInstallMessageHandler
	from PyQt5.QtNetwork import QSslSocket
	qInstallMessageHandler(lambda typ, ctx, msg: print(msg))
	QSslSocket.supportsSsl()

Log:

	QSslSocket: cannot resolve CRYPTO_num_locks
	[...]
	QSslSocket: cannot call unresolved function SSL_library_init

	Program received signal SIGSEGV, Segmentation fault.
	0x00007ffff7bcbdd9 in sem_wait@@GLIBC_2.2.5 () from /usr/lib/libpthread.so.0
	(gdb) bt
	#0  0x00007ffff7bcbdd9 in sem_wait@@GLIBC_2.2.5 () from /usr/lib/libpthread.so.0
	#1  0x00007ffff73ae9e5 in PyThread_acquire_lock_timed () from /usr/lib/libpython3.6m.so.1.0
	#2  0x00007ffff74a620d in ?? () from /usr/lib/libpython3.6m.so.1.0
	#3  0x00007ffff73439cb in ?? () from /usr/lib/libpython3.6m.so.1.0
	#4  0x00007ffff6545047 in qtcore_MessageHandler(QtMsgType, QMessageLogContext const&, QString const&) () from .../site-packages/PyQt5/QtCore.so
	#5  0x00007ffff5de14f8 in ?? () from .../site-packages/PyQt5/Qt/lib/libQt5Core.so.5
	#6  0x00007ffff5de21e9 in QMessageLogger::warning(char const*, ...) const () from .../site-packages/PyQt5/Qt/lib/libQt5Core.so.5
	#7  0x00007ffff220bf08 in ?? () from .../site-packages/PyQt5/Qt/lib/libQt5Network.so.5
	#8  0x00007ffff220c300 in ?? () from .../site-packages/PyQt5/Qt/lib/libQt5Network.so.5
	#9  0x00007ffff220716c in ?? () from .../site-packages/PyQt5/Qt/lib/libQt5Network.so.5
	#10 0x00007ffff784d298 in __run_exit_handlers () from /usr/lib/libc.so.6
	#11 0x00007ffff784d2ea in exit () from /usr/lib/libc.so.6
	#12 0x00007ffff7837441 in __libc_start_main () from /usr/lib/libc.so.6
	#13 0x0000000000400b9a in _start ()

Adding a QCoreApplication to the example doesn't change anything.

Florian

-- 
https://www.qutebrowser.org  | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072  | https://the-compiler.org/pubkey.asc
         I love long mails!  | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20170602/e3b69d40/attachment.sig>


More information about the PyQt mailing list