Closed Bug 1604190 Opened 4 years ago Closed 4 years ago

mozmill debug builds crashing | application crashed [@ js::AddTypePropertyId(JSContext*, JSObject*, JS::PropertyKey, JS::Value const&)]

Categories

(Thunderbird :: Testing Infrastructure, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 73.0

People

(Reporter: intermittent-bug-filer, Assigned: mkmelin)

References

Details

(Keywords: crash, intermittent-failure)

Crash Data

Attachments

(1 file)

Looks like something in/with momill causes all the debug builds to fail (seen since builds got going again today).
If it's something mozmill specific, maybe it's time to consider pulling the plug from that...

I think the bug is in XPConnect. Here the component loader gets a property from the lexical environment:

https://searchfox.org/mozilla-central/rev/c61720a7d0c094d772059f9d6a7844eb7619f107/js/xpconnect/loader/mozJSComponentLoader.cpp#1220

What's likely happening is that this property is the "uninitialized lexical" magic value. This means it's a let/const that hasn't been properly initialized yet.

To debug which property this is, I'd suggest changing this line from:

    if (!JS_SetPropertyById(cx, aExports, symbolId, value)) {

to:

    if (value.isMagic() || !JS_SetPropertyById(cx, aExports, symbolId, value)) {

That should report a JS exception with the name of the property and hopefully that's enough to point you to the code.

I'll fix this properly in XPConnect but that will likely also end up reporting an exception.

Flags: needinfo?(jdemooij)

If this still doesn't help, please ping me on IRC/Slack.

Flags: needinfo?(ishikawa)

Thanks. I will try and report the result here ASAP. I am editing and compiling now.

Flags: needinfo?(ishikawa)
Depends on: 1604429

OK, with the change mentioned in comment 3, my local |make mozmill| using the DEBUG version of TB proceeds.

Interesting message I see now instead of the Assertion is as follows:

console.log: === JS Bridge: Starting server
console.log: === Mozmill: Seen window chrome://messenger/content/messenger.xul
JavaScript error: resource://testing-common/mozmill/mozmill.jsm, line 69: Error: resource://testing-common/mozmill/init.jsm - Could not get symbol 'mozmill'.

Now, you say it is possible that there is an uninitialized data.
I can run valgrind version (that takes time).
Although the whole process takes a long time, I think I can get to the
initial path where the uninitialized data can be accessed and let valgrind print warning.
Will that help?

See Also: → 1604388

Valgrind won't help with this because it's a different kind of 'uninitialized'. It's caused by mozmill.jsm importing init.jsm, but init.jsm then imports mozmill.jsm so you get a cycle and the "mozmill" const in init.jsm becomes the special uninitialized-lexical value.

I posted a patch in bug 1604429, it should fix this.

A temporary workaround could be to change const mozmill to var mozmill in init.jsm. There could be similar issues elsewhere, though.

An interim report.

I have not applied the patch in 1604429 or did swap |const| and |var| in the previous comment yet.
In that state, I notice there are still cases when the TB (as XPCOM server) seems to crash without clear message, but I need to wait for the
full |make mozmill| test to finish before showing the result.

In the interim state, i.e. as reported in comment 10, I got the following crashing TB instances for the following tests.
The test name after "Running directory:" with a traceback line is where the TB did not start, I think during |make mozmill| test.
But it is probably due to the nature of uninitialized status.

...
INFO | (runtestlist.py) | Running directory: instrumentation
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: junk-commands
INFO | (runtestlist.py) | Running directory: keyboard
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: message-header
INFO | (runtestlist.py) | Running directory: message-reader
INFO | (runtestlist.py) | Running directory: message-window
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: multiple-identities
INFO | (runtestlist.py) | Running directory: newmailaccount
INFO | (runtestlist.py) | Running directory: notification
INFO | (runtestlist.py) | Running directory: override-main-menu-collapse
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: pref-window
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: quick-filter-bar
INFO | (runtestlist.py) | Running directory: search-window
INFO | (runtestlist.py) | Running directory: session-store
INFO | (runtestlist.py) | Running directory: smime
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: startup-firstrun
Traceback (most recent call last):
INFO | (runtestlist.py) | Running directory: subscribe

I will report back later on the use of 1604429.

With the patch in 1604429 (and reverting the change in comment 3) gets the local |make mozmill| with debug version of TB proceeding.
I don't see the strange error previously seen any more.
Strange error I saw was:

JavaScript error: resource://testing-common/mozmill/mozmill.jsm, line 69: Error: resource://testing-common/mozmill/init.jsm - Could not get symbol 'mozmill'.

But the whole local run has just started. I will report back about an hour later when the test finishes.
Stay tuned.

The whole mozmill.jsm and init.jsm inclusion seems ... very unnecessary.

Assignee: nobody → mkmelin+mozilla

Without the patch in comment 13 above, my local |make mozmill| run with DEBUG version of TB (with the patch in bug 1604429) ran more or less successfully, and I see the following at the end. Not perfect, but something we can work with. I mean there are usual bunch of bugs, but not the bustage as before.

SUMMARY-PASS | test-iteratorUtils.js::test_toArray_custom_content_iterator
SUMMARY-PASS | test-iteratorUtils.js::teardownModule
INFO | (runtestlist.py) | utils: 9 passed, 0 failed
INFO | (runtestlist.py) | Directories Run: 33, Passed: 1001, Failed: 5
make: *** [/NEW-SSD/NREF-COMM-CENTRAL/mozilla/comm/mail/testsuite-targets.mk:33: mozmill] Error 1

At one time, I saw the "Passed:" more than 1100. So we still need to improve and enable skipped tests gradually, I suppose.

Comment on attachment 9116371 [details] [diff] [review]
bug1604190_mozmill_fix.patch

Review of attachment 9116371 [details] [diff] [review]:
-----------------------------------------------------------------

Looks like the mozmill tests are happy with this. I'll be landing it later as bustage fix. https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=49ec9d993f638d2491f09bd1f34494a472ef2dc9
Attachment #9116371 - Flags: review?(ishikawa)
Status: NEW → ASSIGNED
Target Milestone: --- → Thunderbird 73.0

Yay for not sweeping it under the carpet as first suggested.

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/e83883bc47e7
don't needlessly cross-import between the mozmill.jsm and init.jsm. r=bustage-fix

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

(In reply to Magnus Melin [:mkmelin] from comment #15)

Comment on attachment 9116371 [details] [diff] [review]
bug1604190_mozmill_fix.patch

Review of attachment 9116371 [details] [diff] [review]:

Looks like the mozmill tests are happy with this. I'll be landing it later
as bustage fix.
https://treeherder.mozilla.org/#/jobs?repo=try-comm-
central&revision=49ec9d993f638d2491f09bd1f34494a472ef2dc9

Magnus, you don't need my review, do you?
(Anyway, I applied your patch locally, and there does not seem to be any ill-effect, etc. |make mozmill| is running smoothly.)
So it is OK as it is. If that is what you need, yes I am happy with it. r+=chiaki or whatever.

Comment on attachment 9116371 [details] [diff] [review]
bug1604190_mozmill_fix.patch

Review of attachment 9116371 [details] [diff] [review]:
-----------------------------------------------------------------

This looks reasonable.
I applied the patch locally and ran |make mozmill| with the full debug version of TB and the test proceeded smoothly without introducing any additional bugs.

So I think we should take it.
Attachment #9116371 - Flags: review?(ishikawa) → review+

I am not familiar with the recent review board UI or whatever is called. But now I realize how the review process proceeds to produce a template-based output as in comment 19.

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

Magnus, you don't need my review, do you?

I landed it before review to get out of the busted state for debug builds (rs=bustage-fix), but it's still good to get a second pair of eyes on it, so thanks for the review!

(In reply to Magnus Melin [:mkmelin] from comment #21)

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

Magnus, you don't need my review, do you?

I landed it before review to get out of the busted state for debug builds (rs=bustage-fix), but it's still good to get a second pair of eyes on it, so thanks for the review!

You are welcome and I am happy that we can build TB again and with better M-C infrastructure, this time loader improvement.

Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: