Closed Bug 1549257 Opened 6 years ago Closed 6 years ago

Linux debug Z7/Z8 tests busted after bug 1542711

Categories

(Thunderbird :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 68.0

People

(Reporter: darktrojan, Assigned: darktrojan)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

I'm not sure why this isn't a failure on Mac and Windows, but Linux debug tests have been burning since bug 1542711 landed. The failing tests are

  • testAlarmDefaultValue.js
  • pref-window/test-attachments-pane.js
  • pref-window/test-font-chooser.js
  • … and possibly others

All these tests involve the preferences tab.

I've tracked the fault down to an address book listener that doesn't get removed when the document it is in unloads. It looks like a CE's disconnectedCallback doesn't fire at the point like an XBL binding's destructor.

I'm doing a Try run to check that my fix doesn't cause further problems, then all going well, I'll land it.

Attached patch 1549257-remove-listener-1.diff (deleted) — Splinter Review
Attachment #9062825 - Flags: review?(mkmelin+mozilla)

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/230148914b48
Remove address book listener at document unload; rs=bustage-fix

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 68.0
Comment on attachment 9062825 [details] [diff] [review] 1549257-remove-listener-1.diff Review of attachment 9062825 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/components/addrbook/content/menulist-addrbooks.js @@ +93,5 @@ > > disconnectedCallback() { > super.disconnectedCallback(); > > + window.removeEventListener("unload", this._onUnload); Normally there is no need to remove event listeners (they go away when the element goes away). This is also wrong here since connectedCallback() can run multiple times. There is protection from having it run more than once in this code. For the case that it's connected again, it would now not have a listener set up anymore.
Attachment #9062825 - Flags: review?(mkmelin+mozilla) → review-
Keywords: regression

So what do I do with this? A landed patch with failed the so-called "post landing review"? Back it out?

Status: RESOLVED → REOPENED
Flags: needinfo?(mkmelin+mozilla)
Flags: needinfo?(geoff)
Resolution: FIXED → ---

Depends on what the actual underlying problem is/was here. Why was linux debug crashing?
It's expected that disconnectedCallback doesn't run when the document unloads.

Flags: needinfo?(mkmelin+mozilla)

Well, you guys sort it out and let me know.

  •  window.removeEventListener("unload", this._onUnload);
    

Normally there is no need to remove event listeners (they go away when the
element goes away).
This is also wrong here since connectedCallback() can run multiple times.
There is protection from having it run more than once in this code. For the
case that it's connected again, it would now not have a listener set up
anymore.

So (only) that line is not wanted?

Depends on what the actual underlying problem is/was here. Why was linux debug crashing?

Because the address book code was holding a reference to the menulist that was never released.

Flags: needinfo?(geoff) → needinfo?(mkmelin+mozilla)

(In reply to Geoff Lankow (:darktrojan) from comment #7)

So (only) that line is not wanted?

There was a problem before the patch too that the listener was being removed in disconnectedCallback but only added the first time in connectedCallback (=> problems when disconnect/connect multiple times)

Flags: needinfo?(mkmelin+mozilla)

So maybe .addEventListener with the "once" option? (And no need to set the listener it as a property then.)

Attached patch 1549257-remove-listener-2.diff (deleted) — Splinter Review

Stops removing the unload listener. I haven't changed the address book listener, I'm just here to fix the "crash".

Attachment #9063095 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9063095 [details] [diff] [review] 1549257-remove-listener-2.diff Review of attachment 9063095 [details] [diff] [review]: ----------------------------------------------------------------- Thx! r=mkmelin
Attachment #9063095 - Flags: review?(mkmelin+mozilla) → review+

Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/e3be3b2f7a06
Follow-up: Address post-landing review comments. r=mkmelin DONTBUILD

Status: REOPENED → RESOLVED
Closed: 6 years ago6 years ago
Resolution: --- → FIXED
Comment on attachment 9063095 [details] [diff] [review] 1549257-remove-listener-2.diff Review of attachment 9063095 [details] [diff] [review]: ----------------------------------------------------------------- ::: mail/components/addrbook/content/menulist-addrbooks.js @@ -93,5 @@ > > disconnectedCallback() { > super.disconnectedCallback(); > > - window.removeEventListener("unload", this._onUnload); I also thought about this, but can disconnectedCallback() be run before "unload" event? Then maybe we still need to remove the listener manually...
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: