During local debug build of TB 64-bit I get the assertion failure: ASSERTION: uninitialized: 'mHost.mLen >= 0', file ../mozilla/netwerk/base/nsStandardURL.cpp, line 1603
Categories
(Thunderbird :: General, defect)
Tracking
(Not tracked)
People
(Reporter: ishikawa, Assigned: jorgk-bmo)
References
Details
Attachments
(2 files, 2 obsolete files)
7.24 KB,
text/plain
|
Details | |
5.67 KB,
patch
|
valentin
:
review+
|
Details | Diff | Splinter Review |
With the source code updated about two days ago,
I get the following assertion error when I test the TB 64-bit versio binary with |make mozmill| test suite.
ASSERTION: uninitialized: 'mHost.mLen >= 0', file /NREF-COMM-CENTRAL/mozilla/netwerk/base/nsStandardURL.cpp, line 1603
This happens in the test of
TEST-START | /NREF-COMM-CENTRAL/mozilla/comm/mail/test/mozmill/attachment/test-attachment.js | test_attachment_name_click
What irks me is that the test succeeds as a whole:
TEST-PASS | /NREF-COMM-CENTRAL/mozilla/comm/mail/test/mozmill/attachment/test-attachment.js | test-attachment.js::test_attachment_list_expansion
Comment 1•6 years ago
|
||
[26486, Main Thread] ###!!! ASSERTION: uninitialized: 'mHost.mLen >= 0', file /NREF-COMM-CENTRAL/mozilla/netwerk/base/nsStandardURL.cpp, line 1603
#01: mozilla::net::nsStandardURL::SetUserPass(nsTSubstring<char> const&) (/NREF-COMM-CENTRAL/mozilla/netwerk/base/nsStandardURL.cpp:1603 (discriminator 1))
#02: mozilla::net::nsStandardURL::TemplatedMutator<mozilla::net::nsStandardURL>::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) (/NREF-COMM-CENTRAL/mozilla/netwerk/base/nsStandardURL.h:323)
#03: nsMsgMailNewsUrl::SetUserPass(nsTSubstring<char> const&) (/KERNEL-SRC/moz-obj-dir/objdir-tb3/dist/include/nsIURIMutator.h:489)
#04: nsMsgMailNewsUrl::Mutator::SetUserPass(nsTSubstring<char> const&, nsIURIMutator**) (/NREF-COMM-CENTRAL/mozilla/comm/mailnews/base/util/nsMsgMailNewsUrl.h:80)
#05: NS_InvokeByIndex (/NREF-COMM-CENTRAL/mozilla/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S:110)
I'm not sure how this would happen. We check that the URL is initialized, but it's not clear how the URL gets to have no host.
Jorg, can you check if this is a fresh mutator, what is the current value of its URL, and what we're setting it to? Thanks!
Reporter | ||
Comment 2•6 years ago
|
||
I'm not sure how this would happen. We check that the URL is initialized, but it's not clear how the URL gets to have no host.
Please recall that this is a local test done at home.
There COULD be a local DNS setup issue that might interfere with the ordinary |make mozmil| operation.
For example, I think I am using ".example.org" domain name for home local LAN, which should NOT resolve to any valid domain name outside in the open Internet. (YES, I KNOW THERE WERE dummy entries to catch such doain name usage.)
The mozilla test code MAY be using such a host domain name for internal testing purposes and the my local home DNS may
play a funny trick(?)
if
If I could run the test in the mozilla build/test farm, I can verify if it happens or not there.
Somehow I have not been able to submit build/test job successfully
since the great file directory layout change of last April timeframe.
TIA
Assignee | ||
Comment 3•6 years ago
|
||
Many MozMill tests are currently busted due to XBL issues, so I need to return to this after we have fixed that bustage.
Reporter | ||
Comment 4•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #3)
Many MozMill tests are currently busted due to XBL issues, so I need to return to this after we have fixed that bustage.
Fair enough. Thank you for the work on XBL.
So I do not have to report any local errors seemingly related to XBL, I presume.
Assignee | ||
Comment 5•6 years ago
|
||
This error is not due to XBL, but I can't run the test now since it's mostly disabled due to XBL bustage:
https://hg.mozilla.org/comm-central/rev/67022d52f8ed7b8e270f29f2b774ce5ec236f753#l2.1
That said, test_attachment_name_click isn't disabled so let me get back to this.
Assignee | ||
Comment 6•6 years ago
|
||
OK, I did run the test now and I see:
[1728, Main Thread] ###!!! ASSERTION: uninitialized: 'mHost.mLen >= 0', file c:/mozilla-source/comm-central/netwerk/base/nsStandardURL.cpp, line 1603
#01: nsMsgMailNewsUrl::SetUserPass (c:\mozilla-source\comm-central\comm\mailnews\base\util\nsMsgMailNewsUrl.cpp:527)
#02: XPTC__InvokebyIndex[c:\mozilla-source\comm-central\obj-x86_64-pc-mingw32\dist\bin\xul.dll +0x7e6f742]
So some JS uses someURL.userPass = xxx
, hmm, but I can't see that.
The failing code is just return NS_MutateURI(m_baseURL).SetUserPass(aUserPass).Finalize(m_baseURL);
. Dumping out the spec I get:
mailbox:///C:/Users/jorgk/AppData/Local/Temp/mozmillprofile/Mail/Local%20Folders/AttachmentA?number=2&part=1.2&filename=ubik.txt&type=text/plain&filename=ubik.txt
so it looks kosher, although M-C isn't happy with some of our URLs, especially the mailbox ones ;-)
So Valentin, back to Core::Networking?
Comment 7•6 years ago
|
||
The question is: should nsMsgMailNewsUrl have a user & password? If the answer is no, then the problem is how we instantiate m_baseURL. NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID) creates an nsStandardURL with the default type URLTYPE_STANDARD - which must have a hostname. If nsMsgMailNewsUrl is more like a file URL, then it should be initialized like this
Assignee | ||
Comment 8•6 years ago
|
||
nsMsgMailNewsUrl can be lots of things. There are six classes derived from it, see:
https://searchfox.org/comm-central/search?q=public+nsMsgMailNewsUrl&case=false®exp=false&path=
Yes, the mailbox: one is more like a file, but the other ones have host names. I caught it in the debugger, this is the JS stack:
0 initIntro(url = [xpconnect wrapped (nsISupports, nsIURI, nsIURL) @ 0x1d8526f5dc0 (native @ 0x1d856164e20)], filename = "ubik.txt", displayname = "ubik.txt") ["resource://gre/modules/HelperAppDlg.jsm":571:24]
this = [object Object]
1 initDialog() ["resource://gre/modules/HelperAppDlg.jsm":442:9]
this = [object Object]
2 onload(event = [object Event]) ["chrome://mozapps/content/downloads/unknownContentType.xul":1:7]
this = [object ChromeWindow]
3 waitFor(callback = [function], message = "Timeout waiting for modal dialog to open.", timeout = 10000, interval = 100, thisObject = [object Object]) ["chrome://mozmill/content/modules/utils.jsm":391:11]
this = [object Object]
4 WindowWatcher_waitForModalDialog(aWindowType = "unknownContentType", aTimeout = undefined) ["file:///c:/mozilla-source/comm-central/comm/mail/test/mozmill/shared-modules/test-window-helpers.js":379:10]
this = [object Object]
5 wait_for_modal_dialog(aWindowType = "unknownContentType") ["file:///c:/mozilla-source/comm-central/comm/mail/test/mozmill/shared-modules/test-window-helpers.js":612:16]
6 test_attachment_name_click() ["file:///c:/mozilla-source/comm-central/comm/mail/test/mozmill/attachment/test-attachment.js":244:2]
Looks like the test clicks onto some attachment with unknown(?) type ".txt" and some helper is meant to show up which for some reason sets the user password to "".
So where from here?
Comment 9•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #8)
nsMsgMailNewsUrl can be lots of things. There are six classes derived from it, see:
https://searchfox.org/comm-central/search?q=public+nsMsgMailNewsUrl&case=false®exp=false&path=Yes, the mailbox: one is more like a file, but the other ones have host names. I caught it in the debugger, this is the JS stack:
nsMailboxUrl::SetSpecInternal should not simply delegate to nsMsgMailNewsUrl::SetSpecInternal, but should initialize m_baseURL to what makes sense.
I took a look at the other implementations, but I don't know how the URLs should look like, so I can't tell if they are correct or not. Do we have documentation for what each scheme is used for?
Assignee | ||
Comment 10•6 years ago
|
||
Documentation, not that I know of ;-(
You already know the mailbox: URL. IMAP, NNTP, POP3, SMTP and the JA thing certainly have a hostname, also with a user name, like: imap://tbtest%40jorgk%2Ecom@mail.your-server.de:143/fetch%3EUID%3E.INBOX.AAA%3E2
.
So the only one causing trouble is the mailbox: URL.
Assignee | ||
Comment 11•6 years ago
|
||
So where from here? Change nsMailboxUrl::SetSpecInternal()
to use a file-style URL?
Comment 12•6 years ago
|
||
Yes. Something like this:
return NS_MutateURI(new nsStandardURL::Mutator())
.Apply(NS_MutatorMethod(&nsIFileURLMutator::MarkFileURL))
.Apply(NS_MutatorMethod(&nsIStandardURLMutator::Init,
nsIStandardURL::URLTYPE_NO_AUTHORITY, -1, buf,
charset, base, nullptr))
.Finalize(result);
You can skip the MarkFileURL if nsMailboxUrl doesn't also implement nsIFileURL
Assignee | ||
Comment 13•6 years ago
|
||
Umm, now I'm confused. Where do want to put that code?
That's not to replace the nsresult rv = nsMsgMailNewsUrl::SetSpecInternal(aSpec);
surely since the return
would skip the later processing in nsMailboxUrl::SetSpecInternal()
:
https://searchfox.org/comm-central/rev/cb674605dabf543dfb315457479b1e8186e2120c/mailnews/local/src/nsMailboxUrl.cpp#418
Also, your code doesn't set a spec.
Is we don't call into nsMsgMailNewsUrl::SetSpecInternal()
, we don't get this processing:
https://searchfox.org/comm-central/rev/cb674605dabf543dfb315457479b1e8186e2120c/mailnews/base/util/nsMsgMailNewsUrl.cpp#468
Comment 14•6 years ago
|
||
I think the best way is to declare a virtual
already_AddReffed<nsIURI> CreateURI(nsACString& spec); on nsMsgMailNewsUrl. The nsMsgMailNewsUrl implementation will simply create a URI via NS_MutateURI(NS_STANDARDURLMUTATOR_CONTRACTID).SetSpec(aSpec).Finalize(m_baseURL);
. We'll overwrite it in nsMsgMailNewsUrl to create the URI using nsIStandardURLMutator::Init.
And of course, we call CreateURI in nsMsgMailNewsUrl::SetSpecInternal
Assignee | ||
Comment 15•6 years ago
|
||
OK, no more assertion when running
mozmake mozmill-one SOLO_TEST=attachment/test-attachment.js
Let's see whether the rest of the system likes this:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=f8ed04bd95354eee1d4719a29ae14d840adab2c7
Assignee | ||
Comment 16•6 years ago
|
||
Assignee | ||
Comment 17•6 years ago
|
||
I should have known better, those URLs can also have the form mailbox://user@domain@server/folder?number=nn
:-(
Assignee | ||
Comment 18•6 years ago
|
||
OK, this fixes the failing tests, I ran them all manually.
Assignee | ||
Comment 19•6 years ago
|
||
Now checking for "///" instead of '@' like in two other places in the file:
https://searchfox.org/comm-central/rev/f57a399476db0c478257d34e1d44f40596c9dfb7/mailnews/local/src/nsMailboxUrl.cpp#150
https://searchfox.org/comm-central/rev/f57a399476db0c478257d34e1d44f40596c9dfb7/mailnews/local/src/nsMailboxUrl.cpp#423
Sorry about the noise.
Comment 20•6 years ago
|
||
Assignee | ||
Comment 21•6 years ago
|
||
Thanks Valentin, what would to like to test (and how)?
Comment 22•6 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/583bb771fcb6
introduce nsMsgMailNewsUrl::CreateURL() and override it for mailbox: URLs. r=valentin DONTBUILD
Comment 23•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #21)
Thanks Valentin, what would to like to test (and how)?
A simple xpcshell-test should suffice. Similar to netwerk/test/unit/test_URIs.js or netwerk/test/unit/test_standardurl.js
Use Services.io.newURI to create a few URIs of each type, and make sure that setting the username for mailbox URIs throws without triggering the assert.
Assignee | ||
Comment 24•6 years ago
|
||
Thanks Valentin, I filed bug 1535964.
Description
•