Closed Bug 1596251 Opened 5 years ago Closed 4 years ago

Intermittent LeakSanitizer | leak at mozilla::detail::UniqueSelector, operator=, mozilla::dom::ClientInfo::ClientInfo, emplace

Categories

(Core :: Networking: WebSockets, defect, P2)

defect

Tracking

()

RESOLVED FIXED

People

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

References

Details

(Keywords: intermittent-failure, Whiteboard: [necko-triaged], [wptsync upstream][stockwell fixed:patch])

Attachments

(3 files)

Filed by: rgurzau [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=276068681&repo=autoland
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/SoOnLUWlTrelso0iegzLHQ/runs/0/artifacts/public/logs/live_backing.log


[task 2019-11-13T21:23:15.210Z] 21:23:15 INFO - TEST-START | /websockets/remove-own-iframe-during-onerror.window.html
[task 2019-11-13T21:23:15.214Z] 21:23:15 INFO - Closing window 353
[task 2019-11-13T21:23:15.316Z] 21:23:15 INFO - PID 6173 | ###!!! [Parent][RunMessage] Error: Channel closing: too late to send/recv, messages will be lost
[task 2019-11-13T21:23:15.635Z] 21:23:15 INFO - PID 6173 | =================================================================
[task 2019-11-13T21:23:15.635Z] 21:23:15 INFO - PID 6173 | LeakSanitizer: detected memory leaks
[task 2019-11-13T21:23:15.636Z] 21:23:15 INFO - PID 6173 | Indirect leak of 1824 byte(s) in 3 object(s) allocated from:

task 2019-11-13T21:23:21.552Z] 21:23:21 INFO - PID 6173 | Suppressions used:
[task 2019-11-13T21:23:21.552Z] 21:23:21 INFO - PID 6173 | count bytes template
[task 2019-11-13T21:23:21.552Z] 21:23:21 INFO - PID 6173 | 24 728 nsComponentManagerImpl
[task 2019-11-13T21:23:21.553Z] 21:23:21 INFO - PID 6173 | 4 832 mozJSComponentLoader::LoadModule
[task 2019-11-13T21:23:21.553Z] 21:23:21 INFO - PID 6173 | 611 17509 libfontconfig.so
[task 2019-11-13T21:23:21.553Z] 21:23:21 INFO - PID 6173 | 1 29 libglib-2.0.so
[task 2019-11-13T21:23:21.554Z] 21:23:21 INFO - PID 6173 | -----------------------------------------------------
[task 2019-11-13T21:23:21.662Z] 21:23:21 INFO - Browser exited with return code 0
[task 2019-11-13T21:23:21.663Z] 21:23:21 INFO - PROCESS LEAKS None
[task 2019-11-13T21:23:21.663Z] 21:23:21 INFO - ERROR | LeakSanitizer | SUMMARY: AddressSanitizer: 13248 byte(s) leaked in 80 allocation(s).
[task 2019-11-13T21:23:21.664Z] 21:23:21 INFO - LeakSanitizer | To show the addresses of leaked objects add report_objects=1 to LSAN_OPTIONS
[task 2019-11-13T21:23:21.664Z] 21:23:21 INFO - This can be done in testing/mozbase/mozrunner/mozrunner/utils.py
[task 2019-11-13T21:23:21.665Z] 21:23:21 INFO - Allowed depth was 4
[task 2019-11-13T21:23:21.665Z] 21:23:21 INFO - TEST-UNEXPECTED-FAIL | LeakSanitizer | leak at mozilla::detail::UniqueSelector, operator=, mozilla::dom::ClientInfo::ClientInfo, emplace
[task 2019-11-13T21:23:21.666Z] 21:23:21 INFO - TEST-FAIL | LeakSanitizer | leak at Alloc, nsTSubstring, nsTSubstring, nsTSubstring
[task 2019-11-13T21:23:21.666Z] 21:23:21 INFO - INFO | LeakSanitizer | Frame Alloc matched a expected leak
[task 2019-11-13T21:23:21.667Z] 21:23:21 INFO - TEST-FAIL | LeakSanitizer | leak at mozilla::dom::WebSocket::WebSocket, mozilla::dom::WebSocket::ConstructorCommon, mozilla::dom::WebSocket::Constructor, mozilla::dom::WebSocket_Binding::_constructor
[task 2019-11-13T21:23:21.667Z] 21:23:21 INFO - INFO | LeakSanitizer | Frame mozilla::dom::WebSocket::WebSocket matched a expected leak

Priority: P5 → P3
Whiteboard: [necko-triaged]

(In reply to Razvan Maries from comment #1)

Started r/b: https://treeherder.mozilla.org/#/jobs?repo=autoland&searchStr=Linux%2Cx64%2Casan%2CWeb%2Cplatform%2Ctests%2Ctest-linux64-asan%2Fopt-web-platform-tests-e10s-13%2CW%28wpt13%29&tochange=c3630e8d58372c77b6302ea7571082ce124c31b4&fromchange=149d044837d69f645972cc10319baee944cd121b&selectedJob=276362772

The bug seems to happen because of this line in the WPT harness
line = 'cors = ' + cors + ' | cookie = ' + cookie.value;

This in turn probably fails because the expected cookie isn't there, but it still shouldn't throw.
It's probably the fact that the test doesn't complete that's keeping WS alive and causing the leak. I'll write up a quick patch and we'll see if that fixes things.

Assignee: nobody → valentin.gosu
Priority: P3 → P2

cookie.value can't be accessed when cookie.first defaults to "no" which causes
it to throw an exception.
This change makes it so we only access cookie.value when the cookie.first
actually returns a cookie.

(In reply to Stefan Hindli [:stefan_hindli] from bug 159625 comment #7)

https://hg.mozilla.org/mozilla-central/rev/c1e961421fe1

(In reply to Mathew Hodson from bug 159625 comment #8)

It looks like the commit message for this had the wrong bug ID.

(In reply to Web Platform Test Sync Bot (IRC #interop) from bug 159625 comment #5)

Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/20280 for changes under testing/web-platform/tests

This exception is unlikely to be the cause of the leak in bug 1596251, but I
came across it while investigating.

Keywords: leave-open
Pushed by valentin.gosu@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/82ba763a36a7
Fix exception in WPT service-workers/cache-storage/resources/vary.py r=jgraham
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/20302 for changes under testing/web-platform/tests
Whiteboard: [necko-triaged][stockwell needswork:owner] → [necko-triaged][stockwell needswork:owner], [wptsync upstream]
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Upstream PR merged by moz-wptsync-bot
Whiteboard: [necko-triaged], [wptsync upstream][stockwell disable-recommended] → [necko-triaged][stockwell needswork:owner], [wptsync upstream]

jmaher, valentin, i suspect this is still happening. Could you, please, take a look?

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(jmaher)

Unfortunately I was unable to fix the underlying problem. We have a bunch of resources that leak via websockets. I suspect they aren't being cleaned up properly. We are tracking several other leaks in bug 1582481 - and we'll eventually need to develop a proper fix.
In the mean time the attached patch adds ClientInfo to the allow-list for WPT, which should reduce the orange tint of the trees.

Flags: needinfo?(valentin.gosu)
Flags: needinfo?(jmaher)
Pushed by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/367f776160cb
Add ClientInfo to the WS leak allowed-list r=jgraham
Whiteboard: [necko-triaged], [wptsync upstream][stockwell disable-recommended] → [necko-triaged], [wptsync upstream]

No failures since the 25th of November.

Whiteboard: [necko-triaged], [wptsync upstream][stockwell disable-recommended] → [necko-triaged], [wptsync upstream][stockwell fixed:patch]
Status: NEW → RESOLVED
Closed: 4 years ago
Keywords: leave-open
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: