1 |
commit: 4ef658e0178b95b19e6d63e4ec0d759dae84b5e9 |
2 |
Author: Alexandre Rostovtsev <tetromino <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri May 27 06:31:53 2011 +0000 |
4 |
Commit: Nirbheek Chauhan <nirbheek <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 30 18:10:08 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gnome.git;a=commit;h=4ef658e0 |
7 |
|
8 |
gnome-base/nautilus: 3.0.1.1 → 3.0.2 |
9 |
|
10 |
* Add patch to fix bug #365779 (segfault in gtk_icon_info_load_symbolic |
11 |
when nautilus fails to find an icon). |
12 |
|
13 |
Signed-off-by: Nirbheek Chauhan <nirbheek <AT> gentoo.org> |
14 |
|
15 |
--- |
16 |
...2-segfault-in-gtk_icon_info_load_symbolic.patch | 88 ++++++++++++++++++++ |
17 |
...utilus-3.0.1.1.ebuild => nautilus-3.0.2.ebuild} | 3 + |
18 |
2 files changed, 91 insertions(+), 0 deletions(-) |
19 |
|
20 |
diff --git a/gnome-base/nautilus/files/nautilus-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch b/gnome-base/nautilus/files/nautilus-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch |
21 |
new file mode 100644 |
22 |
index 0000000..82781f7 |
23 |
--- /dev/null |
24 |
+++ b/gnome-base/nautilus/files/nautilus-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch |
25 |
@@ -0,0 +1,88 @@ |
26 |
+From a37ecf869f4772b1ea3b578b687b5b83dd4bd067 Mon Sep 17 00:00:00 2001 |
27 |
+From: Alexandre Rostovtsev <tetromino@×××××.com> |
28 |
+Date: Fri, 27 May 2011 01:10:24 -0400 |
29 |
+Subject: [PATCH] Prevent segfault in gtk_icon_info_load_symbolic when icon is not found (gnome bug 651209) |
30 |
+ |
31 |
+Users of Gentoo and Fedora have reported segfaults in nautilus-3.0.x |
32 |
+in gtk_icon_info_load_symbolic (see Gentoo bug 365779, Fedora bug |
33 |
+690357). One of them was helpful enough to post a backtrace with |
34 |
+debugging information: https://bugzilla.redhat.com/attachment.cgi?id=489928 |
35 |
+ |
36 |
+The backtrace shows that the crash occurs because we are passing a |
37 |
+NULL icon_info to gtk_icon_info_load_symbolic in lookup_and_color_symbolic_find |
38 |
+in nautilus-search-bar.c; indeed, icon_info will be NULL if |
39 |
+gtk_icon_theme_lookup_icon fails to find an icon. |
40 |
+ |
41 |
+An identical problem exists in get_eject_icon in nautilus-places-sidebar.c, |
42 |
+where gtk_icon_info_load_symbolic_for_context and |
43 |
+gtk_icon_theme_lookup_by_gicon are used. |
44 |
+ |
45 |
+The solution is to check for the NULL icon_info, and return a |
46 |
+NULL GdkPixbuf. Note that returning a NULL from |
47 |
+lookup_and_color_symbolic_find and get_eject_icon is |
48 |
+safe: in both cases, the return value is only used in functions |
49 |
+that can safely deal with a NULL. |
50 |
+--- |
51 |
+ src/nautilus-places-sidebar.c | 11 ++++++----- |
52 |
+ src/nautilus-search-bar.c | 9 +++++---- |
53 |
+ 2 files changed, 11 insertions(+), 9 deletions(-) |
54 |
+ |
55 |
+diff --git a/src/nautilus-places-sidebar.c b/src/nautilus-places-sidebar.c |
56 |
+index aa08f14..de53cd1 100644 |
57 |
+--- a/src/nautilus-places-sidebar.c |
58 |
++++ b/src/nautilus-places-sidebar.c |
59 |
+@@ -214,7 +214,7 @@ static GdkPixbuf * |
60 |
+ get_eject_icon (NautilusPlacesSidebar *sidebar, |
61 |
+ gboolean highlighted) |
62 |
+ { |
63 |
+- GdkPixbuf *eject; |
64 |
++ GdkPixbuf *eject = NULL; |
65 |
+ GtkIconInfo *icon_info; |
66 |
+ GIcon *icon; |
67 |
+ int icon_size; |
68 |
+@@ -227,10 +227,11 @@ get_eject_icon (NautilusPlacesSidebar *sidebar, |
69 |
+ icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, 0); |
70 |
+ |
71 |
+ style = gtk_widget_get_style_context (GTK_WIDGET (sidebar)); |
72 |
+- eject = gtk_icon_info_load_symbolic_for_context (icon_info, |
73 |
+- style, |
74 |
+- NULL, |
75 |
+- NULL); |
76 |
++ if (icon_info != NULL) |
77 |
++ eject = gtk_icon_info_load_symbolic_for_context (icon_info, |
78 |
++ style, |
79 |
++ NULL, |
80 |
++ NULL); |
81 |
+ |
82 |
+ if (highlighted) { |
83 |
+ GdkPixbuf *high; |
84 |
+diff --git a/src/nautilus-search-bar.c b/src/nautilus-search-bar.c |
85 |
+index 6148807..17412d9 100644 |
86 |
+--- a/src/nautilus-search-bar.c |
87 |
++++ b/src/nautilus-search-bar.c |
88 |
+@@ -160,7 +160,7 @@ lookup_and_color_symbolic_find (NautilusSearchBar *bar) |
89 |
+ { |
90 |
+ GtkIconInfo *icon_info; |
91 |
+ GdkRGBA color; |
92 |
+- GdkPixbuf *icon; |
93 |
++ GdkPixbuf *icon = NULL; |
94 |
+ GtkStyleContext *context; |
95 |
+ |
96 |
+ context = gtk_widget_get_style_context (GTK_WIDGET (bar)); |
97 |
+@@ -172,9 +172,10 @@ lookup_and_color_symbolic_find (NautilusSearchBar *bar) |
98 |
+ "edit-find-symbolic", |
99 |
+ nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU), |
100 |
+ GTK_ICON_LOOKUP_GENERIC_FALLBACK); |
101 |
+- icon = gtk_icon_info_load_symbolic (icon_info, &color, |
102 |
+- NULL, NULL, NULL, |
103 |
+- NULL, NULL); |
104 |
++ if (icon_info != NULL) |
105 |
++ icon = gtk_icon_info_load_symbolic (icon_info, &color, |
106 |
++ NULL, NULL, NULL, |
107 |
++ NULL, NULL); |
108 |
+ |
109 |
+ gtk_style_context_restore (context); |
110 |
+ |
111 |
+-- |
112 |
+1.7.5.rc3 |
113 |
+ |
114 |
|
115 |
diff --git a/gnome-base/nautilus/nautilus-3.0.1.1.ebuild b/gnome-base/nautilus/nautilus-3.0.2.ebuild |
116 |
similarity index 93% |
117 |
rename from gnome-base/nautilus/nautilus-3.0.1.1.ebuild |
118 |
rename to gnome-base/nautilus/nautilus-3.0.2.ebuild |
119 |
index f8fb449..da2ec5a 100644 |
120 |
--- a/gnome-base/nautilus/nautilus-3.0.1.1.ebuild |
121 |
+++ b/gnome-base/nautilus/nautilus-3.0.2.ebuild |
122 |
@@ -65,6 +65,9 @@ pkg_setup() { |
123 |
} |
124 |
|
125 |
src_prepare() { |
126 |
+ # Gentoo bug #365779 + https://bugzilla.gnome.org/show_bug.cgi?id=651209 |
127 |
+ epatch "${FILESDIR}/${PN}-3.0.2-segfault-in-gtk_icon_info_load_symbolic.patch" |
128 |
+ |
129 |
gnome2_src_prepare |
130 |
|
131 |
# Remove crazy CFLAGS |