Closed Bug 469972 Opened 16 years ago Closed 16 years ago

leaking the places database connection in strange situations

Categories

(Toolkit :: Places, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: mak, Assigned: sdwilsh)

References

Details

(Keywords: fixed1.9.1, memory-leak, testcase)

Attachments

(3 files)

Attached file a test to activate the leak (deleted) —
i don't know if this should be a storage bug since to activate it i have to use nsPlacesDBFlush, so i suppose that's involved in the leak. This test activates the leak, changing the param assignment to bintInt64Param deactivate the leak.
ps: final reset() should be finalize(), hwv that does not change results.
Attached file the leak (deleted) —
Blocks: 469062
Flags: blocking1.9.1?
Keywords: mlk, testcase
Component: Places → Storage
QA Contact: places → storage
Blocks: 465952
Blocks: 452899
Flags: blocking1.9.1? → blocking1.9.1+
Priority: -- → P2
Target Milestone: --- → mozilla1.9.1
Where did you place this test case to run it?
toolkit/places/tests/unit
ops i lost a /components/
Found it with bent's help. Totally a places bug...
Component: Storage → Places
QA Contact: storage → places
Attached patch v1.0 [Checkin: Comment 10 & 17] (deleted) — Splinter Review
Assignee: nobody → sdwilsh
Status: NEW → ASSIGNED
Attachment #353890 - Flags: review?(dietrich)
Whiteboard: [has patch][needs review dietrich]
Summary: strange leak setting a param to a mozStorageStatement → leaking the places database connection in strange situations
Comment on attachment 353890 [details] [diff] [review] v1.0 [Checkin: Comment 10 & 17] talked over irc, r=me
Attachment #353890 - Flags: review?(dietrich) → review+
OK - here's what was happening: Since we had the getter defined on the prototype, the database would be held onto as long as xpconnect was alive (assuming it was accessed at least once). The problem showed up when we used the mozStorageStatementJSHelper, which ends up making mozStorageService hold not XPConnect until it goes away. This ended up creating a cycle though: XPConnect held a reference to the places database connection The places database connection held a reference to mozStorageService mozStorageService held a reference to XPConnect Fun times...
Whiteboard: [has patch][needs review dietrich] → [has patch][has review][can land]
Attachment #353890 - Attachment description: v1.0 → v1.0 [Checkin: Comment 10]
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [has patch][has review][can land] → [c-n: baking for 1.9.1]
Flags: in-testsuite-
Flags: in-litmus-
Target Milestone: mozilla1.9.1 → mozilla1.9.2a1
(In reply to comment #10) [Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.2a1pre) Gecko/20081220 Minefield/3.2a1pre] (home, optim default) (W2Ksp4) (http://hg.mozilla.org/mozilla-central/rev/e45938aee309) Iirc, Shawn said this patch fixed the testcase, but not the actual tests: *Bug 470455 has a patch to fix its code... :-) *Bug 469062 has been worked around for the time being. :-| *Bug is still there ! :-(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to comment #11) > Iirc, Shawn said this patch fixed the testcase, but not the actual tests: So, I'm going to keep this bug closed, since we've fixed this leak (the one that the testcase exposed). Ideally, we'll get a new bug with another reduced test case, but I just verified that the testcase attached to this bug has been fixed (I had previously reduced it further, and hadn't verified that the original test case didn't leak). This bug is closed as it stands, and I guess we'll try to tackle the other ones one at a time. *sigh*
Status: REOPENED → RESOLVED
Closed: 16 years ago16 years ago
Resolution: --- → FIXED
(In reply to comment #11) > *Bug is still there ! :-( Bug 465952 ! (In reply to comment #12) Agreed... Did this fix either of the following bugs ? *Bug 469062 without its workaround. *Bug 452899 with its currently attached patch.
No longer blocks: 465952, 470455
(In reply to comment #13) > Did this fix either of the following bugs ? > *Bug 469062 without its workaround. yes > *Bug 452899 with its currently attached patch. yes
(In reply to comment #14) > > *Bug 452899 with its currently attached patch. > > yes ops sorry. i thought this was the embed bug, nevermind me.
however embed test is good to check this worked, because the actual patch in bug 470455 would not be enough to fix it completely without this.
Blocks: 470455
Attachment #353890 - Attachment description: v1.0 [Checkin: Comment 10] → v1.0 [Checkin: Comment 10 & 17]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: