Closed Bug 677809 Opened 13 years ago Closed 3 years ago

Find all async DB connections that are not asyncClose()d and cause leaks

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: n.nethercote, Unassigned)

Details

(Keywords: memory-leak)

It's a bug if an async DB connection isn't asyncClose()d before its destroyed.  This used to cause crashes in about:memory and telemetry, but thanks to bug 662989 it now only causes leaks (which show up in about:memory).

Bug 654573 comment 60 analyzed JS code and found some places that were failing to do this, resulting in bug 662985 and 662986.  But they're probably not causing the crashes we saw before bug 662989 landed.

So there are probably some cases in C++ code where we aren't calling asyncClose().  In this bug we should hunt them down and fix them.  A code audit is probably the best approach.

Alternatively... we can tell in Connection's destructor if it hasn't been asyncClosed()d.  Maybe it's possible to force the connection to close in a safe way, thus rendering this error-prone API safer?  We'd just have to add an event to the main loop that frees the Connection's mDBConn.
Crash Signature: [@ mozilla::storage::StorageMemoryReporter::GetPath ] [@ @0x0 | mozilla::storage::StorageMemoryReporter::GetPath ] [@ mozilla::storage::Connection::getFilename() ] [@ mozilla::storage::Connection::getFilename ]
Scoobidiver: you added a crash signature, but with bug 662989 landed those crashes shouldn't happen any more.  Have you seen that crash signature since bug 662989 landed, or did you just copy it over from that bug?
Crash Signature: [@ mozilla::storage::StorageMemoryReporter::GetPath ] [@ @0x0 | mozilla::storage::StorageMemoryReporter::GetPath ] [@ mozilla::storage::Connection::getFilename() ] [@ mozilla::storage::Connection::getFilename ]
Keywords: mlk
Summary: Find all async DB connections that are not asyncClose()d → Find all async DB connections that are not asyncClose()d and cause leaks

No action in 9 years, closing.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.