From owner-freebsd-python@freebsd.org  Fri Apr 14 10:11:45 2017
Return-Path: <owner-freebsd-python@freebsd.org>
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 06A17D3BE58
 for <freebsd-python@mailman.ysv.freebsd.org>;
 Fri, 14 Apr 2017 10:11:45 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3])
 by mx1.freebsd.org (Postfix) with ESMTP id E46B86CE
 for <freebsd-python@freebsd.org>; Fri, 14 Apr 2017 10:11:44 +0000 (UTC)
 (envelope-from bugzilla-noreply@freebsd.org)
Received: by mailman.ysv.freebsd.org (Postfix)
 id E3DC6D3BE57; 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 E38F0D3BE56
 for <python@mailman.ysv.freebsd.org>; 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 C8B286CD
 for <python@FreeBSD.org>; 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 v3EABi5F053150
 for <python@FreeBSD.org>; Fri, 14 Apr 2017 10:11:44 GMT
 (envelope-from bugzilla-noreply@freebsd.org)
From: bugzilla-noreply@freebsd.org
To: python@FreeBSD.org
Subject: [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-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
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: sylvain@sylvaingarrigues.com
X-Bugzilla-Status: New
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: ---
X-Bugzilla-Assigned-To: python@FreeBSD.org
X-Bugzilla-Flags: maintainer-feedback?
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
 op_sys bug_status bug_severity priority component assigned_to reporter
 flagtypes.name
Message-ID: <bug-218652-21822@https.bugs.freebsd.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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 <freebsd-python.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-python>, 
 <mailto:freebsd-python-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-python/>
List-Post: <mailto:freebsd-python@freebsd.org>
List-Help: <mailto:freebsd-python-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-python>,
 <mailto:freebsd-python-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 14 Apr 2017 10:11:45 -0000

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D218652

            Bug ID: 218652
           Summary: lang/python36: thread issue in external library (both
                    ctypes and C extension)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: python@FreeBSD.org
          Reporter: sylvain@sylvaingarrigues.com
          Assignee: python@FreeBSD.org
             Flags: maintainer-feedback?(python@FreeBSD.org)

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

--=20
You are receiving this mail because:
You are the assignee for the bug.=