Closed Bug 328636 Opened 18 years ago Closed 18 years ago

Editing event with reminder (15 or 30 min.) crashes Thunderbird (branch)

Categories

(Calendar :: Lightning Only, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: ssitter, Unassigned)

Details

(Keywords: crash)

Attachments

(1 file)

Editing all day event with reminder crashes Thunderbird (branch)

Steps to Reproduce:
1) Create all day event and set reminder to 15 minutes before. Press OK.
2) Edit this event again. Press More>> button to show alarm fields.

Actual Results:   
Thunderbird crashes, Talkback: TB15641028M TB15640773W

Expected Results: 
Show the extended Edit event dialog

Additional Information:

Crash with Tb 1.5 (20051201) + Ltn (2006-02-25-mozilla1.8) on Windows.
Crash with Tb 1.5 (20060225) + Ltn (2006-02-25-mozilla1.8) on Linux.

No crash with Sunbird (20060225) on Windows.
No crash with Tb 1.6a1 (20060225) + Ltn (2006-02-25-trunk) on Windows.
No crash with Tb 1.6a1 (20060225) + Ltn (2006-02-25-trunk) on Linux.

Console output from before the crash showing the created event:

    -----------------------------------------------------------
    Guessing system timezone:
    TZoffset1: +0200
    TZoffset2: +0100
    gDefaultTimezone: /mozilla.org/20050126_1/Africa/Ceuta
    ERROR! Event has invalid privacy string: null
    BEGIN:VCALENDAR
    PRODID:-//Mozilla Calendar//NONSGML Sunbird//EN
    VERSION:2.0
    BEGIN:VEVENT
    CREATED:20060226T114318Z
    LAST-MODIFIED:20060226T114348Z
    DTSTAMP:20060226T114348Z
    SUMMARY:All day event with reminder
    PRIORITY:0
    CLASS:PUBLIC
    DTSTART;VALUE=DATE;TZID=/mozilla.org/20050126_1/Africa/Ceuta:20060301
    DTEND;VALUE=DATE;TZID=/mozilla.org/20050126_1/Africa/Ceuta:20060302
    PERCENT-COMPLETE:0
    BEGIN:VALARM
    TRIGGER;VALUE=DURATION:-PT15M
    DESCRIPTION:Mozilla Alarm: All day event with reminder
    ACTION:DISPLAY
    END:VALARM
    END:VEVENT
    BEGIN:VTIMEZONE
    TZID:/mozilla.org/20050126_1/Africa/Ceuta
    X-LIC-LOCATION:Africa/Ceuta
    BEGIN:DAYLIGHT
    TZOFFSETFROM:+0100
    TZOFFSETTO:+0200
    TZNAME:CEST
    DTSTART:19700329T020000
    RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
    END:DAYLIGHT
    BEGIN:STANDARD
    TZOFFSETFROM:+0200
    TZOFFSETTO:+0100
    TZNAME:CET
    DTSTART:19701025T030000
    RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
    END:STANDARD
    END:VTIMEZONE
    END:VCALENDAR

    considering alarm for item:All day event with reminder
     offset:-PT15M, which makes alarm time:2006/03/01 00:00:00 UTC
    now is 2006/02/26 11:43:48 UTC
    alarm is in the future
    alarm is too late
    -----------------------------------------------------------
Works with Thunderbird 1.5 (20051201) + Lightning (2006-02-23-07-mozilla1.8).
Fails with Thunderbird 1.5 (20051201) + Lightning (2006-02-24-07-mozilla1.8).

The new calendar code landed for the 2006-02-24 nightly builds. But the calendar code is the same on branch and trunk. I think that something in this code triggers another bug that is fixed in trunk but not in 1.8 branch.

With try and error I found that the crash is caused in loadDetails() --> updateAlarm() --> setAlarmFields() http://lxr.mozilla.org/seamonkey/source/calendar/base/content/calendar-event-dialog.js#564

Some dumps to show the values:

===> updateAlarm() called
     alarmMenu=[object XULElement]
     alarmItem=[object XULElement]
     alarmItemValue=
     switch: default entered
     customItem=[object XULElement]
     call setAlarmFields(alarmItem)
     ===> setAlarmFields() called
          alarmItem=[object XULElement]
          alarmLength=15
          alarmUnits=minutes
          alarmRelation=START

If I comment out the line http://lxr.mozilla.org/seamonkey/source/calendar/base/content/calendar-event-dialog.js#570
    
    setElementValue("alarm-length-field", alarmLength);

no crash occurs.
Crash happens also for non all day events if you create them using one of the predefined alarm values (15 minutes before, 30 minutes before) or a comparable custom alarm with 15 resp. 30 minutes before event start. 

No crash if you use a custom alarm with 14 resp. 16 minutes before event start.
Summary: Editing all day event with reminder crashes Thunderbird (branch) → Editing event with reminder (15 or 30 min.) crashes Thunderbird (branch)
Attached patch change command order — — Splinter Review
I don't know why but changing the command order makes the crash go away for me.
Attachment #213250 - Flags: first-review?(jminta)
Comment on attachment 213250 [details] [diff] [review]
change command order

This bug seems to be caused by some type of race condition.  It seems that the disclosure button, setting hidden on the alarm-details box, and the setting of value on the textbox are all integral parts.  Sticking alert()s in between those can avoid the crash.  Accordingly, this does seem like the right solution, keeping the textbox unhidden until the value can be set ought to break the link.

r=jminta Thanks for the patch!
Attachment #213250 - Flags: first-review?(jminta) → first-review+
Patch checked in.  Let's hope this bug dies.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: