Bug 2516 - vcalendar crashes claws
Summary: vcalendar crashes claws
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.8.0
Hardware: PC Linux
: P3 critical
Assignee: users
URL:
: 2256 2528 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-09 21:00 UTC by Michael Rasmussen
Modified: 2011-10-23 14:28 UTC (History)
2 users (show)

See Also:


Attachments
Probable fix (814 bytes, patch)
2011-10-10 10:01 UTC, Colin Leroy
no flags Details | Diff

Description Michael Rasmussen 2011-10-09 21:00:09 UTC
Debug from running claws thrue valgrind:

vcal_folder.c:985: fetch for https://xxx:yyy@foo.tld/ 669
==18611== Invalid read of size 8
==18611==    at 0x280A6ACF: icalcomponent_get_first_property (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x28095665: get_item_event_list_for_date (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x2808D04C: vcal_manager_dateevent_dump (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280915DC: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x4E2226: folder_item_fetch_msg (folder.c:2888)
==18611==    by 0x5E882C: procmsg_get_message_file_path (procmsg.c:396)
==18611==    by 0x553A7E: messageview_show (messageview.c:1179)
==18611==    by 0x60C720: summary_display_msg_full (summaryview.c:3485)
==18611==    by 0x60B9C4: summary_display_msg (summaryview.c:3297)
==18611==    by 0x619338: summary_selected (summaryview.c:6871)
==18611==    by 0x6E7179: claws_marshal_VOID__POINTER_INT (claws-marshal.c:348)
==18611==    by 0x882EE7D: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2800.6)
==18611==  Address 0x2a204f58 is 24 bytes inside a block of size 56 free'd
==18611==    at 0x4C268FE: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18611==    by 0x280CB576: icalvalue_text_as_ical_string (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280C1F1C: icalproperty_as_ical_string (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A8240: icalcomponent_as_ical_string (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x2809559A: vcal_get_events_list (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A2303: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A3286: create_day_win (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x28092941: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x6047A3: summary_show (summaryview.c:1144)
==18611==    by 0x4F3172: folderview_selected (folderview.c:2227)
==18611==    by 0x6E7179: claws_marshal_VOID__POINTER_INT (claws-marshal.c:348)
==18611==    by 0x882EE7D: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2800.6)
==18611== 
==18611== Invalid write of size 8
==18611==    at 0x280A6ADD: icalcomponent_get_first_property (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x28095665: get_item_event_list_for_date (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x2808D04C: vcal_manager_dateevent_dump (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280915DC: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x4E2226: folder_item_fetch_msg (folder.c:2888)
==18611==    by 0x5E882C: procmsg_get_message_file_path (procmsg.c:396)
==18611==    by 0x553A7E: messageview_show (messageview.c:1179)
==18611==    by 0x60C720: summary_display_msg_full (summaryview.c:3485)
==18611==    by 0x60B9C4: summary_display_msg (summaryview.c:3297)
==18611==    by 0x619338: summary_selected (summaryview.c:6871)
==18611==    by 0x6E7179: claws_marshal_VOID__POINTER_INT (claws-marshal.c:348)
==18611==    by 0x882EE7D: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2800.6)
==18611==  Address 0x2a204f60 is 32 bytes inside a block of size 56 free'd
==18611==    at 0x4C268FE: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==18611==    by 0x280CB576: icalvalue_text_as_ical_string (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280C1F1C: icalproperty_as_ical_string (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A8240: icalcomponent_as_ical_string (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x2809559A: vcal_get_events_list (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A2303: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A3286: create_day_win (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x28092941: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x6047A3: summary_show (summaryview.c:1144)
==18611==    by 0x4F3172: folderview_selected (folderview.c:2227)
==18611==    by 0x6E7179: claws_marshal_VOID__POINTER_INT (claws-marshal.c:348)
==18611==    by 0x882EE7D: g_closure_invoke (in /usr/lib/libgobject-2.0.so.0.2800.6)
==18611== 
==18611== Invalid read of size 8
==18611==    at 0x280D1555: pvl_head (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A6AD9: icalcomponent_get_first_property (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x28095665: get_item_event_list_for_date (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x2808D04C: vcal_manager_dateevent_dump (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280915DC: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x4E2226: folder_item_fetch_msg (folder.c:2888)
==18611==    by 0x5E882C: procmsg_get_message_file_path (procmsg.c:396)
==18611==    by 0x553A7E: messageview_show (messageview.c:1179)
==18611==    by 0x60C720: summary_display_msg_full (summaryview.c:3485)
==18611==    by 0x60B9C4: summary_display_msg (summaryview.c:3297)
==18611==    by 0x619338: summary_selected (summaryview.c:6871)
==18611==    by 0x6E7179: claws_marshal_VOID__POINTER_INT (claws-marshal.c:348)
==18611==  Address 0x76 is not stack'd, malloc'd or (recently) free'd
==18611== 
==18611== 
==18611== Process terminating with default action of signal 11 (SIGSEGV)
==18611==  Access not within mapped region at address 0x76
==18611==    at 0x280D1555: pvl_head (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280A6AD9: icalcomponent_get_first_property (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x28095665: get_item_event_list_for_date (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x2808D04C: vcal_manager_dateevent_dump (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x280915DC: ??? (in /usr/lib/claws-mail/plugins/vcalendar.so)
==18611==    by 0x4E2226: folder_item_fetch_msg (folder.c:2888)
==18611==    by 0x5E882C: procmsg_get_message_file_path (procmsg.c:396)
==18611==    by 0x553A7E: messageview_show (messageview.c:1179)
==18611==    by 0x60C720: summary_display_msg_full (summaryview.c:3485)
==18611==    by 0x60B9C4: summary_display_msg (summaryview.c:3297)
==18611==    by 0x619338: summary_selected (summaryview.c:6871)
==18611==    by 0x6E7179: claws_marshal_VOID__POINTER_INT (claws-marshal.c:348)
==18611==  If you believe this happened as a result of a stack
==18611==  overflow in your program's main thread (unlikely but
==18611==  possible), you can try to increase the size of the
==18611==  main thread stack using the --main-stacksize= flag.
==18611==  The main thread stack size used in this run was 8388608.
==18611== 
==18611== HEAP SUMMARY:
==18611==     in use at exit: 48,601,129 bytes in 393,660 blocks
==18611==   total heap usage: 2,755,695 allocs, 2,362,035 frees, 2,281,090,832 bytes allocated
==18611== 
==18611== LEAK SUMMARY:
==18611==    definitely lost: 100,083 bytes in 1,285 blocks
==18611==    indirectly lost: 3,804,375 bytes in 60,019 blocks
==18611==      possibly lost: 6,413,507 bytes in 69,640 blocks
==18611==    still reachable: 38,283,164 bytes in 262,716 blocks
==18611==         suppressed: 0 bytes in 0 blocks
==18611== Rerun with --leak-check=full to see details of leaked memory
==18611== 
==18611== For counts of detected and suppressed errors, rerun with: -v
==18611== Use --track-origins=yes to see where uninitialised values come from
==18611== ERROR SUMMARY: 15259 errors from 77 contexts (suppressed: 200 from 10)
Killed
Comment 1 Colin Leroy 2011-10-10 10:01:07 UTC
Created attachment 1025 [details]
Probable fix

Does this patch fix it?
Comment 2 Michael Rasmussen 2011-10-10 18:25:56 UTC
> 
> Does this patch fix it?
>   
Yes, that did the trick:-)
Apparently it also seems to have increased performance slightly.

A quick question: Every time the calendar gets focus the entire calendar is fetched even though nothing has changed. For each calendar vcalendar creates a cache of fetched events but does not seem to use this cache. My question is, is this a feature, limitation, or (un)known bug?
Comment 3 Colin Leroy 2011-10-23 14:28:00 UTC
Patch is in CVS:
2011-10-11 [colin]      2.0.11cvs2

        * src/vcal_folder.c
                Fix bug #2516, "vcalendar crashes claws". Double-free
                in subscribed calendars
Comment 4 Colin Leroy 2011-10-23 14:28:33 UTC
*** Bug 2256 has been marked as a duplicate of this bug. ***
Comment 5 Colin Leroy 2011-10-23 14:28:54 UTC
*** Bug 2528 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.