Closed Bug 751544 Opened 12 years ago Closed 12 years ago

Random orange: TEST-UNEXPECTED-FAIL | test_imapPump.js | PROCESS-CRASH (Using observer service off the main thread)

Categories

(MailNews Core :: Networking: IMAP, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 16.0

People

(Reporter: standard8, Assigned: hiro)

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

With the new try server, we're getting debug unit test builders up and running. I've just seen this failure on one of them:

https://tbpl.mozilla.org/php/getParsedLog.php?id=11425019&tree=Thunderbird-Try

TEST-INFO | (xpcshell/head.js) | exiting test
WARNING: An event was posted to a thread that will never run it (rejected): file ../../../../mozilla/xpcom/threads/nsThread.cpp, line 392
WARNING: unable to post continuation event: file ../../../../mozilla/xpcom/io/nsStreamUtils.cpp, line 471

TEST-PASS | (xpcshell/head.js) | 2 (+ 0) check(s) passed

TEST-INFO | (xpcshell/head.js) | 0 check(s) todo
WARNING: nsExceptionService ignoring thread destruction after shutdown: file ../../../../mozilla/xpcom/base/nsExceptionService.cpp, line 199
WARNING: NS_ENSURE_TRUE(thread) failed: file ../../../../../mozilla/netwerk/base/src/nsSocketTransportService2.cpp, line 148
###!!! ASSERTION: Using observer service off the main thread!: 'Error', file ../../../../mozilla/xpcom/ds/nsObserverService.cpp, line 143

PROCESS-CRASH | /home/cltbld/talos-slave/test/build/xpcshell/tests/mailnews/base/test/unit/test_imapPump.js | application crashed (minidump found)

Stack:

0  libmozalloc.so!TouchBadMemory [mozalloc_abort.cpp : 68 + 0x4]
    rbx = 0x025a2d78   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x983c54ec   rsp = 0x6b5fd110   rbp = 0x6b5fd110
    Found by: given as instruction pointer in context
 1  libmozalloc.so!mozalloc_abort [mozalloc_abort.cpp : 89 + 0x4]
    rbx = 0x025a2d78   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x983c5540   rsp = 0x6b5fd120   rbp = 0x6b5fd130
    Found by: call frame info
 2  libxul.so!Abort [nsDebugImpl.cpp : 417 + 0xb]
    rbx = 0x025a2d78   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x95943adc   rsp = 0x6b5fd140   rbp = 0x6b5fd150
    Found by: call frame info
 3  libxul.so!NS_DebugBreak_P [nsDebugImpl.cpp : 404 + 0xe]
    rbx = 0x025a2d78   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x95943aaa   rsp = 0x6b5fd160   rbp = 0x6b5fd5a0
    Found by: call frame info
 4  libxul.so!nsObserverService::RemoveObserver [nsObserverService.cpp : 143 + 0x30]
    rbx = 0x025a2d78   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x958eaed3   rsp = 0x6b5fd5b0   rbp = 0x6b5fd5f0
    Found by: call frame info
 5  libxul.so!nsPrefBranch::~nsPrefBranch [nsPrefBranch.cpp : 119 + 0x2c]
    rbx = 0x025a2d78   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x93da1162   rsp = 0x6b5fd600   rbp = 0x6b5fd640
    Found by: call frame info
 6  libxul.so!nsPrefBranch::~nsPrefBranch [nsPrefBranch.cpp : 120 + 0xb]
    rbx = 0x0271a020   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x93da11de   rsp = 0x6b5fd650   rbp = 0x6b5fd670
    Found by: call frame info
 7  libxul.so!nsPrefBranch::Release [nsPrefBranch.cpp : 128 + 0xa3]
    rbx = 0x0271a020   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x93da133a   rsp = 0x6b5fd680   rbp = 0x6b5fd6a0
    Found by: call frame info
 8  libxul.so!nsCOMPtr<nsIPrefBranch>::~nsCOMPtr [try-comm-central::e90c6392f4ac : 521 + 0x1c]
    rbx = 0x0271a020   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x93b797c0   rsp = 0x6b5fd6b0   rbp = 0x6b5fd6c0
    Found by: call frame info
 9  libxul.so!nsMsgIncomingServer::~nsMsgIncomingServer [nsMsgIncomingServer.cpp : 96 + 0x72]
    rbx = 0x0271a020   r12 = 0x9552380e   r13 = 0x00000000   r14 = 0x80004005
    r15 = 0x00000003   rip = 0x9524680d   rsp = 0x6b5fd6d0   rbp = 0x6b5fd6f0

So the incoming server is being released late or something?
Whiteboard: [tb-orange]
Whiteboard: [tb-orange] → [orange]
no, this usually means we're still talking to the imap server while shutdown is happening. I'll look at the test in a bit.
I guess FetchMsgPreviewText is invoked when updateFolderWithListener is called on Linux.

http://mxr.mozilla.org/comm-central/source/mailnews/base/src/nsMessengerUnixIntegration.cpp#253

252   bool asyncResult = false;
253   nsresult rv = folder->FetchMsgPreviewText(&messageKey, 1,
254                                             localOnly, this,
255                                             &asyncResult);

So I suppose this is the culprit who is talking to the imap server while shutting down.

Also I suppose the fix for bug 766467 fixes this issue.
Assignee: nobody → hiikezoe
Status: NEW → ASSIGNED
Attachment #634767 - Flags: review?(dbienvenu)
While the build isn't failing this test on other platforms right now, I routinely see the "Observer service used off main thread" exception on Mac OS X when shutting down TB debug builds. I haven't bothered to track it separately from my general "shutdown exceptions" bug, https://bugzilla.mozilla.org/show_bug.cgi?id=738778.

The fix you propose here looks good for the failing test, but I suspect we also need to fix some other things to completely solve the problem.
(In reply to Irving Reid (:irving) from comment #33)
> While the build isn't failing this test on other platforms right now, I
> routinely see the "Observer service used off main thread" exception on Mac
> OS X when shutting down TB debug builds. I haven't bothered to track it
> separately from my general "shutdown exceptions" bug,
> https://bugzilla.mozilla.org/show_bug.cgi?id=738778.
> 
> The fix you propose here looks good for the failing test, but I suspect we
> also need to fix some other things to completely solve the problem.

Right. I've also seen a similar issue on shutting down. see bug 765958 c1.
Comment on attachment 634767 [details] [diff] [review]
Set dummy msgwindow instead of null

thx, Hiro.
Attachment #634767 - Flags: review?(dbienvenu) → review+
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/b64833f40f05
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 16.0
Comment #38 is from prior to this landing.
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: