Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2017 10:11:44 +0000
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)
Message-ID:  <bug-218652-21822-DJ2u6qAGpG@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-218652-21822@https.bugs.freebsd.org/bugzilla/>
References:  <bug-218652-21822@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Sylvain Garrigues <sylvain@sylvaingarrigues.com> has reassigned Bugzilla
Automation <bugzilla@FreeBSD.org>'s request for maintainer-feedback to Free=
BSD
Python <python@FreeBSD.org>:
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-218652-21822-DJ2u6qAGpG>