Closed Bug 596970 Opened 15 years ago Closed 15 years ago

ASSERTION: You can't dereference a NULL nsCOMPtr with operator->() in AsyncStatement::~AsyncStatement()

Categories

(Core :: SQLite and Embedded Database Bindings, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla2.0b7

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file, 1 obsolete file)

Connection *forgottenConn = nsnull; mDBConnection.swap(forgottenConn); (void)::NS_ProxyRelease(mDBConnection->threadOpenedOn, forgottenConn); mDBConnection is nsnull and NS_ProxyRelease is trying to use it. See bug 556631 comment 11 and following.
Summary: ASSERTION: You can't dereference a NULL nsCOMPtr with operator->() in AsynStatement::~AsyncStatement() → ASSERTION: You can't dereference a NULL nsCOMPtr with operator->() in AsyncStatement::~AsyncStatement()
So just replacing mDBConnection->threadOpenedOn with forgottenConn solves the problem. but I'm unsure if there are other changes wanted based on Asuth's comments. Also I have no idea how to write a test to touch this code.
I meant replacing with forgottenConn->threadOpenedOn
That certainly sounds reasonable to me, especially given that that is what the code was meant to do. One could write a test by having a C++ test where we spin up 2 non-main threads... one opens the connection, and then the other one issues an async statement. If we don't assert/crash, then all is well. I'm not sure if sdwilsh wants that level of coverage or to claim that we support such a use case flawlessly though. :)
(In reply to comment #3) > I'm not sure if sdwilsh wants that level of coverage or to claim that we > support such a use case flawlessly though. :) I don't think I care about it that much.
Assignee: nobody → mak77
Status: NEW → ASSIGNED
Attached patch patch v1.0 (obsolete) — Splinter Review
I seem to understand testing this edge case is unneeded.
Attachment #476061 - Flags: review?(bugmail)
Attached patch patch v1.0Splinter Review
gah, the right patch.
Attachment #476061 - Attachment is obsolete: true
Attachment #476062 - Flags: review?(bugmail)
Attachment #476061 - Flags: review?(bugmail)
Comment on attachment 476062 [details] [diff] [review] patch v1.0 Thanks for the fix!
Attachment #476062 - Flags: review?(bugmail) → review+
Comment on attachment 476062 [details] [diff] [review] patch v1.0 Requesting approval on this one-line change, it is blocking my work on a blocker.
Attachment #476062 - Flags: approval2.0?
Attachment #476062 - Flags: approval2.0? → approval2.0+
Blocks: 573492
Blocks: 599970
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b8
Target Milestone: mozilla2.0b8 → mozilla2.0b7
Product: Toolkit → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: