Package: mypaint / 2.0.1-12

Metadata

Package Version Patches format
mypaint 2.0.1-12 3.0 (quilt)

Patch series

view the series file
Patch File delta Description
python3.11.patch | (download)

lib/gettext_setup.py | 25 2 + 23 - 0 !
setup.py | 2 1 + 1 - 0 !
2 files changed, 3 insertions(+), 24 deletions(-)

 [patch] python: fix for python 3.11

- python 3 always open in universal mode, U is default mode in 3.0,
  and removed in 3.11
- mypaint doesn't use ld?n?gettext, so bind_textdomain_codeset isn't
  needed, that function is deprecated in 3.8 and is no-ops in 3.10 and
  removed in 3.11

0002 Handle python3 distutils removal.patch | (download)

setup.py | 22 2 + 20 - 0 !
tests/unported/performance.py | 6 3 + 3 - 0 !
2 files changed, 5 insertions(+), 23 deletions(-)

 handle python3-distutils removal

Bug: https://github.com/mypaint/mypaint/issues/1228

fix_openmp_segfault.patch | (download)

lib/brush.hpp | 16 14 + 2 - 0 !
lib/pythontiledsurface.cpp | 7 5 + 2 - 0 !
lib/tiledsurface.hpp | 4 3 + 1 - 0 !
3 files changed, 22 insertions(+), 5 deletions(-)

 [patch] acquire/release the gil while processing tile requests

Fixes crashes on some Linux distros, potentially improves performance.

When handling tile requests we currently use an openmp critical block in a
callback registered with libmypaint. The callback calls into Python code
without locking the GIL. This sometimes crashes mypaint in numpy's memory
cache allocator on some Linux distros that compile numpy with run-time
asserts (without `-DNDEBUG`), like Gentoo, as numpy uses Python's GIL
internally as a locking mechanism for its non-thread-safe global cache
management.

Acquiring the GIL in the C callback, before calling into Python, ensures
that the GIL is still locked by the current thread when it reaches numpy's
code, and thus prevents the crashes. We yield the GIL whenever Python code
calls again into libmypaint, This allows other threads to acquire it, and
concurrent callbacks to run, which prevents deadlocks that would otherwise
happen while waiting for all the callbacks to finish on Python's side. When
libmypaint is done we re-acquire the GIL, and return up to the callback
where the GIL is released again after some Python reference count
bookkeeping.

The OpenMP critical block is no longer necessary after introducing the GIL
locking mechanism. This would potentially improve performance as the C code
in libmypaint can process multiple callbacks at the same time during the
`Py_BEGIN_ALLOW_THREADS' period that yields the GIL.