Closed Bug 296141 Opened 20 years ago Closed 19 years ago

FILTERS: If a destination folder doesn't exist, thunderbird crashes [@ nsMsgFilterService::SaveFilterList]

Categories

(MailNews Core :: Filters, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 322283

People

(Reporter: superbiskit, Unassigned)

Details

(Keywords: crash)

Crash Data

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+
Build Identifier: Thunderbird Nightly 2005-28-06-trunk/thunderbird-i686-linux-gtk2+xft

Applying existing filters to a folder (the Inbox): works if target folder exists,
if target does not exist I get the usual warning dialog about "the filter will
be disabled"; however thunderbird immediately crashes or it crashes when I click OK.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.



TB6284746H
TB6282367Z
TB6280794W, all dated 2005-05-31
Incident ID: 6282367
Stack Signature	nsMsgFilterService::SaveFilterList() 763e9ccd
Product ID	ThunderbirdTrunk
Build ID	2005052806
Trigger Time	2005-05-31 15:09:43.0
Platform	LinuxIntel
Operating System	Linux 2.4.29-f3
Module	thunderbird-bin + (0077b317)
URL visited	mail
User Comments	Disable filter by running RunNow when folder not-exist, SECOND TIME
Since Last Crash	0 sec
Total Uptime	1 sec
Trigger Reason	SIGSEGV: Segmentation Fault: (signal 11)
Source File, Line No.
/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp,
line 1453
Stack Trace 	
nsMsgFilterService::SaveFilterList() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp,
line 1453]
nsMsgFilterList::SaveToDefaultFile() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mailnews/base/search/src/nsMsgFilterList.cpp,
line 848]
nsMsgFilterAfterTheFact::ApplyFilter() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mailnews/base/search/src/nsMsgFilterService.cpp,
line 583]
nsMsgSearchSession::NotifyListenersDone() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp,
line 262]
nsMsgSearchSession::TimerCallback() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp,
line 528]
nsTimerImpl::Fire() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/xpcom/threads/nsTimerImpl.cpp,
line 395]
handleTimerEvent() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/xpcom/threads/nsTimerImpl.cpp,
line 462]
PL_HandleEvent() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/xpcom/threads/plevent.c,
line 698]
PL_ProcessPendingEvents() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/xpcom/threads/plevent.c,
line 633]
nsEventQueueImpl::ProcessPendingEvents() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/xpcom/threads/nsEventQueue.cpp,
line 421]
event_processor_callback() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/widget/src/gtk2/nsAppShell.cpp,
line 71]
libglib-2.0.so.0 + 0x49dbf (0x4054bdbf)
libglib-2.0.so.0 + 0x24582 (0x40526582)
libglib-2.0.so.0 + 0x255f8 (0x405275f8)
libglib-2.0.so.0 + 0x25930 (0x40527930)
libglib-2.0.so.0 + 0x25ed3 (0x40527ed3)
libgtk-x11-2.0.so.0 + 0x11fbb3 (0x40208bb3)
nsAppShell::Run() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/widget/src/gtk2/nsAppShell.cpp,
line 141]
nsAppStartup::Run() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/toolkit/components/startup/src/nsAppStartup.cpp,
line 145]
XRE_main() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/toolkit/xre/nsAppRunner.cpp,
line 830]
main() 
[/builds/tinderbox/thunderbird-trunk/Linux_2.4.18-14_Depend/mozilla/mail/app/nsMailApp.cpp,
line 63]
libc.so.6 + 0x15e36 (0x40a56e36)
Assignee: mscott → nobody
Severity: major → critical
Component: General → MailNews: Filters
Keywords: crash
Product: Thunderbird → Core
Summary: FILTERS: If a destination folder doesn't exist, thunderbird crashes → FILTERS: If a destination folder doesn't exist, thunderbird crashes [@ nsMsgFilterService::SaveFilterList]
Version: unspecified → Trunk
This could be reproduced by enabling the filter which was disabled when target
folder was deleted. When the filter was applied again, thunderbird disabled it
and tried to save the filter list to default file (see code below). 

In /mailnews/base/search/src/nsMsgFilterService.cpp,

nsresult nsMsgFilterAfterTheFact::ApplyFilter()
{
...
  if (!parentFolder || !canFileMessages)
  {
    m_curFilter->SetEnabled(PR_FALSE);
    destIFolder->ThrowAlertMsg("filterDisabled",m_msgWindow);
    // we need to explicitly save the filter file.
    m_filters->SaveToDefaultFile();
...
}

The crash occurred because there is no default file assigned for filter list in
the case of issue. If you take a look at MsgApplyFilters() in 
/mail/base/content/mailWindowOverlay.js, you will see that default file is not
assigned for tempFilterList before calling applyFiltersToFolders(). The same
explanation applies to runSelectedFilters() in 
/mail/base/content/FilterListDialog.js.

http://lxr.mozilla.org/seamonkey/source/mail/base/content/mailWindowOverlay.js#1460
http://lxr.mozilla.org/seamonkey/source/mail/base/content/FilterListDialog.js#421

So, this issue could be fixed by assigning default file from current filterlist
to temp filter list.
Comment on attachment 184985 [details] [diff] [review]
a patch to assign default file to temporary filter list

seeking r?
Attachment #184985 - Flags: review?(bienvenu)
Confirming; I see this with build 2005-05-31 on Windows XP Seamonkey trunk, as well.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
Actaully, there is one defect that above patch does not cover. If the
problematic filter is ran from filter dialog, the filter will be disabled and
the filter list will be saved correctly by the patch. However, UI (checkbox in
the filter list) does not reflect changed status after warning message. I hope
someone could fix this.
the c++ code is bad, it needs to tolerate nulls for all pointer params of
interface methods.
OS: All → Linux
Hardware: All → PC
OS: Linux → All
Hardware: PC → All
Depends on: 322283
Comment on attachment 184985 [details] [diff] [review]
a patch to assign default file to temporary filter list

I don't think we want this filter list to have a file - if we write it out, we could crunch the real file. I think we need to handle a null filter list downstream, or not write out a temporary filter list at all.
Attachment #184985 - Flags: review?(bienvenu) → review-
I'm marking this a dup of bug 322283, which is where I put the fix...

*** This bug has been marked as a duplicate of 322283 ***
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
No longer depends on: 322283
Product: Core → MailNews Core
Crash Signature: [@ nsMsgFilterService::SaveFilterList]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: