Re: Balsa exit with code 01 [SVN version]



Jean-Luc:

On 04/14/2007 08:28:47 AM Sat, Jean-Luc Coulon (f5ibh) wrote:
Hi Peter,
[ snip ]
I've found a couple of spam messages taht trigger the problem again.
I sent the mbox bzip2 on the list but the message is awaiting moderation because it was slightly too big (40k is the limit).
Can I send it to you directly ?

Thanks for the new spam!  I managed to get some back-traces, which showed

*** glibc detected *** src/balsa: free(): invalid pointer: 0x0a32b7b8 ***

deep in libfreetype. I just updated to freetype-2.3.4-1.fc7 (from freetype-2.3.3-2.fc7) and the problem has gone away, so the issue seems to have been with freetype.

The attached patch ellipsizes long strings, which leaves the bubble pretty much useless, but at least it's not empty :-(

I still get

Pango-WARNING **: Invalid UTF-8 string passed to pango_layout_set_text()

from some of the messages, but that seems to come from a Gtk idle handler; Gtk doesn't complain about the strings that Balsa passes to it, so I'm not sure where those invalid strings come from.

Best,

Peter
Index: libbalsa/information.c
===================================================================
--- libbalsa/information.c	(revision 7579)
+++ libbalsa/information.c	(working copy)
@@ -59,6 +59,7 @@
 #else
     NotifyNotification *note;
     char *icon_str;
+    gchar *message_str;
 #endif
 
     g_return_if_fail(fmt != NULL);
@@ -85,11 +86,22 @@
 	icon_str = NULL;
         break;
     }
-    note = notify_notification_new("Balsa", g_strdup_vprintf(fmt,ap),
-                                   icon_str, NULL);
+    message_str = g_strdup_vprintf(fmt,ap);
+    if (g_utf8_strlen(message_str, -1) > 36) {
+        /* Too long for NotifyNotification?  Ellipsize... */
+        gchar *p;
+        guint i;
+        for (i = 0, p = message_str; i < 32 && *p; i++)
+            p = g_utf8_next_char(p);
+        for (i = 0; i < 3; i++)
+            *p++ = '.';
+        *p = '\0';
+    }
+    note = notify_notification_new("Balsa", message_str, icon_str, NULL);
+    g_free(message_str);
     notify_notification_set_timeout (note, 7000); /* 7 seconds */
     notify_notification_show (note, NULL);
-    g_object_unref(G_OBJECT(note));
+    g_object_unref(note);
 
 #else
     data->parent = parent;


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