Closed Bug 1513542 Opened 5 years ago Closed 5 years ago

Fix nsStandardURL leak debugging

Categories

(Core :: Networking, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: dragana, Assigned: dragana)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file, 1 obsolete file)

it crashes if no uri is created.
Blocks: socket-proc
Priority: -- → P1
Whiteboard: [necko-triaged]
Version: 63 Branch → Trunk
Do you have a stack trace? Why does it crash?
Blocks: 1513057
(In reply to Valentin Gosu [:valentin] from comment #1)
> Do you have a stack trace? Why does it crash?

Kershaw showed me the crash and Byron found it as well. The patch is copied from a Byron's patch :)

It was crashing in DumpLeakedURLs::~DumpLeakedURLs(). If we have never used DumpLeakedURLs we were initializing gAllURLsMutex in a destructor of another static variable.
Assignee: nobody → dd.mozilla
Status: NEW → ASSIGNED
Keywords: checkin-needed
Hi, 

We're sorry, Autoland could not rebase your commits for you automatically. Please manually rebase your commits and try again. (255, 'applying /tmp/tmpAKYzhK\npatching file netwerk/base/nsStandardURL.cpp\nHunk #2 FAILED at 257\nHunk #3 FAILED at 270\nHunk #4 FAILED at 328\n3 out of 4 hunks FAILED -- saving rejects to file netwerk/base/nsStandardURL.cpp.rej\nabort: patch failed to apply', '') 

:dragana Could you please take a look?
Flags: needinfo?(dd.mozilla)
(In reply to Cristina Coroiu [:ccoroiu] from comment #4)
> Hi, 
> 
> We're sorry, Autoland could not rebase your commits for you automatically.
> Please manually rebase your commits and try again. (255, 'applying
> /tmp/tmpAKYzhK\npatching file netwerk/base/nsStandardURL.cpp\nHunk #2 FAILED
> at 257\nHunk #3 FAILED at 270\nHunk #4 FAILED at 328\n3 out of 4 hunks
> FAILED -- saving rejects to file netwerk/base/nsStandardURL.cpp.rej\nabort:
> patch failed to apply', '') 
> 
> :dragana Could you please take a look?

Thanks. It is rebased.
Flags: needinfo?(dd.mozilla)
Keywords: checkin-needed
Pushed by ccoroiu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dcd8195681d7
Fix static deinit of the nsStandardURL leak debugging helper. r=valentin
Keywords: checkin-needed
Backed out changeset dcd8195681d7 (bug 1513542) for browser-chrome failures at build/src/xpcom/base/nsTraceRefcnt.cpp

Backout: https://hg.mozilla.org/integration/autoland/rev/7359f1ce3a65537fe5c7a2075c58e0cb11b358e3

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=dcd8195681d70ee47bde2e80846fc62b1e63eb74

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=217819382&repo=autoland&lineNumber=15817

02:33:21     INFO - TEST-START | toolkit/components/url-classifier/tests/browser/browser_flashblock_off_with_always_activate.js
02:33:21     INFO - GECKO(4220) | Chrome file doesn't exist: Z:\task_1545184309\build\tests\mochitest\browser\toolkit\components\url-classifier\tests\browser\head.js
02:33:21     INFO - GECKO(4220) | [6060, Unnamed thread 1b405415800] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file z:/build/build/src/xpcom/base/nsTraceRefcnt.cpp, line 189
02:33:21     INFO - GECKO(4220) | ### XPCOM_MEM_BLOAT_LOG defined -- logging bloat/leaks to c:\users\task_1545184309\appdata\local\temp\tmpbtvkl3.mozrunner\runtests_leaks.log
02:33:21     INFO - GECKO(4220) | [6060, Unnamed thread 1b405415800] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file z:/build/build/src/xpcom/base/nsTraceRefcnt.cpp, line 189
02:33:21     INFO - GECKO(4220) | [Child 6060, Main Thread] WARNING: No CID found when attempting to map contract ID: file z:/build/build/src/xpcom/components/nsComponentManager.cpp, line 572
02:33:21     INFO - GECKO(4220) | ++DOCSHELL 000001B405441000 == 1 [pid = 6060] [id = {b9c34568-66b0-4042-9474-bf77864969d8}]
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 1 (000001B40ADB4C00) [pid = 6060] [serial = 1] [outer = 0000000000000000]
02:33:21     INFO - GECKO(4220) | [Parent 4000, Main Thread] WARNING: '!mSelection', file z:/build/build/src/editor/libeditor/EditorBase.cpp, line 4813
02:33:21     INFO - GECKO(4220) | [Parent 4000, Main Thread] WARNING: '!editActionData.CanHandle()', file z:/build/build/src/editor/libeditor/EditorBase.cpp, line 1250
02:33:21     INFO - GECKO(4220) | [4732, Unnamed thread 1aab2b15800] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file z:/build/build/src/xpcom/base/nsTraceRefcnt.cpp, line 189
02:33:21     INFO - GECKO(4220) | ### XPCOM_MEM_BLOAT_LOG defined -- logging bloat/leaks to c:\users\task_1545184309\appdata\local\temp\tmpbtvkl3.mozrunner\runtests_leaks.log
02:33:21     INFO - GECKO(4220) | [4732, Unnamed thread 1aab2b15800] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file z:/build/build/src/xpcom/base/nsTraceRefcnt.cpp, line 189
02:33:21     INFO - GECKO(4220) | [Child 4732, Main Thread] WARNING: No CID found when attempting to map contract ID: file z:/build/build/src/xpcom/components/nsComponentManager.cpp, line 572
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 2 (000001B40ADB7400) [pid = 6060] [serial = 2] [outer = 000001B40ADB4C00]
02:33:21     INFO - GECKO(4220) | [Child 6060, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/base/nsContentUtils.cpp, line 8205
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 3 (000001B40CF8E000) [pid = 6060] [serial = 3] [outer = 000001B40ADB4C00]
02:33:21     INFO - GECKO(4220) | [Child 6060, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/base/nsContentUtils.cpp, line 8205
02:33:21     INFO - GECKO(4220) | ++DOCSHELL 000001AAB2B41000 == 1 [pid = 4732] [id = {6c021eb6-7093-421c-a348-88b6edafec37}]
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 1 (000001AAB85A2400) [pid = 4732] [serial = 1] [outer = 0000000000000000]
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 2 (000001AAB85A4C00) [pid = 4732] [serial = 2] [outer = 000001AAB85A2400]
02:33:21     INFO - GECKO(4220) | [Child 4732, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/base/nsContentUtils.cpp, line 8205
02:33:21     INFO - GECKO(4220) | [Child 4732, Main Thread] WARNING: site security information will not be persisted: file z:/build/build/src/security/manager/ssl/nsSiteSecurityService.cpp, line 506
02:33:21     INFO - GECKO(4220) | [Parent 4000, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/netwerk/url-classifier/UrlClassifierCommon.cpp, line 121
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 3 (000001AABA77D400) [pid = 4732] [serial = 3] [outer = 000001AAB85A2400]
02:33:21     INFO - GECKO(4220) | ++DOCSHELL 000001AABAB22800 == 2 [pid = 4732] [id = {f944f77f-dc8f-4bb1-9952-3bbcdbd17dd0}]
02:33:21     INFO - GECKO(4220) | ++DOMWINDOW == 4 (000001AABAB5F800) [pid = 4732] [serial = 4] [outer = 0000000000000000]
02:33:22     INFO - GECKO(4220) | ++DOMWINDOW == 5 (000001AABAB61C00) [pid = 4732] [serial = 5] [outer = 000001AABAB5F800]
02:33:22     INFO - GECKO(4220) | [Child 4732, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/base/nsContentUtils.cpp, line 8205
02:33:22     INFO - GECKO(4220) | For application/x-shockwave-flash-test found plugin npswftest.dll
02:33:22     INFO - GECKO(4220) | [2140, Unnamed thread 1fdeae15800] WARNING: XPCOM objects created/destroyed from static ctor/dtor: file z:/build/build/src/xpcom/base/nsTraceRefcnt.cpp, line 189
02:33:22     INFO - GECKO(4220) | ### XPCOM_MEM_BLOAT_LOG defined -- unable to log bloat/leaks to c:\users\task_1545184309\appdata\local\temp\tmpbtvkl3.mozrunner\runtests_leaks.log
02:33:22     INFO - GECKO(4220) | Assertion failure: false (Tried and failed to create an XPCOM log), at z:/build/build/src/xpcom/base/nsTraceRefcnt.cpp:548
02:33:27     INFO - GECKO(4220) | --DOCSHELL 00000190D5740800 == 0 [pid = 7664] [id = {cd315035-3f54-4e04-9c73-48dfc05ef5e7}]
02:33:29     INFO - GECKO(4220) | --DOCSHELL 0000029878641000 == 1 [pid = 3772] [id = {ff904467-2d92-4f40-b99a-72e28e3ec517}]
02:33:29     INFO - GECKO(4220) | --DOCSHELL 00000207A2745800 == 3 [pid = 2656] [id = {2aa638ee-1531-48cd-8819-c5387bd75401}]
02:33:33     INFO - GECKO(4220) | --DOMWINDOW == 11 (00000207AA2AE000) [pid = 2656] [serial = 7] [outer = 0000000000000000] [url = about:blank]
02:33:33     INFO - GECKO(4220) | --DOMWINDOW == 10 (00000207AA2ACC00) [pid = 2656] [serial = 6] [outer = 0000000000000000] [url = about:blank]
02:33:33     INFO - GECKO(4220) | --DOMWINDOW == 9 (00000207AA2AE800) [pid = 2656] [serial = 8] [outer = 0000000000000000] [url = about:blank]
02:33:33     INFO - GECKO(4220) | --DOMWINDOW == 8 (00000207A80BDC00) [pid = 2656] [serial = 5] [outer = 0000000000000000] [url = about:blank]
02:33:35     INFO - GECKO(4220) | --DOMWINDOW == 4 (000002987DFA6000) [pid = 3772] [serial = 2] [outer = 0000000000000000] [url = about:blank]
02:33:35     INFO - GECKO(4220) | [Child 3772, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/base/Element.cpp, line 1269
02:33:35     INFO - GECKO(4220) | --DOMWINDOW == 3 (00000298786B0400) [pid = 3772] [serial = 1] [outer = 0000000000000000] [url = chrome://gfxsanity/content/sanitytest.html]
02:33:36     INFO - GECKO(4220) | --DOMWINDOW == 7 (00000207A80BB800) [pid = 2656] [serial = 4] [outer = 0000000000000000] [url = moz-extension://4dc63d1c-0fc9-41c6-b8c4-29bb4b07218b/_generated_background_page.html]
02:33:37     INFO - GECKO(4220) | --DOMWINDOW == 3 (00000190DAFA2C00) [pid = 7664] [serial = 2] [outer = 0000000000000000] [url = about:blank]
02:33:37     INFO - GECKO(4220) | --DOMWINDOW == 2 (00000190D57AE400) [pid = 7664] [serial = 1] [outer = 0000000000000000] [url = about:blank]
02:33:38     INFO - GECKO(4220) | --DOMWINDOW == 2 (000002987F0BF000) [pid = 3772] [serial = 3] [outer = 0000000000000000] [url = chrome://gfxsanity/content/sanitytest.html]
02:33:38     INFO - GECKO(4220) | --DOMWINDOW == 6 (00000207AA5AA800) [pid = 2656] [serial = 12] [outer = 0000000000000000] [url = moz-extension://4dc63d1c-0fc9-41c6-b8c4-29bb4b07218b/_generated_background_page.html]
02:33:41     INFO - GECKO(4220) | --DOMWINDOW == 1 (00000190DD499C00) [pid = 7664] [serial = 4] [outer = 0000000000000000] [url = about:blank]
02:33:41     INFO - GECKO(4220) | --DOMWINDOW == 0 (00000190DAFA2400) [pid = 7664] [serial = 3] [outer = 0000000000000000] [url = about:blank]
02:33:41     INFO - GECKO(4220) | --DOMWINDOW == 2 (000001B40ADB7400) [pid = 6060] [serial = 2] [outer = 0000000000000000] [url = about:blank]
02:39:16     INFO -  [6000, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file z:/build/build/src/toolkit/components/places/Database.cpp, line 552
02:39:16     INFO -  [6000, Main Thread] WARNING: Unable to get a connection to vacuum database: file z:/build/build/src/storage/VacuumManager.cpp, line 128
02:39:16     INFO -  [6000, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005: file z:/build/build/src/xpcom/base/nsSystemInfo.cpp, line 116
02:39:16     INFO -  [6000, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/quota/ActorsParent.cpp, line 2271
02:39:16     INFO -  [6000, Main Thread] WARNING: 'NS_FAILED(rv)', file z:/build/build/src/dom/quota/ActorsParent.cpp, line 2424
02:39:16     INFO -  [6000, IPDL Background] WARNING: '!quotaManager', file z:/build/build/src/dom/quota/ActorsParent.cpp, line 6243
02:39:51     INFO - Buffered messages logged at 02:33:21
02:39:51     INFO - Entering test bound checkFlashBlockLists
02:39:51     INFO - RUNNING TEST: Unknown domain (Ask to Activate, Flashblock off)
02:39:51     INFO - Buffered messages logged at 02:33:22
02:39:51     INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "http://example.com/browser/toolkit/components/url-classifier/tests/browser/flash_block_frame.html" line: 0}]
02:39:51     INFO - Buffered messages finished
02:39:51    ERROR - TEST-UNEXPECTED-TIMEOUT | toolkit/components/url-classifier/tests/browser/browser_flashblock_off_with_always_activate.js | application timed out after 370 seconds with no output
02:39:51    ERROR - Force-terminating active process(es).
02:39:51     INFO - Determining child pids from psutil...
02:39:51     INFO - [4000]
02:39:51     INFO - ==> process 4000 launched child process 6592 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.0.590067557\2115213774" -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - "C:\Users\task_1545184309\AppData\LocalLow\Mozilla\Temp-{fdf24496-d23a-463c-80ea-e1b26d96fb09}" 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 2256 gpu)
02:39:51     INFO - ==> process 4000 launched child process 5924 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.1.228897986\42630444" -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - "C:\Users\task_1545184309\AppData\LocalLow\Mozilla\Temp-{fdf24496-d23a-463c-80ea-e1b26d96fb09}" 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 2540 rdd)
02:39:51     INFO - ==> process 4000 launched child process 3772 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.8.404236614\896224548" -childID 1 -isForBrowser -prefsHandle 1864 -prefMapHandle 2840 -prefsLen 1 -prefMapSize 191130 -schedulerPrefs 0001,2 -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 2004 tab)
02:39:51     INFO - ==> process 4000 launched child process 2656 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.16.1021881341\738465024" -childID 2 -isForBrowser -prefsHandle 3028 -prefMapHandle 3020 -prefsLen 185 -prefMapSize 191130 -schedulerPrefs 0001,2 -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 2584 tab)
02:39:51     INFO - ==> process 4000 launched child process 7664 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.24.1951662452\1731094515" -childID 3 -isForBrowser -prefsHandle 1568 -prefMapHandle 3160 -prefsLen 185 -prefMapSize 191130 -schedulerPrefs 0001,2 -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 3112 tab)
02:39:51     INFO - ==> process 4000 launched child process 6060 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.32.1270719660\1138674232" -childID 4 -isForBrowser -prefsHandle 3780 -prefMapHandle 3480 -prefsLen 7816 -prefMapSize 191130 -schedulerPrefs 0001,2 -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 3776 tab)
02:39:51     INFO - ==> process 4000 launched child process 4732 ("Z:\task_1545184309\build\application\firefox\firefox.exe" -contentproc --channel="4000.40.279467780\1789057960" -childID 5 -isForBrowser -prefsHandle 4068 -prefMapHandle 4284 -prefsLen 9825 -prefMapSize 191130 -schedulerPrefs 0001,2 -parentBuildID 20181219012037 -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 4300 tab)
02:39:51     INFO - ==> process 4000 launched child process 2140 ("Z:\task_1545184309\build\application\firefox\plugin-container.exe" --channel="4000.48.2065952760\1575448667" "C:\Users\task_1545184309\AppData\Local\Temp\tmpbtvkl3.mozrunner\plugins\npswftest.dll" "C:\Users\task_1545184309\AppData\LocalLow\Mozilla\Temp-{26482586-9f2d-4b35-92aa-c0c15b0576ac}" "Z:\task_1545184309\AppData\Roaming\Adobe\\" -greomni "Z:\task_1545184309\build\application\firefox\omni.ja" -appomni "Z:\task_1545184309\build\application\firefox\browser\omni.ja" -appdir "Z:\task_1545184309\build\application\firefox\browser" - 4000 "\\.\pipe\gecko-crash-server-pipe.4000" 4448 plugin)
02:39:51     INFO - Found child pids: set([4000, 6592, 5924, 4732, 6060, 7664, 2140, 2656, 3772])
02:39:51     INFO - Failed to get child procs
02:39:51     INFO - Killing process: 4000
Flags: needinfo?(dd.mozilla)
Attachment #9030748 - Attachment is obsolete: true

So I could not fix the previous patch. The first problem with the previous patch was that it did not use StaticMutex which is needed. This could be fix but the main problem remained:

StaticMutex initialize lazy its mMutex variable, only when it used. If we do not use it, like on the socket process that does not do anything, it will be initialize in the destructor of DumpLeakedURLs, i.e. when static variables are destroyed which causes a crash (example crash is https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=222409296&repo=try&lineNumber=1772). Therefore we need to call StaticMutexAutoLock lock(gAllURLsMutex) before destructor.

Flags: needinfo?(dd.mozilla)
Keywords: checkin-needed

Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e54c8660c447
We need to use gAllURLsMutex before destructor of a static variable. r=valentin

Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: