Comment 1 for bug 2044420

Revision history for this message
Matthew Ruffell (mruffell) wrote :

Okay, so fuzzy_skip_prefix() in libgtkpod calls g_utf8_collate_key() twice in a loop, once with len=3 and then once with len=2.

I found this by patching fuzzy_skip_prefix() like so:

libgtkpod/misc.c

 458 const gchar *
 459 fuzzy_skip_prefix(const gchar *name) {
 460 const gchar *result = name;
 461 const GList *gl;
 462 gchar *cleanStr;
...
 470 cleanStr = g_utf8_casefold(name, -1);
 471 for (gl = csfk_list; gl; gl = g_list_next(gl)) {
 472 struct csfk *csfk = gl->data;
 473 gchar *tempStr;
 474
 475 g_return_val_if_fail (csfk, 0);
+476 fprintf(stderr, "Song name: %s length: %d\n", cleanStr, csfk->length);
 477 tempStr = g_utf8_collate_key(cleanStr, csfk->length);
...

I get output like this:

...
Song name: fórmula, vol. 2 (deluxe edition) length: 3
Song name: fórmula, vol. 2 (deluxe edition) length: 2
Thread 1 "gtkpod" received signal SIGSEGV, Segmentation fault.
__GI___wcsxfrm_l (dest=0x0, src=0x0, n=0, l=0x7ffff6fff5a0 <_nl_global_locale>) at ../string/strxfrm_l.c:685
685 ../string/strxfrm_l.c: No such file or directory.
(gdb) bt
#0 __GI___wcsxfrm_l (dest=0x0, src=0x0, n=0, l=0x7ffff6fff5a0 <_nl_global_locale>) at ../string/strxfrm_l.c:685
#1 0x00007ffff70c5a5e in g_utf8_collate_key () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2 0x00007ffff7f82c5a in fuzzy_skip_prefix () at /lib/x86_64-linux-gnu/libgtkpod.so.1

It seems to not like special characters, in this case, the ó.

I also looked on the Arch Linux AUR page, and it seems others have also noticed that special characters are breaking them too.

https://aur.archlinux.org/packages/gtkpod#comment-936852