summaryrefslogtreecommitdiff
path: root/app-office/libreoffice/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-02-11 16:09:52 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-02-11 16:09:52 +0000
commitf78108598211053d41752a83e0345441bb9014ae (patch)
treedd2fc7ae0a1aea7bda4942ab0c453d1e55284b37 /app-office/libreoffice/files
parentdc45b83b28fb83e9659492066e347b8dc60bc9e3 (diff)
gentoo resync : 11.02.2018
Diffstat (limited to 'app-office/libreoffice/files')
-rw-r--r--app-office/libreoffice/files/libreoffice-5.4.5.1-pyuno-crash.patch87
-rw-r--r--app-office/libreoffice/files/libreoffice-6.0.0.1-poppler-0.62.patch44
2 files changed, 87 insertions, 44 deletions
diff --git a/app-office/libreoffice/files/libreoffice-5.4.5.1-pyuno-crash.patch b/app-office/libreoffice/files/libreoffice-5.4.5.1-pyuno-crash.patch
new file mode 100644
index 000000000000..850f56465c77
--- /dev/null
+++ b/app-office/libreoffice/files/libreoffice-5.4.5.1-pyuno-crash.patch
@@ -0,0 +1,87 @@
+From 42e2c4af310deb7660b07c6307459c9d2a42bb8b Mon Sep 17 00:00:00 2001
+From: Michael Stahl <mstahl@redhat.com>
+Date: Thu, 1 Feb 2018 13:52:00 +0100
+Subject: tdf#114815 pyuno: avoid 2 threads initing python in parallel
+
+According to the crash reports, it's possible for the grammar checking
+thread to call GetGrammarChecker, instantiating lightproof, at the same
+time as the main thread instantiates LngSvcMgr, which also instantiates
+(some?) (all?) grammar checkers.
+
+Ensure that pyuno_loader::CreateInstance() initialises Python only
+once with a C++11 thread safe static.
+
+For the backport, use rtl::Static instead, because on the 5.4 branch
+MSVC does not have HAVE_THREADSAFE_STATICS enabled.
+
+Change-Id: I5b1faba9107355c508831a078366e4a29fdbfadf
+(cherry picked from commit 5357ca82846ea7147ad61e9340f25647a5934eb0)
+Reviewed-on: https://gerrit.libreoffice.org/49116
+Tested-by: Jenkins <ci@libreoffice.org>
+Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
+(cherry picked from commit 362b0c521c1c58dc8ea5e87ecbb482d5bdc073f4)
+Reviewed-on: https://gerrit.libreoffice.org/49298
+Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
+Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
+Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
+---
+ pyuno/source/loader/pyuno_loader.cxx | 25 +++++++++++++++++++++----
+ 1 file changed, 21 insertions(+), 4 deletions(-)
+
+diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
+index adbf6c8..0408af0 100644
+--- a/pyuno/source/loader/pyuno_loader.cxx
++++ b/pyuno/source/loader/pyuno_loader.cxx
+@@ -31,6 +31,7 @@
+ #include <rtl/ustrbuf.hxx>
+ #include <rtl/strbuf.hxx>
+ #include <rtl/bootstrap.hxx>
++#include <rtl/instance.hxx>
+
+ #include <cppuhelper/implementationentry.hxx>
+ #include <cppuhelper/factory.hxx>
+@@ -176,11 +177,10 @@ static void prependPythonPath( const OUString & pythonPathBootstrap )
+ osl_setEnvironment(envVar.pData, envValue.pData);
+ }
+
+-Reference< XInterface > CreateInstance( const Reference< XComponentContext > & ctx )
++struct PythonInit
+ {
+- Reference< XInterface > ret;
+-
+- if( ! Py_IsInitialized() )
++PythonInit() {
++ if (! Py_IsInitialized()) // may be inited by getComponentContext() already
+ {
+ OUString pythonPath;
+ OUString pythonHome;
+@@ -236,9 +236,26 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c
+ // PyThreadAttach below.
+ PyThreadState_Delete(tstate);
+ }
++}
++};
++
++namespace {
++ struct thePythonInit : public rtl::Static<PythonInit, thePythonInit> {};
++}
++
++Reference<XInterface> CreateInstance(const Reference<XComponentContext> & ctx)
++{
++ // tdf#114815 thread-safe static to init python only once
++ thePythonInit::get();
++
++ Reference< XInterface > ret;
+
+ PyThreadAttach attach( PyInterpreterState_Head() );
+ {
++ // note: this can't race against getComponentContext() because
++ // either (in soffice.bin) CreateInstance() must be called before
++ // getComponentContext() can be called, or (in python.bin) the other
++ // way around
+ if( ! Runtime::isInitialized() )
+ {
+ Runtime::initialize( ctx );
+--
+cgit v1.1
+
diff --git a/app-office/libreoffice/files/libreoffice-6.0.0.1-poppler-0.62.patch b/app-office/libreoffice/files/libreoffice-6.0.0.1-poppler-0.62.patch
deleted file mode 100644
index f0ecc3b990b4..000000000000
--- a/app-office/libreoffice/files/libreoffice-6.0.0.1-poppler-0.62.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-Fix build with >=poppler-0.62.0, cleanup ifdef and raise minimum poppler version.
-
---- a/configure.ac 2017-12-12 18:45:07.000000000 +0100
-+++ b/configure.ac 2018-01-04 23:57:16.410999542 +0100
-@@ -10403,7 +10403,7 @@
- if test "$with_system_poppler" = "yes"; then
- AC_MSG_RESULT([external])
- SYSTEM_POPPLER=TRUE
-- PKG_CHECK_MODULES( POPPLER, poppler >= 0.12.0 )
-+ PKG_CHECK_MODULES( POPPLER, poppler >= 0.21.1 )
- AC_LANG_PUSH([C++])
- save_CXXFLAGS=$CXXFLAGS
- save_CPPFLAGS=$CPPFLAGS
---- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 2017-12-12 18:45:07.000000000 +0100
-+++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx 2018-01-05 00:29:16.541246738 +0100
-@@ -32,13 +32,11 @@
- #pragma warning(push, 1)
- #endif
-
--// sigh, UTF8.h was removed in poppler-0.21.0 and put back in 0.21.1
- // FIXME: we can't use #if POPPLER_CHECK_VERSION(0, 21, 0) && !POPPLER_CHECK_VERSION(0, 21, 1)
- // because the internal poppler does not provide poppler-version.h and the macro always returns 0
--#if POPPLER_CHECK_VERSION(0, 21, 1)
--#include <UTF8.h>
--#elif POPPLER_CHECK_VERSION(0, 21, 0)
--#include "UTF.h"
-+// UTF8.h was renamed to UnicodeMapFuncs.h in poppler-0.62.0
-+#if POPPLER_CHECK_VERSION(0, 62, 0)
-+#include "UnicodeMapFuncs.h"
- #else
- #include "UTF8.h"
- #endif
-@@ -918,7 +916,11 @@
- );
-
- // silence spurious warning
-+#if POPPLER_CHECK_VERSION(0, 62, 0)
-+ (void)&mapUTF16;
-+#else
- (void)&mapUCS2;
-+#endif
-
- char buf[9];
- for( int i=0; i<uLen; ++i )