From: Armin B. <arm...@de...> - 2006-01-12 00:47:38
|
R=C3=A9my Amouroux wrote: > Hello >=20 > I had a SIGSEV during my first sync between evo2 and the file-sync > plugin. >=20 > My investigation sofar shows that it is related to the presence of > non-utf8 characters in the stuff sent by evo2. >=20 > in a first case, I was able to pinpoint the problem on the description > and I just removed the description of the event (see trace 1). It seems= > that by updating the event, I changed something and it was better. >=20 > I had another problem, similar. see trace 2. >=20 > Looks like my problems are related to old entries, so I will purge evo2= > to make sure I don't have the problem anymore. But it would be cool to > ensure that a SIGSEV cannot arise. >=20 > thus ... >=20 > I did a gdb session to understand where exactly was the SIGSEV. see > trace 3. >=20 > It seems that when vformat is creating a list of attributes that is not= > valid, the function vcal_parse_attributes is not handling them well. >=20 > Using a for loop is maybe not a good idea in that function since there > are other location where the variable a is modified. >=20 Hi, thanks for your help! i can confirm the crash. I added a test case for the vcal parser that triggers the crash. The problem is that the vformat parser stops parsing at the invalid utf8 input and therefore the resulting object is different than what opensync expects. so there are 3 issues to fix here: - the crash. opensync should never ever crash. - i guess its better if we return an error of the vformat parser cannot parse the input than trying to return an invalid parsed object... - add support for encodings besides utf8. this is a big item on my todo list. internally opensync handles everything as utf8. but then we need a parameter which specifies which encoding the input/output is. Armin > Regards >=20 > remyA >=20 > PS: trying to provide a diff later this night. >=20 > trace 1: > -------- > [1136825381.689302] > Input vcal is: > BEGIN:VCALENDAR > PRODID:-//Ximian//NONSGML Evolution Calendar//EN > VERSION:2.0 > METHOD:PUBLISH > BEGIN:VEVENT > ATTENDEE;CN=3DR=C3=A9my Amouroux;ROLE=3DREQ-PARTICIPANT;RSVP=3DTRUE; > PARTSTAT=3DACCEPTED:MAILTO:re...@am... > ORGANIZER:MAILTO:va...@am... > DTSTART:20050726T053000Z > DTEND:20050726T053000Z > TRANSP:OPAQUE > SEQUENCE:0 > UID: >=20 > 040000008200E00074C5B7101A82E0080000000070D7AE8F808CC501000000000000000= 010 > 0000008C05F5F3D72E3B4C9A3BC7FBF434B6CD > DTSTAMP:20050719T144024Z > DESCRIPTION:Quand : mardi 26 juillet 2005 07:30-07:30 (GMT+01:00) > Bruxelles\, Copenhague\, Madrid\, Paris.\n\n*~*~*~*~*~*~*~*~*~*\n\nSi > tu > pouvais =C3=83=C2=AAtre l=C3=83 ce serait bien\n > SUMMARY:ATEc verification de la toiture Mr Domenec > PRIORITY:5 > CLASS:PUBLIC > X-MICROSOFT-CDO-REPLYTIME:20050719T153821Z > CREATED:20050719T153821 > LAST-MODIFIED:20050719T153821 > END:VEVENT > END:VCALENDAR >=20 > [1136825381.689552] > Creating xml doc > [1136825381.689615] > parsing attributes > [1136825381.689674] >=20 >>>>>>>> vcal_parse_attributes(0xb6b51108, 0xac99ea8) >=20 > [1136825381.689734] >=20 >>>>>>>> vcal_handle_attribute(0xac94b80, 0xac99ea8, 0xac99cf0:PRODID) >=20 > [1136825381.689793] > Hook is: 0x1 > [1136825381.689851] > <<<<<<< vcal_handle_attribute: Ignored > [1136825381.689910] >=20 >>>>>>>> vcal_handle_attribute(0xac94b80, 0xac99ea8, 0xac99f10:VERSION) >=20 > [1136825381.689969] > Hook is: 0x1 > [1136825381.690027] > <<<<<<< vcal_handle_attribute: Ignored > [1136825381.690086] >=20 >>>>>>>> vcal_handle_attribute(0xac94b80, 0xac99ea8, 0xac9aaa8:METHOD) >=20 > [1136825381.690144] > Hook is: 0xdb9c3c > [1136825381.690200] > Handling method attribute > [1136825381.690264] > <<<<<<< vcal_handle_attribute > [1136825381.690330] >=20 >>>>>>>> vcal_parse_attributes(0xb6b510c8, 0xac9afb8) >=20 > [1136825381.690389] > <<<<<<< vcal_parse_attributes: Done > (log file ended her) >=20 > trace 2 > ------- > [1136826678.223093] > Input vcal is: > BEGIN:VCALENDAR > PRODID:-//Ximian//NONSGML Evolution Calendar//EN > VERSION:2.0 > METHOD:PUBLISH > BEGIN:VEVENT > ATTENDEE;CN=3DR=C3=A9my Amouroux;ROLE=3DREQ-PARTICIPANT;RSVP=3DTRUE; > PARTSTAT=3DACCEPTED:MAILTO:rem...@ke... > ORGANIZER:MAILTO:va...@am... > DTSTART:20050922T060000Z > DTEND:20050922T080000Z > TRANSP:OPAQUE > SEQUENCE:0 > UID: >=20 > 040000008200E00074C5B7101A82E0080000000010E4575FC9AFC501000000000000000= 010 > 000000B6F0CDF8F87227418E1C2A0DBE2BD607 > DTSTAMP:20050902T121947Z > DESCRIPTION:Quand : jeudi 22 septembre 2005 08:00-10:00 (GMT+01:00) > Bruxelles\, Copenhague\, Madrid\, Paris.\n\n*~*~*~*~*~*~*~*~*~*\n\nTMV= > St > Egreve 04/76/75/21/34\n\n\n\n > SUMMARY:Depannage Volet Budendorf > PRIORITY:5 > CLASS:PUBLIC > X-MICROSOFT-CDO-REPLYTIME:20050902T135144Z > CREATED:20050902T135144 > LAST-MODIFIED:20050902T135144 > END:VEVENT > END:VCALENDAR >=20 > [1136826678.223346] > Creating xml doc > [1136826678.223411] > parsing attributes > [1136826678.223469] >=20 >>>>>>>> vcal_parse_attributes(0xb6b36108, 0xb1d915b8) >=20 > [1136826678.223529] >=20 >>>>>>>> vcal_handle_attribute(0xb1d8afb8, 0xb1d915b8, >=20 > 0xb1d92110:PRODID) > [1136826678.223632] > Hook is: 0x1 > [1136826678.223691] > <<<<<<< vcal_handle_attribute: Ignored > [1136826678.223750] >=20 >>>>>>>> vcal_handle_attribute(0xb1d8afb8, 0xb1d915b8, >=20 > 0xb1d92130:VERSION) > [1136826678.223811] > Hook is: 0x1 > [1136826678.223868] > <<<<<<< vcal_handle_attribute: Ignored > [1136826678.223927] >=20 >>>>>>>> vcal_handle_attribute(0xb1d8afb8, 0xb1d915b8, >=20 > 0xb1d91540:METHOD) > [1136826678.223989] > Hook is: 0xe3dc3c > [1136826678.224046] > Handling method attribute > [1136826678.224111] > <<<<<<< vcal_handle_attribute > [1136826678.224176] >=20 >>>>>>>> vcal_parse_attributes(0xb6b360c8, 0xb1d92510) >=20 > [1136826678.224233] > <<<<<<< vcal_parse_attributes: Done >=20 >=20 > trace3: > ------ > Received a entry 20050525T023411Z-5011-100-1-5@remya with data of size = 4 > from member 1. Changetype ADDED >=20 > ** (process:12799): WARNING **: invalid utf8 passed to VFormat. Limpin= g > along. >=20 > ** (process:12799): WARNING **: vcard ended without END:VCARD >=20 >=20 > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread -1229993040 (LWP 12804)] > 0x003fcf3e in vcal_parse_attributes (hooks=3D0xb1624d58, table=3D0xb162= 4ab0, > paramtable=3D0xb1624ab0, attributes=3D0xb6afc108, root=3D0xb162c240) > at xml-vcal.c:676 > 676 for (a =3D *attributes; a; a =3D a->next) { > (gdb) print a > $1 =3D (GList *) 0x0 > (gdb) print attributes > $2 =3D (GList **) 0xb6afc108 > (gdb) print *attributes > $3 =3D (GList *) 0xb16233f8 > (gdb) print *attributes-next > No symbol "next" in current context. > (gdb) print *attributes->next > $4 =3D {data =3D 0xb162b498, next =3D 0xb1623428, prev =3D 0xb16233f8} > (gdb) print *attributes->next->next > $5 =3D {data =3D 0xb162bfa8, next =3D 0xb1623440, prev =3D 0xb1623410} > (gdb) print **attr > Structure has no component named operator*. > (gdb) print *attr > $6 =3D {group =3D 0x0, name =3D 0xb16280b8 "BEGIN", params =3D 0x0, val= ues =3D > 0xb1623434, decoded_values =3D 0xb1623458, encoding =3D VF_ENCODING_RAW= , > encoding_set =3D 0} > (gdb) print *attr->values > $7 =3D {data =3D 0xb162b618, next =3D 0x0, prev =3D 0x0} > (gdb) print *attr->values->data > Attempt to dereference a generic pointer. > (gdb) >=20 |