<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>103761</bug_id>
          
          <creation_ts>2005-04-13 00:15:08 +0000</creation_ts>
          <short_desc>korganizer 3.4 crashes when loading 3.3 calendar files that contain recurring todos</short_desc>
          <delta_ts>2006-11-02 19:28:40 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>korganizer</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Debian testing</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>crash</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ari Steinberg">ari.steinberg</reporter>
          <assigned_to name="Reinhold Kainhofer">reinhold</assigned_to>
          <cc>orion</cc>
    
    <cc>rdieter</cc>
    
    <cc>tim</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>25</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>333967</commentid>
    <comment_count>0</comment_count>
    <who name="Ari Steinberg">ari.steinberg</who>
    <bug_when>2005-04-13 00:15:08 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.4.0)
Installed from:    Debian testing/unstable Packages
OS:                Linux

I am using the new Debian 3.4 packages from Alioth, which are for KDE 3.4.

When I upgraded, I found that korganizer would not run...cpu utilization jumps to 100% and the program does not start up (it hangs).  Similarly, kontact would also sometimes hang, I think when it attempted to start korganizer.

I moved away my old .kde/share/apps/korganizer/ directory and found it started normally.  I then tried loading the old .ics file from that directory and found it crashed when trying to import/load.  Finally, I manually editted the .ics file and tried removing events/todos from the file until it started to work again.  I was eventually able to figure out that this TODO is the one that caused it to crash:

BEGIN:VTODO
DTSTAMP:20050410T204441Z
ORGANIZER:MAILTO:ari.steinberg@stanford.edu
COMMENT:NoStartDate
CREATED:20041003T232125Z
UID:KOrganizer-476329157.708
SEQUENCE:17
LAST-MODIFIED:20041202T024301Z
SUMMARY:CS205 Problem Set
CLASS:PUBLIC
PRIORITY:3
RRULE:FREQ=WEEKLY;UNTIL=20041205;INTERVAL=1;BYDAY=WE
DUE:20041020T211500Z
DTSTART:20041006T211500Z
COMPLETED:20041202T024301Z
PERCENT-COMPLETE:100
RECURRENCE-ID:20041201T221500Z
END:VTODO

I think this should be treated with very high priority since it effectively prevented me from using Kontact/KOrganizer after upgrading to KDE 3.4, and nearly caused me to resort to deleting my entire organizer files.  Let me know if you need any additional information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>339080</commentid>
    <comment_count>1</comment_count>
    <who name="Bram Schoenmakers">me</who>
    <bug_when>2005-05-02 13:17:52 +0000</bug_when>
    <thetext>This todo causes exactly the same problem for me:

BEGIN:VTODO
DTSTAMP:20050502T104500Z
ORGANIZER:MAILTO:bram_s@hccnet.nl
COMMENT:NoStartDate
CREATED:20041020T181700Z
UID:libkcal-1171727850.887
SEQUENCE:5
LAST-MODIFIED:20041029T105900Z
DESCRIPTION:kdelibs\nkdebase\nkdepim\nkoffice
SUMMARY:CVS-checkout doen
CLASS:PUBLIC
PRIORITY:3
CATEGORIES:KDE
RRULE:FREQ=WEEKLY;UNTIL=20041029;INTERVAL=1;BYDAY=TU,TH,FR
DUE;VALUE=DATE:20041021
DTSTART;VALUE=DATE:29350930228
COMPLETED:20041029T105900Z
PERCENT-COMPLETE:100
RECURRENCE-ID:20041028T220000Z
END:VTODO

Guess there&apos;s something wrong with calculating the recurrence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>354823</commentid>
    <comment_count>2</comment_count>
    <who name="Vicky Shrestha">mail</who>
    <bug_when>2005-07-02 07:39:29 +0000</bug_when>
    <thetext>Thanks for the pointer. 

Rather than reoccuring todos it&apos;s the reoccuring todos that have an ending date set. The normal Reoccuring todos loads fine. 

After I manually removed the reoccuring todos with ending date set, korganizer started up just fine. I am using kde 3.4.1 in gentoo Linux</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>391840</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Wunder">tim</who>
    <bug_when>2005-11-21 04:46:03 +0000</bug_when>
    <thetext>This RRULE on a VTODO in my .ics file also causes korganizer to crash or hang:
RRULE
 :FREQ=DAILY;UNTIL=20050701;INTERVAL=1

Remove the &quot;UNTIL=20050701;&quot; and korganizer opens the file containing the VTODO fine. So yes, it seems it&apos;s not recurrence that&apos;s the problem, but a recurrence with an ending date. </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>443779</commentid>
    <comment_count>4</comment_count>
    <who name="Orion Poplawski">orion</who>
    <bug_when>2006-06-02 19:06:18 +0000</bug_when>
    <thetext>Well, not every instance of a recurring todo with an end date appear to cause the problem.  Other recurring todo&apos;s with end dates appear to be okay.

This is still present in 3.5.2.

Tried to track down, but getting lost.  Looks like getNextDate() is returning a date of 0, in the inner loop below, so it loops infinitely.

bool Todo::recurTodo()
{
  if ( doesRecur() ) {
    Recurrence *r = recurrence();
    QDateTime endDateTime = r-&gt;endDateTime();
    QDateTime nextDate = r-&gt;getNextDateTime( dtDue() );

    if ( ( r-&gt;duration() == -1 || ( nextDate.isValid() &amp;&amp; endDateTime.isValid()
           &amp;&amp; nextDate &lt;= endDateTime ) ) ) {
      setDtDue( nextDate );
      while ( !recursAt( dtDue() ) || dtDue() &lt;= QDateTime::currentDateTime() ) {
        setDtDue( r-&gt;getNextDateTime( dtDue() ) );
      }

      setCompleted( false );
      setRevision( revision() + 1 );

      return true;
    }
  }

  return false;
}
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>480887</commentid>
    <comment_count>5</comment_count>
    <who name="Bram Schoenmakers">me</who>
    <bug_when>2006-10-29 01:40:40 +0000</bug_when>
    <thetext>SVN commit 599882 by bram:

Prevent infinite loops with some cases of recurring todos.

BUG:103761
BUG:129474



 M  +9 -3      todo.cpp  


--- branches/KDE/3.5/kdepim/libkcal/todo.cpp #599881:599882
@@ -275,11 +275,17 @@
 
     if ( ( r-&gt;duration() == -1 || ( nextDate.isValid() &amp;&amp; endDateTime.isValid()
            &amp;&amp; nextDate &lt;= endDateTime ) ) ) {
-      setDtDue( nextDate );
-      while ( !recursAt( dtDue() ) || dtDue() &lt;= QDateTime::currentDateTime() ) {
-        setDtDue( r-&gt;getNextDateTime( dtDue() ) );
+
+      while ( !recursAt( nextDate ) || nextDate &lt;= QDateTime::currentDateTime() ) {
+
+        if ( !nextDate.isValid() || nextDate &gt; endDateTime ) {
+          return false;
+        }
+
+        nextDate = r-&gt;getNextDateTime( nextDate );
       }
 
+      setDtDue( nextDate );
       setCompleted( false );
       setRevision( revision() + 1 );
 
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>