vCard: PHOTO/LOGO is a single value attribute
Using libebook-contacts-1.2-3 from Debian testing, I see this crash with a specific contact killer.vcf just by starting up geary (it is interesting that geary seems to parse ALL my contacts even without a mail account configured, but that is a different story)
$ geary
![crt] 19:54:50.0542 GLib:Did not see expected message GLib-GObject-WARNING **: g_object_weak_unref: couldn't find weak ref *
*[wrn] 19:54:50.0543 libebook-contacts:e_vcard_attribute_get_value called on multivalued attribute
Stack trace of thread 7771:
#0 0x0000ffffa02b92ac __GI_raise (libc.so.6 + 0x372ac)
#1 0x0000ffffa06571d8 g_logv (libglib-2.0.so.0 + 0x5b1d8)
#2 0x0000ffffa0657440 g_log (libglib-2.0.so.0 + 0x5b440)
#3 0x0000ffff8c3f4df4 e_vcard_attribute_get_value (libebook-contacts-1.2.so.3 + 0x18df4)
#4 0x0000ffff8c3ea8a0 photo_getter (libebook-contacts-1.2.so.3 + 0xe8a0)
#5 0x0000ffff8c582934 _edsf_persona_update_avatar (libfolks-eds.so.25 + 0x24934)
#6 0x0000ffff8c584ee8 edsf_persona_constructor (libfolks-eds.so.25 + 0x26ee8)
#7 0x0000ffffa0759df8 n/a (libgobject-2.0.so.0 + 0x1adf8)
#8 0x0000ffffa075bcf4 g_object_new_valist (libgobject-2.0.so.0 + 0x1ccf4)
#9 0x0000ffffa075bf70 g_object_new (libgobject-2.0.so.0 + 0x1cf70)
#10 0x0000ffff8c580438 edsf_persona_construct (libfolks-eds.so.25 + 0x22438)
#11 0x0000ffff8c56b840 _edsf_persona_store_contacts_added_idle (libfolks-eds.so.25 + 0xd840)
#12 0x0000ffff8c56e308 _edsf_persona_store_idle_process (libfolks-eds.so.25 + 0x10308)
#13 0x0000ffffa064fab4 g_main_context_dispatch (libglib-2.0.so.0 + 0x53ab4)
#14 0x0000ffffa064fe5c n/a (libglib-2.0.so.0 + 0x53e5c)
#15 0x0000ffffa06501b0 g_main_loop_run (libglib-2.0.so.0 + 0x541b0)
#16 0x0000ffff9f9af280 gtk_dialog_run (libgtk-3.so.0 + 0x1c3280)
#17 0x0000ffffa0895020 application_client_show_accounts_co (libgeary-client-40.alpha.so + 0xd6020)
#18 0x0000ffffa04b7f1c n/a (libgio-2.0.so.0 + 0xbff1c)
#19 0x0000ffffa04b8e14 n/a (libgio-2.0.so.0 + 0xc0e14)
#20 0x0000ffffa0894f24 application_client_present_co (libgeary-client-40.alpha.so + 0xd5f24)
#21 0x0000ffffa04b7f1c n/a (libgio-2.0.so.0 + 0xbff1c)
#22 0x0000ffffa04b8e14 n/a (libgio-2.0.so.0 + 0xc0e14)
#23 0x0000ffffa08967e4 application_client_create_controller_co (libgeary-client-40.alpha.so + 0xd77e4)
#24 0x0000ffffa04b7f1c n/a (libgio-2.0.so.0 + 0xbff1c)
#25 0x0000ffffa04b7f68 n/a (libgio-2.0.so.0 + 0xbff68)
#26 0x0000ffffa064fab4 g_main_context_dispatch (libglib-2.0.so.0 + 0x53ab4)
#27 0x0000ffffa064fe5c n/a (libglib-2.0.so.0 + 0x53e5c)
#28 0x0000ffffa064ff24 g_main_context_iteration (libglib-2.0.so.0 + 0x53f24)
#29 0x0000ffffa04e9ac8 g_application_run (libgio-2.0.so.0 + 0xf1ac8)
#30 0x0000aaaaca1a0f18 _vala_main (geary + 0xf18)
#31 0x0000ffffa02a6218 __libc_start_main (libc.so.6 + 0x24218)
#32 0x0000aaaaca1a0dc4 $x (geary + 0xdc4)
#33 0x0000aaaaca1a0dc4 $x (geary + 0xdc4)
It crashes in photo_getter() at So I would say it crashes here: https://gitlab.gnome.org/GNOME/evolution-data-server/-/blob/master/src/addressbook/libebook-contacts/e-contact.c#L715
The function e_vcard_attribute_get_value logs the above error which only occurs if in e_vcard_attribute_get_value(), the function e_vcard_attribute_is_single_valued
returns FALSE.
So somehow, the following function returns FALSE for our contact photo->data.uri. src/addressbook/libebook-contacts/e-vcard.c:
e_vcard_attribute_is_single_valued (EVCardAttribute *attr)
{
g_return_val_if_fail (attr != NULL, FALSE);
if (attr->values == NULL
|| attr->values->next != NULL)
return FALSE;
return TRUE;
}
This is as far as I got. The attached killer.vcf can be used to reproduce the crash with geary.
Edited by Milan Crha