Create a framework for MAPI tests
Categories
(MailNews Core :: Simple MAPI, defect)
Tracking
(Not tracked)
People
(Reporter: rain1, Assigned: jorgk-bmo)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 11 obsolete files)
22.76 KB,
patch
|
jorgk-bmo
:
review+
|
Details | Diff | Splinter Review |
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
Comment 3•11 years ago
|
||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Comment 7•11 years ago
|
||
Comment 8•11 years ago
|
||
Comment 9•9 years ago
|
||
Comment 10•8 years ago
|
||
Comment 11•8 years ago
|
||
Assignee | ||
Comment 12•8 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Rebased, made to compile, modernised (ChromeUtils.import, Assert.equal).
No idea whether it does anything useful, will try some other day.
Assignee | ||
Comment 15•6 years ago
|
||
Oh, all the bits in configure.in | confvars.sh | Makefile.in | moz.build fell by the wayside. No idea whether they're still needed in this modern age ;-)
Assignee | ||
Comment 16•6 years ago
|
||
Added a hunk that got lost during rebase. Not the test runs and crashes :-(
mach xpcshell-test comm/mailnews/mapi/test/unit
PROCESS-CRASH | comm/mailnews/mapi/test/unit/test_mapisendmail.js | application crashed [unknown top frame]
The crash is when calling:
hr = pNsMapi->SendMail(lhSession, lpMessage, flFlags, ulReserved);
Exception thrown at 0x00007FFE13D3F684 (rpcrt4.dll) in xpcshell.exe: 0xC0000005: Access violation reading location 0x0000001800000008.
Something for another day.
Assignee | ||
Comment 17•6 years ago
|
||
I tried for a while to figure out why this crashes. In the process I didn't some white-space management and added some comments to the original patch.
Assignee | ||
Comment 18•6 years ago
|
||
Hmm, the login function overwrites an input parameter which doesn't seem like a good idea. This patch fixes it, but it still crashes.
Assignee | ||
Comment 19•6 years ago
|
||
Updated for import changes. There was also a bug so the "new session" flag was ignored.
Now we're back to the crashing state :-(
Assignee | ||
Comment 20•6 years ago
|
||
I made some progress here. The crash only happens when another session of TB is running. I discovered that by coincidence :-(
There was something wrong in the test setup, no default account was set up, so MAPI logon failed and it was downhill from there. I've fixed this now.
So no logging in works and sending started to work, and we run into the next issue. Something is wrong with the monitor.
I wonder whether the initial patch ever worked for Joshua given the missing default account and now this issue :-(
0:04.33 pid:10944 ###!!! ERROR: Potential deadlock detected:
0:04.33 pid:10944 === Cyclical dependency starts at
0:04.33 pid:10944 --- Mutex : MAPISendListener monitor (currently acquired)
0:04.33 pid:10944 calling context
0:04.33 pid:10944 [stack trace unavailable]
0:04.33 pid:10944 === Cycle completed at
0:04.33 pid:10944 --- Mutex : MAPISendListener monitor (currently acquired)
0:04.33 pid:10944 calling context
0:04.33 pid:10944 [stack trace unavailable]
0:04.33 pid:10944 ###!!! Deadlock may happen NOW!
0:04.33 pid:10944 [10944, Main Thread] ###!!! ASSERTION: Potential deadlock detected:
0:04.33 pid:10944 Cyclical dependency starts at
0:04.33 pid:10944 Mutex : MAPISendListener monitor (currently acquired)
0:04.33 pid:10944 Cycle completed at
0:04.33 pid:10944 Mutex : MAPISendListener monitor (currently acquired)
0:04.33 pid:10944 ###!!! Deadlock may happen NOW!
0:04.33 pid:10944 : 'Error', file c:/mozilla-source/comm-central/xpcom/threads/BlockingResourceBase.cpp, line 279
0:04.33 pid:10944 #01: MAPISendListener::OnStopSending (c:\mozilla-source\comm-central\comm\mailnews\mapi\mapihook\src\msgMapiHook.cpp:72)
0:04.33 pid:10944 #02: nsMsgCompose::OnStopSending (c:\mozilla-source\comm-central\comm\mailnews\compose\src\nsMsgCompose.cpp:3542)
0:04.33 pid:10944 #03: nsMsgComposeSendListener::OnStopSending (c:\mozilla-source\comm-central\comm\mailnews\compose\src\nsMsgCompose.cpp:3751)
Assignee | ||
Comment 21•6 years ago
|
||
OK, with some more tweaks this finally works, yay \o/
Let's see what the other platforms say:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=56678a50111954636cd697d55b1aabcd3952c227
Assignee | ||
Comment 22•6 years ago
|
||
And also keeping the linter happy ;-)
Assignee | ||
Comment 23•6 years ago
|
||
Sigh, now keep static analysis happy and add explicit
:
Assignee | ||
Comment 24•6 years ago
|
||
Hmm, test doesn't pass on the server :-(
INFO - TEST-START | comm/mailnews/mapi/test/unit/test_mapisendmail.js
WARNING - TEST-UNEXPECTED-FAIL | comm/mailnews/mapi/test/unit/test_mapisendmail.js | xpcshell return code: 0
INFO - TEST-INFO took 214ms
INFO - >>>>>>>
INFO - PID 3504 | Unable to load \untrusted-startup-test-dll.dll; LoadLibraryW failed: 126
INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
INFO - Error: input is not a recognizable type! at resource:///modules/mimeParser.jsm:81
INFO - MimeParser_parseSync@resource:///modules/mimeParser.jsm:81:13
INFO - MimeParser_extractHeaders@resource:///modules/mimeParser.jsm:172:5
INFO - run_test@Z:/task_1549126101/build/tests/xpcshell/tests/comm/mailnews/mapi/test/unit/test_mapisendmail.js:33:25
INFO - _execute_test@Z:\task_1549126101\build\tests\xpcshell\head.js:521:7
INFO - @-e:1:1
INFO - <<<<<<<
It works locally, so this will be fun to debug :-(
Assignee | ||
Comment 25•6 years ago
|
||
Updated after bug 1524751.
Here's a try with
mozilla::LogModule::Get("MAPI")->SetLevel(mozilla::LogLevel::Debug);
added, maybe we can see why it's not working.
I'm assuming that MAPI may not be installed on machines in automation.
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=171f85f6f39bee8e6871c9c2b7568f3ab473a2ef
Assignee | ||
Comment 26•6 years ago
|
||
Grrr, the explicit
went into the wrong patch :-(
Assignee | ||
Comment 27•6 years ago
|
||
Sadly no output, still the same Unable to load \untrusted-startup-test-dll.dll; LoadLibraryW failed: 126
as in comment #24.
Do our Windows specialists have any idea? David, sorry to trouble you, any idea why that MAPI stuff works locally but not in automation?
Comment 28•6 years ago
|
||
The message comes from here:
https://searchfox.org/comm-central/rev/582bd5d57be824ff97c13c7b6e097b9cf666a953/mozilla/mozglue/build/WindowsDllBlocklist.cpp#784
GetCurrentDirectoryW
returns \
for some reason.
Assignee | ||
Comment 29•6 years ago
|
||
Sigh, those "mozilla via comm-central" links don't work :-( - You mean:
https://searchfox.org/mozilla-central/rev/69d3c6c61dca9a41f14797cd9924733289238d1a/mozglue/build/WindowsDllBlocklist.cpp#784
Assignee | ||
Comment 30•6 years ago
|
||
Which DLL is this about? untrusted-startup-test-dll.dll? What's that? The test does:
https://hg.mozilla.org/try-comm-central/rev/78b3350064bc19e51c83934e50d546323b184f85#l5.117
let mapi = ctypes.open("mozMapi32.dll");
Maybe that needs a path?
Comment 31•6 years ago
|
||
(In reply to Joshua Cranmer [:jcranmer] from comment #4)
(In reply to neil@parkwaycc.co.uk from comment #3)
(In reply to Joshua Cranmer from comment #1)
- MAPISendMail didn't wait until the message is sent
It never has done, has it? (I don't like Outlook's approach whereby the
whole application suddenly becomes modal to a compose window created through
MAPI.)Looking back in the history of the MAPI code, it used to wait until the
message was sent, but this was "stealthily" changed in bug 108275. To be
fair, the change I've made only affects blind MAPI sends.
Just FYI.
MAPISendMail API includes MAPI_DIALOG_MODELESS flag, in addition to MAPI_DIALOG [1]; so the proper MAPI implementation should use modal dialogs, unless MAPI_DIALOG_MODELESS is passed. In this sense, the change in bug 108275 was wrong.
[1] https://docs.microsoft.com/en-us/windows/desktop/api/mapi/nc-mapi-mapisendmailw
Comment 32•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #30)
Which DLL is this about? untrusted-startup-test-dll.dll? What's that? The test does:
https://hg.mozilla.org/try-comm-central/rev/78b3350064bc19e51c83934e50d546323b184f85#l5.117
let mapi = ctypes.open("mozMapi32.dll");
Maybe that needs a path?
IIUC, that is a DLL with a testing framework (searching for that in my build tree gives several, e.g. C:\mozilla-source\mozilla-central\obj-x86_64-pc-mingw32\toolkit\components\telemetry\tests\untrusted-startup-test-dll\untrusted-startup-test-dll.dll). So likely something is missing not in the test code itself, but in the way the test is invoked (comment 28 suggests some initialization, like passing paths, missing?).
Comment 33•6 years ago
|
||
Comment 34•6 years ago
|
||
Oh! /me only can say he is still recovering from illness - so sorry for the noise.
Assignee | ||
Comment 35•6 years ago
|
||
The change is what you suggested. The test uses "new session" (0x02) and the hand-rolled sanity check lost that, see comment #19.
Comment 36•6 years ago
|
||
(In reply to Masatoshi Kimura [:emk] from comment #28)
The message comes from here:
https://searchfox.org/comm-central/rev/
582bd5d57be824ff97c13c7b6e097b9cf666a953/mozilla/mozglue/build/
WindowsDllBlocklist.cpp#784
GetCurrentDirectoryW
returns\
for some reason.
I noticed this on the arm64 builds too, in the taskcluster logs in bug 1524114:
INFO - PID 9868 | Unable to load \untrusted-startup-test-dll.dll; LoadLibraryW failed: 126
But I wasn't aware of this behavior of GetCurrentDirectory. Aaron, have you seen this before?
Comment 37•6 years ago
|
||
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/67e20f7993b0
Create a framework for MAPI tests. r=standard8,jorgk
Assignee | ||
Updated•6 years ago
|
Comment 38•6 years ago
|
||
Comment 39•6 years ago
|
||
(In reply to David Major [:dmajor] from comment #36)
(In reply to Masatoshi Kimura [:emk] from comment #28)
The message comes from here:
https://searchfox.org/comm-central/rev/
582bd5d57be824ff97c13c7b6e097b9cf666a953/mozilla/mozglue/build/
WindowsDllBlocklist.cpp#784
GetCurrentDirectoryW
returns\
for some reason.I noticed this on the arm64 builds too, in the taskcluster logs in bug 1524114:
INFO - PID 9868 | Unable to load \untrusted-startup-test-dll.dll; LoadLibraryW failed: 126
But I wasn't aware of this behavior of GetCurrentDirectory. Aaron, have you seen this before?
Can't say I have.
Comment hidden (Intermittent Failures Robot) |
Assignee | ||
Comment 41•6 years ago
|
||
(In reply to Pulsebot from comment #38)
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/6798eb6964aa
Follow-up: Switch to reentrant monitor as originally intended. r=me DONTBUILD
For the record, I discussed this with Joshua on IRC:
00:26:57 - jorgk: why was there a need for one at the first call site? [1]
00:27:20 - jcranmer: because stuff can be on different threads
00:27:58 - jcranmer: I thought monitor was reentrant on single threads
[1] https://hg.mozilla.org/comm-central/rev/67e20f7993b0f4ce493efca29b24edbe8448e5dc#l2.45
The original patch had:
- PR_CEnterMonitor(this);
- PR_CNotifyAll(this);
+ mozilla::MonitorAutoLock mal(*this);
m_done = true;
- PR_CExitMonitor(this);
- return NS_OK ;
+ NotifyAll();
+ return NS_OK;
but that caused a deadlock situation since Monitor
is not reentrant:
https://searchfox.org/mozilla-central/rev/5e3bffe964110b8d1885b4236b8abd5c94d8f609/xpcom/threads/Monitor.h#16
See comment #20. But the tweak to just remove mozilla::MonitorAutoLock mal(*this);
wasn't the right way to fix this, hence the follow-up that restores a reentrant monitor at that call site.
Assignee | ||
Updated•6 years ago
|
Description
•