[Soylent-devel] [BUG][PATCH] Soylent on 64 bits



Hi,

Soylent crashes when I click on a person. I tested the last SVN
version with a 64 bits laptop. Stack:

#0  0x00002b0c12fa1b50 in strlen () from /lib/libc.so.6
#1  0x00002b0c12853003 in g_strdup () from /usr/lib/libglib-2.0.so.0
#2  0x0000000000406c69 in sb_get_selected_people_e_uid (sb=<value optimized out>
)
    at soylent-browser.c:144
#3  0x0000000000406dd3 in sb_get_selected_people_e_contact (sb=0x2b0c00a167c0) a
t soylent-browser.c:81
#4  0x0000000000409cd6 in sb_person_selected_email_menu_update_cb (btntb_email=0
x6d93e0,
    user_data=0x6526a0) at soylent-browser-person-view.c:483
#5  0x0000000000409e9b in sb_person_selection_changed_cb (iv=0x88d080,
    user_data=<value optimized out>) at soylent-browser-person-view.c:778


The GtkListStore model use a string for the PEOPLE_COL_UID column
everywhere, except in this declaration where it uses a int:

liststore = gtk_list_store_new (NUM_PEOPLE_COLS,
                                G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF);

On my laptop:
- sizeof(gchar*) == 8
- sizeof(int) == 4

I guess it retrieves only the 4 four bytes with this call:
gtk_tree_model_get (model, &iter, PEOPLE_COL_UID, &e_uid, -1);
And the e_uid pointer is corrupted.

The following patch fixes my problem.

Index: src/soylent-browser.c
===================================================================
--- src/soylent-browser.c       (r?vision 14)
+++ src/soylent-browser.c       (copie de travail)
@@ -278,7 +278,7 @@
     GTK_ICON_VIEW (glade_xml_get_widget (wtree, "iv_people"));

   liststore = gtk_list_store_new (NUM_PEOPLE_COLS,
-                                  G_TYPE_INT, G_TYPE_STRING, GDK_TYPE_PIXBUF);
+                                  G_TYPE_STRING, G_TYPE_STRING,
GDK_TYPE_PIXBUF);

   gtk_icon_view_set_model (iconview, GTK_TREE_MODEL (liststore));
   gtk_icon_view_set_text_column (iconview, PEOPLE_COL_NAME);


-- 
Alban



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]