From owner-freebsd-python@freebsd.org Fri Apr 14 10:11:44 2017 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C100AD3BE4E for ; Fri, 14 Apr 2017 10:11:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id AA83A6CA for ; Fri, 14 Apr 2017 10:11:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id A9F42D3BE4D; Fri, 14 Apr 2017 10:11:44 +0000 (UTC) Delivered-To: python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9A4AD3BE4C for ; Fri, 14 Apr 2017 10:11:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FF896C7 for ; Fri, 14 Apr 2017 10:11:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id v3EABi5B053150 for ; Fri, 14 Apr 2017 10:11:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" From: bugzilla-noreply@freebsd.org To: python@FreeBSD.org Subject: maintainer-feedback requested: [Bug 218652] lang/python36: thread issue in external library (both ctypes and C extension) Date: Fri, 14 Apr 2017 10:11:44 +0000 X-Bugzilla-Type: request X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: python@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? Message-ID: In-Reply-To: References: X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Apr 2017 10:11:44 -0000 Sylvain Garrigues has reassigned Bugzilla Automation 's request for maintainer-feedback to Free= BSD Python : Bug 218652: lang/python36: thread issue in external library (both ctypes an= d C extension) https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D218652 --- Description --- Hello,=20 I have libsylvain.so which has just one function (sylvain_display()) which displays an hello world windows through QT libraries. I have this one program `sylvain' which is a single line program which calls sylvain_display from libsylvain.so. When I run `sylvain', I have some debug output from QT on the console, and = the hello world window is displayed on my TV (I am running this on a Raspberry = Pi with FreeBSD). Now, when I run python2.7 or python3.6, and load libsylvain.so either throu= gh the ctypes module or through a C extension module, and call the sylvain_display() function from python, I have the console log output from = QT as with the `sylvain' program, but I don't have the window on my TV! I guess the rendering to the TV is done on a separate thread and this one is not called or locked? I came up with this simple test program to isolate the issue because both P= yQT and PySide now don't work as expected, I have console log but no actual TV output. This used to work one year ago, I don't know what has changed in Python.=20 Hope you guys will figure this out. libsylvain.cpp: http://dev.sylvaingarrigues.com/libsylvain.cpp sylvain.cpp (test program for libsylvain): http://dev.sylvaingarrigues.com/sylvain.cpp=20 sylvain-ctypes.py (load libsylvain): http://dev.sylvaingarrigues.com/sylvain-ctypes.py Also tried with a C extension to rule out ctypes bug, same issue: sylvainmodule.cpp (python module wrapper): http://dev.sylvaingarrigues.com/sylvainmodule.cpp sylvain-next.pu (load sylvainmodule and sylvain_display): http://dev.sylvaingarrigues.com/sylvain-cext.py build script: http://dev.sylvaingarrigues.com/build.sh