[arch-commits] Commit in nautilus/trunk (PKGBUILD thumbnail-fix-jp2-crash.patch)

Jan de Groot jgc at archlinux.org
Wed Jan 13 14:14:58 UTC 2016


    Date: Wednesday, January 13, 2016 @ 15:14:57
  Author: jgc
Revision: 258165

upgpkg: nautilus 3.18.4-2

Fix thumbnailer crash with jp2 images (FS#44314?)

Added:
  nautilus/trunk/thumbnail-fix-jp2-crash.patch
Modified:
  nautilus/trunk/PKGBUILD

-------------------------------+
 PKGBUILD                      |   13 ++++++++---
 thumbnail-fix-jp2-crash.patch |   46 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-01-13 14:02:23 UTC (rev 258164)
+++ PKGBUILD	2016-01-13 14:14:57 UTC (rev 258165)
@@ -4,7 +4,7 @@
 pkgbase=nautilus
 pkgname=(nautilus libnautilus-extension)
 pkgver=3.18.4
-pkgrel=1
+pkgrel=2
 pkgdesc="GNOME file manager"
 arch=(i686 x86_64)
 license=(GPL)
@@ -13,9 +13,15 @@
 makedepends=(intltool gobject-introspection python packagekit)
 url="http://www.gnome.org"
 options=('!emptydirs')
-source=(http://download.gnome.org/sources/$pkgbase/${pkgver:0:4}/$pkgbase-$pkgver.tar.xz)
-sha256sums=('4ff2c78dba352b4666bb30e0c80ed786eed09199fd624f00810fce4d987fcd26')
+source=(http://download.gnome.org/sources/$pkgbase/${pkgver:0:4}/$pkgbase-$pkgver.tar.xz
+        thumbnail-fix-jp2-crash.patch)
+sha256sums=('4ff2c78dba352b4666bb30e0c80ed786eed09199fd624f00810fce4d987fcd26'
+            'bccf39bf042638ec0d7224914860d664a24d56534dcb82a8887e76ff8cc1d3ce')
 
+prepare() {
+  cd $pkgbase-$pkgver
+  patch -Np1 -i ../thumbnail-fix-jp2-crash.patch
+}
 
 build() {
   cd $pkgbase-$pkgver
@@ -24,6 +30,7 @@
       --libexecdir=/usr/lib/nautilus \
       --disable-update-mimedb \
       --disable-schemas-compile
+  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0 /g' -e 's/    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then/      func_append compile_command " -Wl,-O1,--as-needed"\n      func_append finalize_command " -Wl,-O1,--as-needed"\n\0/' libtool
   make
 }
 

Added: thumbnail-fix-jp2-crash.patch
===================================================================
--- thumbnail-fix-jp2-crash.patch	                        (rev 0)
+++ thumbnail-fix-jp2-crash.patch	2016-01-13 14:14:57 UTC (rev 258165)
@@ -0,0 +1,46 @@
+From 079d349206c2dd182df82e4b26e3e23c9b7a75c4 Mon Sep 17 00:00:00 2001
+From: Carlos Soriano <csoriano at gnome.org>
+Date: Mon, 11 Jan 2016 15:38:04 +0100
+Subject: thumbnails: avoid crash with jp2 images
+
+When thumbnailing a directory with jp2 some times nautilus
+was crashing.
+However tests on gdk_pixbuf were successful and gnome-desktop-thumbnails
+generation tests were also working.
+
+Also, nautilus is using raw pthreads in the thumbnail generation
+code, and seems the crash was actually only happening when inside the
+pthread and when using gdk-pixbuf, not only the gnome-desktop-thumbnail.
+
+Looking at the implementation of glib in threads and nautilus, one of
+the differences is that nautilus sets a stack size.
+The crash is happening because, unluckely, libjasper with some big
+images is using more stack size than the one nautilus is setting, which
+leads to a crash in libjasper.
+
+To fix it, remove the stack size set by nautilus, similarly to what glib
+does, not setting an actual stack size.
+
+Obviously the right thing to do is rewrite nautilus code to use the
+glib threads, but I want to let that as a newcomer bug to do.
+---
+ libnautilus-private/nautilus-thumbnails.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/libnautilus-private/nautilus-thumbnails.c b/libnautilus-private/nautilus-thumbnails.c
+index e04ed84..d52677c 100644
+--- a/libnautilus-private/nautilus-thumbnails.c
++++ b/libnautilus-private/nautilus-thumbnails.c
+@@ -163,9 +163,6 @@ thumbnail_thread_starter_cb (gpointer data)
+ 	pthread_attr_init (&thread_attributes);
+ 	pthread_attr_setdetachstate (&thread_attributes,
+ 				     PTHREAD_CREATE_DETACHED);
+-#ifdef _POSIX_THREAD_ATTR_STACKSIZE
+-	pthread_attr_setstacksize (&thread_attributes, 128*1024);
+-#endif
+ #ifdef DEBUG_THUMBNAILS
+ 	g_message ("(Main Thread) Creating thumbnails thread\n");
+ #endif
+-- 
+cgit v0.11.2
+



More information about the arch-commits mailing list