Closed
Bug 870864
Opened 12 years ago
Closed 8 years ago
nsImapProtocol uses wrapped JS objects off the main thread
Categories
(MailNews Core :: Networking: IMAP, defect)
MailNews Core
Networking: IMAP
Tracking
(seamonkey2.21?, thunderbird_esr2426+)
RESOLVED
FIXED
Thunderbird 51.0
People
(Reporter: jdm, Assigned: rkent)
References
Details
Attachments
(4 files, 2 obsolete files)
9.91 KB,
patch
|
Details | Diff | Splinter Review | |
10.55 KB,
patch
|
standard8
:
review-
|
Details | Diff | Splinter Review |
2.53 KB,
patch
|
neil
:
review+
|
Details | Diff | Splinter Review |
16.01 KB,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
Comment 1•12 years ago
|
||
This stuff needs to use nsMainThreadPtrHolder. See the dependent bugs of bug 773610 for examples.
Reporter | ||
Comment 2•12 years ago
|
||
It's possible that the problem is the nsIMsgWindow nsCOMPtr in TryToLogon, since I see various tests implementing JS versions of that.
Reporter | ||
Updated•12 years ago
|
Summary: ImapProtocol uses wrapped JS objects off the main thread → nsImapProtocol uses wrapped JS objects off the main thread
Comment 3•12 years ago
|
||
There were mozmill crashes on c-c too. Don't know if they had the same root cause or not.
Comment 4•12 years ago
|
||
I think all the uses of the msg window are on the main thread, but I'm testing a patch which uses the wrapper right now. Damn IDL...
Reporter | ||
Comment 5•12 years ago
|
||
TryToLogon is used off the main thread and it obtains the nsIMsgWindow interface into an nsCOMPtr which would trigger the abort if it's implemented by a JS object.
Comment 6•12 years ago
|
||
When I said "use", I meant any actual calls beyond implicit AddRef/Release (the *sink calls is also synchronously proxied back to the main thread). Since I pulled from the m-c just after the backout had been applied, I haven't verified that the crash is fixed yet.
Updated•12 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Reporter | ||
Comment 7•12 years ago
|
||
I tried to dig in, but it appeared more complicated than I originally anticipated. Joshua, I'm hoping to reland the original abort in the next couple days, so it would be great if you could tackle this.
Comment 8•12 years ago
|
||
I don't know if this actually stops the assertion failure or not.
Reporter | ||
Comment 9•12 years ago
|
||
Attachment #754606 -
Flags: review?(Pidgeot18)
Reporter | ||
Comment 10•12 years ago
|
||
https://tbpl.mozilla.org/?tree=Thunderbird-Try&rev=101318bf16cf
Reporter | ||
Updated•12 years ago
|
Attachment #754606 -
Flags: review?(Pidgeot18) → review?(mozilla)
Reporter | ||
Updated•12 years ago
|
Assignee: nobody → josh
Comment 11•11 years ago
|
||
IMHO this is the wrong fix; all the IMAP tests should be using real nsMsgWindow objects. The openFolder attribute isn't even readonly!
Comment 12•11 years ago
|
||
(We could fix the alerts test and make nsIMsgWindow builtinclass but that would be harder and probably deserves its own bug.)
Reporter | ||
Comment 13•11 years ago
|
||
Attachment #760943 -
Flags: review?(neil)
Reporter | ||
Comment 14•11 years ago
|
||
Attachment #760949 -
Flags: review?(neil)
Reporter | ||
Updated•11 years ago
|
Attachment #760943 -
Attachment is obsolete: true
Attachment #760943 -
Flags: review?(neil)
Comment 15•11 years ago
|
||
Comment on attachment 760949 [details] [diff] [review] Disable tests until a proper fix is provided. > [test_imapAttachmentSaves.js] >+# Disabled until bug 870864 is resolved >+skip-if = true ... > [test_imapHdrChunking.js] >+# Disabled until bug 870864 is resolved >+skip-if = true I'd spotted these tests misusing nsIMsgWindow but I hadn't realised that there were so many others :-( > [test_offlineStoreLocking.js] >-# Doesn't currently work on Windows, bug 782625 >-skip-if = os == "win" >+# Disabled until bug 870864 is resolved >+skip-if = true Please leave the Windows comment in, just in case someone erroneously tries to enable it on all platforms.
Attachment #760949 -
Flags: review?(neil) → review+
Reporter | ||
Comment 16•11 years ago
|
||
https://hg.mozilla.org/comm-central/rev/564f827c6869
Whiteboard: [leave open]
Comment 17•11 years ago
|
||
Setting as tracking-thunderbird24+. I'm uneasy with the idea of a release with all these tests disabled.
tracking-seamonkey2.21:
--- → ?
tracking-thunderbird24:
--- → +
Reporter | ||
Comment 18•11 years ago
|
||
Any such release will be crashing regularly when using IMAP, fwiw, so there should be little chance of that happening.
Reporter | ||
Comment 19•11 years ago
|
||
Actually, that's wrong. I forgot that only the tests use the JS-implemented message window, not the actual app.
Reporter | ||
Comment 20•11 years ago
|
||
Anybody else want to take the review here?
Comment 21•11 years ago
|
||
Comment on attachment 754606 [details] [diff] [review] Make IMAP protocol avoid addreffing potentially non-threadsafe windows off the main thread. Neil, can you take a look at this?
Attachment #754606 -
Flags: review?(mozilla) → review?(neil)
Comment 22•11 years ago
|
||
Comment on attachment 754606 [details] [diff] [review] Make IMAP protocol avoid addreffing potentially non-threadsafe windows off the main thread. I already did, see comment #11.
Attachment #754606 -
Flags: review?(neil) → review?(mbanner)
Updated•11 years ago
|
tracking-thunderbird24:
+ → ---
tracking-thunderbird_esr24:
--- → 26+
Comment 23•11 years ago
|
||
Comment on attachment 754606 [details] [diff] [review] Make IMAP protocol avoid addreffing potentially non-threadsafe windows off the main thread. Sorry for not really looking earlier. I think we need to fix the tests as Neil suggests, I'm not quite sure that's very easy, but it seems the better fix in the long run.
Attachment #754606 -
Flags: review?(mbanner) → review-
Reporter | ||
Comment 24•11 years ago
|
||
Let's not pretend that I'm actually working on this.
Assignee: josh → nobody
Comment 25•10 years ago
|
||
kent, can you suggest someone who might be able to work on this?
Flags: needinfo?(kent)
Whiteboard: [leave open] → [leave open][patchlove]
Assignee | ||
Comment 26•10 years ago
|
||
If the approach in comment 11 can be done this way, then perhaps this will fix this. Otherwise either Joshua or Neil would probably be good candidates to try to fix the msgWindow. But if this is only a testing issue, I would prefer we just fix the testing issue.
Flags: needinfo?(kent)
Attachment #8541304 -
Flags: review?(neil)
Comment 27•10 years ago
|
||
Comment on attachment 8541304 [details] [diff] [review] 870864.patch I'm not sure you need to override authPrompt because the login manage provides the default auth prompt anyway. I'm not even sure you need to override the prompt dialog, since alertUtilsPrompts already overrides both the window watcher and the prompt service. You obviously don't need to override them in the IMAP case. Does the POP case actually try to access them off the main thread? But if you do need to override them, I'd prefer if you added a testing interface with the method to override the prompt dialog.
Attachment #8541304 -
Flags: review?(neil) → feedback+
Assignee | ||
Comment 28•10 years ago
|
||
With a few additional fixes, I don't need to override them, with one exception: In test_imapPasswordFailure, the password dialog fails due to this code in nsMsgIncomingServer: if (m_password.IsEmpty()) { nsCOMPtr<nsIAuthPrompt> dialog; // aMsgWindow is required if we need to prompt if (aMsgWindow) { rv = aMsgWindow->GetAuthPrompt(getter_AddRefs(dialog)); NS_ENSURE_SUCCESS(rv, rv); } which is calling: NS_IMETHODIMP nsMsgWindow::GetAuthPrompt(nsIAuthPrompt * *aAuthPrompt) { NS_ENSURE_ARG_POINTER(aAuthPrompt); if (!mRootDocShellWeak) return NS_ERROR_FAILURE; Any suggestions of how to fix that with the override of authPrompt?
Comment 29•10 years ago
|
||
(In reply to Kent James (:rkent) from comment #28) > > Any suggestions of how to fix that with the override of authPrompt?
Flags: needinfo?(neil)
Flags: needinfo?(Pidgeot18)
Comment 30•10 years ago
|
||
In the POP case since it's main-thread only are we just using a dummy msgWindow object which therefore can provide a dummy auth prompt?
Comment 31•9 years ago
|
||
Barring that, it may be possible to make the GetAuthPrompt method construct a new nsIAuthPrompt like the dummy message window did in the case that no docshell is available.
Flags: needinfo?(Pidgeot18)
Assignee | ||
Comment 32•9 years ago
|
||
I'm going to set myself as Assigned because I have a patch proposal here that I should look at some day, but I don;t make any claims to be actually working on this at the moment. If you are competent feel free to take this.
Assignee: nobody → rkent
Status: NEW → ASSIGNED
Comment 33•9 years ago
|
||
Kent, The imap area is rather fragile because of the lingering off main thrad issues. Can this be added to the bottom of your top priority stack? Or suggest somone else? clearing - neil replied.
Flags: needinfo?(neil) → needinfo?(rkent)
Assignee | ||
Comment 34•9 years ago
|
||
Wayne, there are just too many other things for me to work on between now and release of Thunderbird 45. Magnus would be another possibility, but he also already is doing alot.
Assignee: rkent → nobody
Status: ASSIGNED → NEW
Assignee | ||
Updated•9 years ago
|
Flags: needinfo?(rkent)
Comment 35•8 years ago
|
||
When adding a new test to mailnews/imap/test/unit/xpcshell.ini for bug 629738 I came across this bug which disables a bunch of tests. So what's the status of this? Your patch is really minimal. Does it solve the problem?
Flags: needinfo?(rkent)
Assignee | ||
Comment 36•8 years ago
|
||
Yes I believes it works, here is an updated patch with Neal's suggestion.
Assignee: nobody → rkent
Attachment #8541304 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Flags: needinfo?(rkent)
Attachment #8791395 -
Flags: review?(jorgk)
Comment 37•8 years ago
|
||
(In reply to Kent James (:rkent) from comment #36) > Yes I believes it works, here is an updated patch with Neal's suggestion. Great. Thanks. Try here: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=59186d0b7944
Comment 38•8 years ago
|
||
Comment on attachment 8791395 [details] [diff] [review] Use a real window, add a test interface as Neal suggested Review of attachment 8791395 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. Please disable the test that also fails on Mac. See try run. ::: mailnews/imap/test/unit/xpcshell.ini @@ +63,5 @@ > [test_offlinePlayback.js] > run-sequentially = Starts server twice. > [test_offlineStoreLocking.js] > # Doesn't currently work on Windows, bug 782625 > +skip-if = os == 'win' Please check the try run to see that this also fails on Mac.
Attachment #8791395 -
Flags: review?(jorgk) → review+
Assignee | ||
Comment 39•8 years ago
|
||
http://hg.mozilla.org/comm-central/rev/b133e1d1134c
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [leave open][patchlove]
Target Milestone: --- → Thunderbird 51.0
You need to log in
before you can comment on or make changes to this bug.
Description
•