Closed Bug 593711 Opened 14 years ago Closed 13 years ago

Intermittent mochitest and crashtest and jsreftest and reftest leak at shutdown | leaked 12-13 or 21 instances of AsyncStatement with size 88 bytes each (1056 bytes total)

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla9

People

(Reporter: jdm, Unassigned)

References

Details

(Keywords: intermittent-failure, memory-leak)

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1283710955.1283711547.31055.gz
Rev3 Fedora 12x64 mozilla-central debug test mochitests-5/5 on 2010/09/05 11:22:35

s: talos-r3-fed64-004
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 8224 bytes during test execution
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 9 instances of AsyncStatementParams with size 40 bytes each (360 bytes total)
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 1 instance of BackstagePass with size 48 bytes
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 1 instance of Connection with size 184 bytes
TEST-UNEXPECTED-FAIL | automationutils.processLeakLog() | leaked 1 instance of MatchAutoCompleteFunction with size 24 bytes

Presumably this occurs because we're trying to execute a statement during the shutdown process and some cleanup doesn't end up happening.  The full log shows this:

WARNING: NS_ENSURE_TRUE(target) failed: file /builds/slave/mozilla-central-linux64-debug/build/storage/src/mozStorageAsyncStatementExecution.cpp, line 196
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [mozIStorageConnection.executeAsync]"  nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)"  location: "JS frame :: jar:file:///home/cltbld/talos-slave/mozilla-central_fedora64-debug_test-mochitests-5/build/firefox/omni.jar!/components/nsPlacesExpiration.js :: PEX__expireWithActionAndLimit :: line 799"  data: no]
************************************************************
Summary: Intermittent leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total) → Intermittent mochitest leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
Keywords: mlk
Version: unspecified → Trunk
Comment 12 is a crashtest.
Summary: Intermittent mochitest leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total) → Intermittent mochitest and crashtest leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
http://tinderbox.mozilla.org/showlog.cgi?log=TraceMonkey/1305079909.1305081516.20131.gz
Summary: Intermittent mochitest and crashtest leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total) → Intermittent mochitest and crashtest and jsreftest leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1306036068.1306037408.16273.gz
Summary: Intermittent mochitest and crashtest and jsreftest leak at shutdown | leaked 12 instances of AsyncStatement with size 88 bytes each (1056 bytes total) → Intermittent mochitest and crashtest and jsreftest leak at shutdown | leaked 12-13 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1306052171.1306055158.16959.gz
Summary: Intermittent mochitest and crashtest and jsreftest leak at shutdown | leaked 12-13 instances of AsyncStatement with size 88 bytes each (1056 bytes total) → Intermittent mochitest and crashtest and jsreftest and reftest leak at shutdown | leaked 12-13 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
###!!! ASSERTION: Invalid state to get the params object - all calls will fail!: 'state == mozIStorageAsyncStatement::MOZ_STORAGE_STATEMENT_READY', file ../../../storage/src/mozStorageAsyncStatementJSHelper.cpp, line 72
mozilla::storage::AsyncStatementJSHelper::getParams [mozStorageAsyncStatementJSHelper.cpp:75]
mozilla::storage::AsyncStatementJSHelper::GetProperty [mozStorageAsyncStatementJSHelper.cpp:140]
XPC_WN_Helper_GetProperty [xpcwrappednativejsops.cpp:994]
js::CallJSPropertyOp [jscntxtinlines.h:336]
js_GetPropertyHelperWithShapeInline [jsobj.cpp:5250]
js_GetPropertyHelperInline [jsobj.cpp:5344]
js_GetPropertyHelper [jsobj.cpp:5351]
js::Interpret [jsinterp.cpp:3594]
js::RunScript [jsinterp.cpp:614]
js::Invoke [jsinterp.cpp:686]
js::Invoke [jsinterp.h:169]
js::ExternalInvoke [jsinterp.cpp:805]
JS_CallFunctionValue [jsapi.cpp:5055]
nsXPCWrappedJSClass::CallMethod [xpcwrappedjsclass.cpp:1657]
nsXPCWrappedJS::CallMethod [xpcwrappedjs.cpp:585]
PrepareAndDispatch [xptcstubs_gcc_x86_unix.cpp:95]
mozilla::storage::::CompletionNotifier::Run [mozStorageAsyncStatementExecution.cpp:180]
nsThread::ProcessNextEvent [nsThread.cpp:617]
NS_ProcessNextEvent_P [nsThreadUtils.cpp:245]
nsThread::Shutdown [nsThread.cpp:479]
nsCacheService::Shutdown [nsCacheService.cpp:1083]
nsCacheProfilePrefObserver::Observe [nsCacheService.cpp:385]
nsObserverList::NotifyObservers [nsObserverList.cpp:129]
nsObserverService::NotifyObservers [nsObserverService.cpp:185]
mozilla::ShutdownXPCOM [nsXPComInit.cpp:595]
NS_ShutdownXPCOM_P [nsXPComInit.cpp:565]
ScopedXPCOMStartup::~ScopedXPCOMStartup [nsAppRunner.cpp:1081]
XRE_main [nsAppRunner.cpp:3322]
do_main [nsBrowserApp.cpp:198]
main [nsBrowserApp.cpp:281]
libc.so.6 + 0x16bb6
WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x8000FFFF: file ../../../storage/src/mozStorageAsyncStatementParams.cpp, line 107
************************************************************
* Call to xpconnect wrapped JSObject produced this error:  *
[Exception... "Unexpected error"  nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)"  location: "JS frame :: resource:///components/nsPlacesExpiration.js :: PEX__getBoundStatement :: line 890"  data: no]
************************************************************
sdwilsh, mak: please see comment 67.
I saw that, it's possible expiration tries to run late in the shutdown process, or better, it tries to reuse a finalized statement.
fwiw, Places shutdowns at profile-before-change, here sounds like something tries to cleanup at xpcom-shutdown.
The only thing I could think of is that expiration catches a notification that causes a spurious step. A simple fix may be to just ignore requests after finalization, this is easy to do, even if actually I'd like to know who generates the request first. I'll see if I can reproduce somewhere.
Summary: Intermittent mochitest and crashtest and jsreftest and reftest leak at shutdown | leaked 12-13 instances of AsyncStatement with size 88 bytes each (1056 bytes total) → Intermittent mochitest and crashtest and jsreftest and reftest leak at shutdown | leaked 12-13 or 21 instances of AsyncStatement with size 88 bytes each (1056 bytes total)
I have some suspect, thus I'm going to take a look if I can found some AsyncStatement leak.
Assignee: nobody → mak77
Status: NEW → ASSIGNED
fwiw, I've investigated a bit and pushed some experimental change to try. while "looks like" my changes have slightly improved things (I've not yet seen a 13/21 statements leak), there is still the intermittent 1 AsyncStatement leak, that I've not yet identified (I have 1 suspect but I can't see how we would reach that point). Will do more testing. I'd really like to be able to reproduce locally.
my experiments improved the situation but did not completely fix it, some of the findings from those are part of bug 674210, that may have improved the situation.
Assignee: mak77 → nobody
Status: ASSIGNED → NEW
Seems like this has not happened in the past 7 days.  Should we just call it fixed?
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.