Open Bug 471764 Opened 17 years ago Updated 2 years ago

Runtime error when canceling (old?) account wizard: assertion "tried to add duplicate listener"

Categories

(Thunderbird :: Account Manager, defect)

x86
Windows XP
defect

Tracking

(Not tracked)

People

(Reporter: timeless, Unassigned)

Details

Attachments

(1 file)

xpcom_core!NS_DebugBreak_P(unsigned int aSeverity = 1, char * aStr = 0x02b10274 "tried to add duplicate listener", char * aExpr = 0x02b10268 "index == -1", char * aFile = 0x02b10220 "c:/home/mozilla.org/comm-central/mailnews/base/src/nsMsgMailSession.cpp", int aLine = 96)+0x2a4 msgbase!nsMsgMailSession::AddFolderListener(class nsIFolderListener * aListener = 0x05489e50, unsigned int aNotifyFlags = 2)+0x63 msgbase!nsMessenger::SetWindow(class nsIDOMWindowInternal * aWin = 0x04332338, class nsIMsgWindow * aMsgWindow = 0x05291090)+0x1a0 0 [native frame] 1 LoadPostAccountWizard(false) ["chrome://messenger/content/msgMail3PaneWindow.js":706] toolbarset = undefined toolbox = undefined showDefaultClientDialog = [function] feedHandler = undefined this = [object ChromeWindow @ 0x4338878 (native @ 0x5488960)] 2 onCancel() ["chrome://messenger/content/AccountWizard.js":192] state = false result = undefined confirmTitle = undefined confirmMsg = undefined pageData = undefined this = [object ChromeWindow @ 0x4338878 (native @ 0x5488960)] 3 anonymous(event = [object Event @ 0x65cee58 (native @ 0x65ceda8)]) ["chrome://global/content/bindings/wizard.xml":405] this = [object XULElement @ 0x5581b00 (native @ 0x5516598)] 4 _fireEvent([object XULElement @ 0x5581b00 (native @ 0x5516598)], "wizardcancel") ["chrome://global/content/bindings/wizard.xml":406] returned = undefined fn = [function] handler = "return onCancel();" noCancel = true event = [object Event @ 0x65cee58 (native @ 0x65ceda8)] this = [object XULElement @ 0x5581b00 (native @ 0x5516598)] 5 cancel() ["chrome://global/content/bindings/wizard.xml":298] this = [object XULElement @ 0x5581b00 (native @ 0x5516598)] 6 anonymous([object XULCommandEvent @ 0x65cebd8 (native @ 0x4ef015c)]) ["chrome://global/content/bindings/wizard.xml":149] this = [object XULElement @ 0x562ead8 (native @ 0x562bab8)] i'm running thunderbird, and i got the wizard. i tried to click cancel a couple of times....
timeless, can you describe your problem a bit more verbosely and less technically? Ideally, could you add STR, Actual result and expected result?
Flags: needinfo?(timeless)
Thomas: http://mxr.mozilla.org/comm-central/source/mailnews/base/src/nsMsgMailSession.cpp#61 68 NS_ASSERTION(index == -1, "tried to add duplicate listener"); The code expects that no code will call nsMsgMailSession::AddFolderListener with the same listener twice. At the time I filed this bug, there was apparently code which violated that assertion.
Flags: needinfo?(timeless)
Summary: "tried to add duplicate listener" → Runtime error when canceling (old?) account wizard: assertion "tried to add duplicate listener"
Severity: normal → S3

I am not sure if this is the right bug, but
I have seen the following error during local xpcshell test.
Under Debian GNU/Linux, M-C/C-C full debug TB.
From the output of
egrep "(TEST_START|TEST_END|tried to add duplicate listener)" log1501-xpcshell-test-0.txt &

00:55.60 TEST_START: xpcshell-cpp.ini:comm/mailnews/imap/test/unit/test_largeOfflineStore.js
00:55.95 pid:505526 \x07[Parent 505526, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:57
01:19.16 pid:505526 Hit MOZ_CRASH([Parent 505526, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:57) at /NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:513
01:19.17 TEST_END: Test FAIL. Subtests passed 0/1. Unexpected 1

The bug seems to be timing-dependent.

I only see them in xpcshell test.
And not awlays.

Also, the tests where the assertion is hit differ from run to run.

However, given that both of the following tests produced the
assertions a few times suggests the following tests may be a good
candiate to investigate the bug on your PC.

comm/mailnews/imap/test/unit/test_imapUrls.js
comm/mailnews/imap/test/unit/test_offlineStoreLocking.js

The following shows which test produced the assertion during xpcshell
test.
You have to pass --sequential and --verbose flag to xpcshell test.

00:55.10 TEST_START: xpcshell-cpp.ini:comm/mailnews/imap/test/unit/test_imapUrls.js
00:55.60 TEST_END: Test PASS. Subtests passed 1/1. Unexpected 0
00:55.60 TEST_START: xpcshell-cpp.ini:comm/mailnews/imap/test/unit/test_largeOfflineStore.js
00:55.95 pid:505526 \x07[Parent 505526, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:57
01:19.16 pid:505526 Hit MOZ_CRASH([Parent 505526, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:57) at /NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:513
01:19.17 TEST_END: Test FAIL. Subtests passed 0/1. Unexpected 1


 0:40.32 TEST_START: xpcshell.ini:comm/mailnews/imap/test/unit/test_imapUrls.js
 0:40.58 pid:399580 [Parent 399580, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58
 0:47.65 pid:399580 Hit MOZ_CRASH([Parent 399580, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58) at /NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:517
 0:47.66 TEST_END: Test FAIL, expected PASS. Subtests passed 1/1. Unexpected 0 - xpcshell return code: -11


 1:07.11 TEST_START: comm/mailnews/imap/test/unit/test_offlineStoreLocking.js
 1:08.03 pid:103033 [Parent 103033, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58
 1:17.35 pid:103033 [Parent 103033, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58
 1:17.39 TEST_END: Test FAIL, expected PASS. Subtests passed 1/2. Unexpected 1


 1:20.73 TEST_START: xpcshell.ini:comm/mailnews/imap/test/unit/test_imapUrls.js
 1:21.12 pid:742939 [Parent 742939, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58
 1:21.13 pid:742939 Hit MOZ_CRASH([Parent 742939, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58) at /NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:450
 1:21.15 TEST_END: Test FAIL, expected PASS. Subtests passed 1/1. Unexpected 0 - xpcshell return code: -11

 1:05.73 TEST_START: comm/mailnews/imap/test/unit/test_offlineStoreLocking.js
 1:06.57 pid:374702 [Parent 374702, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58
 1:16.55 pid:374702 Hit MOZ_CRASH([Parent 374702, Main Thread] ###!!! ASSERTION: tried to add duplicate listener: 'index == size_t(-1)', file /NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/src/nsMsgMailSession.cpp:58) at /NEW-SSD/NREF-COMM-CENTRAL/mozilla/xpcom/base/nsDebugImpl.cpp:450

I am attaching the full log for the following test that caused the
assertion in last 24 hours during xpcshell test.

Here is the log of local xpcshell test
comm/mailnews/imap/test/unit/test_largeOfflineStore.js

The assertion triggers strack trace to be printed.

There are similar bugzillas here.
bug 471764 this one.
bug 738215
bug 436366

I am not sure if all these bugs are related.

(In reply to ISHIKAWA, Chiaki from comment #5)

There are similar bugzillas here.
bug 471764 this one.
bug 738215
bug 436366

I am not sure if all these bugs are related.

Related, or duplicates?

Flags: needinfo?(mkmelin+mozilla)

Not sure it's possible to tell before fixing one of them.

Flags: needinfo?(mkmelin+mozilla)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: