summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-01-11 15:38:04 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-01-11 15:45:43 +0100
commit56a5362705d98d27f0ffe2d20efd10defeb7ec18 (patch)
tree8fbaa17e00fc78574b8db6c81e1f5b17a9e2e739
parentfb0c22d8f1e0cbc25983c19528202743c04b6d97 (diff)
downloadnautilus-56a5362705d98d27f0ffe2d20efd10defeb7ec18.tar.gz
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.
-rw-r--r--libnautilus-private/nautilus-thumbnails.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/libnautilus-private/nautilus-thumbnails.c b/libnautilus-private/nautilus-thumbnails.c
index e04ed84ba..d52677ce7 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