The following commit has been merged in the ubuntu-precise-3.5 branch: commit 68e06a61d41dc5caf4f68b773316c51fd7dab6cc Author: Bjoern Michaelsen <bjoern.michael...@canonical.com> Date: Tue Jan 8 19:26:05 2013 +0100
lp#1097370: multi-threaded XIOError segv diff --git a/changelog b/changelog index 0992f0e..2cb3145 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,7 @@ libreoffice (1:3.5.7-0ubuntu3) UNRELEASED; urgency=low * backport SdModule::GetSdOptions: Process /usr/lib64/libreoffice/program/soffice.bin was killed by signal 11 (SIGSEGV) (LP: #1097323) * backport crash when scrolling in multiselection in slide sorter (LP: #1097360) + * backport multi-threaded XIOError segv (LP: #1097370) -- Bjoern Michaelsen <bjoern.michael...@canonical.com> Tue, 08 Jan 2013 17:09:36 +0100 diff --git a/patches/lp-1097370-rhbz-855541-XIOError-handler-multithread-wo.diff b/patches/lp-1097370-rhbz-855541-XIOError-handler-multithread-wo.diff new file mode 100644 index 0000000..ea38b32 --- /dev/null +++ b/patches/lp-1097370-rhbz-855541-XIOError-handler-multithread-wo.diff @@ -0,0 +1,74 @@ +From d32f17fd4826fb0cc703cef7d208f32f17c7a76c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caol...@redhat.com> +Date: Wed, 12 Sep 2012 13:44:09 +0100 +Subject: [PATCH] Resolves: rhbz#855541 XIOError handler multithread woes + +We have two threads using X, on an XIOError both +threads call their XIOError handlers and two +calls to exit trample all over eachother. + +Change-Id: I20defc6f84cc6ea2372a0d6c979e8078fe920a88 +--- + vcl/unx/generic/app/saldata.cxx | 6 ++++++ + vcl/unx/gtk/app/gtkdata.cxx | 14 ++++++++++++++ + 2 files changed, 20 insertions(+) + +diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx +index 306fc4e..1629d47 100644 +--- a/vcl/unx/generic/app/saldata.cxx ++++ b/vcl/unx/generic/app/saldata.cxx +@@ -332,6 +332,12 @@ int X11SalData::XErrorHdl( Display *pDisplay, XErrorEvent *pEvent ) + + int X11SalData::XIOErrorHdl( Display * ) + { ++ if (::osl::Thread::getCurrentIdentifier() != Application::GetMainThreadIdentifier()) ++ { ++ pthread_exit(NULL); ++ return 0; ++ } ++ + /* #106197# hack: until a real shutdown procedure exists + * _exit ASAP + */ +diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx +index fbc3b22..3fb09b7 100644 +--- a/vcl/unx/gtk/app/gtkdata.cxx ++++ b/vcl/unx/gtk/app/gtkdata.cxx +@@ -535,6 +535,18 @@ GtkData::GtkData( SalInstance *pInstance ) + m_aDispatchCondition = osl_createCondition(); + } + ++XIOErrorHandler aOrigXIOErrorHandler = NULL; ++ ++int XIOErrorHdl(Display *pDisplay) ++{ ++ if (::osl::Thread::getCurrentIdentifier() != Application::GetMainThreadIdentifier()) ++ { ++ pthread_exit(NULL); ++ return 0; ++ } ++ return aOrigXIOErrorHandler ? aOrigXIOErrorHandler(pDisplay) : 0; ++} ++ + GtkData::~GtkData() + { + Yield( true, true ); +@@ -554,6 +566,7 @@ GtkData::~GtkData() + osl_destroyCondition( m_aDispatchCondition ); + osl_releaseMutex( m_aDispatchMutex ); + osl_destroyMutex( m_aDispatchMutex ); ++ XSetIOErrorHandler(aOrigXIOErrorHandler); + } + + void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents ) +@@ -668,6 +681,7 @@ void GtkData::Init() + // init gtk/gdk + gtk_init_check( &nParams, &pCmdLineAry ); + gdk_error_trap_push(); ++ aOrigXIOErrorHandler = XSetIOErrorHandler(XIOErrorHdl); + + for (i = 0; i < nParams; i++ ) + g_free( pCmdLineAry[i] ); +-- +1.7.10.4 + diff --git a/patches/series b/patches/series index b36211d..7d30db4 100644 --- a/patches/series +++ b/patches/series @@ -37,3 +37,4 @@ lp-904212-add-missing-mimetypes-to-impress.desktop.diff improve-faux-bold-font.diff lp-1097323-rhbz-806663-SlideshowImpl-can-outlive-SdMod.diff lp-1097560-rhbz-842292-crash-in-calling-callback-whose.diff +lp-1097370-rhbz-855541-XIOError-handler-multithread-wo.diff -- LibreOffice packaging repository -- To UNSUBSCRIBE, email to debian-openoffice-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: http://lists.debian.org/e1ttcmh-0003xz...@vasks.debian.org