Closed
Bug 524787
Opened 15 years ago
Closed 15 years ago
crash [@mozStorageResultSet::GetNextRow(mozIStorageRow**) ]
Categories
(Core :: SQLite and Embedded Database Bindings, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.3a1
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta3-fixed |
status1.9.1 | --- | .6-fixed |
People
(Reporter: sdwilsh, Assigned: ddahl)
References
()
Details
(Keywords: crash, Whiteboard: [good first bug])
Crash Data
Attachments
(1 file, 1 obsolete file)
608 bytes,
patch
|
sdwilsh
:
review+
johnath
:
approval1.9.2+
dveditz
:
approval1.9.1.6+
|
Details | Diff | Splinter Review |
Only seeing one crash here, but this just needs a simple null check on the return value. NS_ENSURE_ARG_POINTER anyone?
Reporter | ||
Updated•15 years ago
|
Whiteboard: [good first bug]
Reporter | ||
Updated•15 years ago
|
Reporter | ||
Comment 1•15 years ago
|
||
I suppose it's also possible for GetNextRow to fail here by getting null out of the mData array. Although, I don't see how that could be null.
Reporter | ||
Comment 2•15 years ago
|
||
FWIW, checking the argument for non-nullness is what we should do. If we continue to see crashes with this signature, we'll know it's the later (and be confused).
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → ddahl
Assignee | ||
Comment 3•15 years ago
|
||
Are you looking for something like this, or is there a macro I should be using?
NS_IMETHODIMP
ResultSet::GetNextRow(mozIStorageRow **_row)
{
if(!*_row){
// Return an error?
return NS_OK;
}
if (mCurrentIndex >= mData.Count()) {
// Just return null here
return NS_OK;
}
NS_ADDREF(*_row = mData.ObjectAt(mCurrentIndex++));
return NS_OK;
}
Assignee | ||
Comment 5•15 years ago
|
||
(In reply to comment #4)
> I hinted at the macro in comment 0 ;)
So I tried:
NS_ENSURE_ARG_POINTER(*_row);
and I see this warning in the test suite:
WARNING: NS_ENSURE_TRUE(*_row) failed: file /home/ddahl/code/moz/mozilla-central/mozilla/storage/src/mozStorageResultSet.cpp, line 80
then a test failure:
TEST-UNEXPECTED-FAIL | /home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/_tests/xpcshell/test_storage/unit/test_statement_executeAsync.js | 0 == 11 - See following stack:
JS frame :: /home/ddahl/code/moz/mozilla-central/mozilla/testing/xpcshell/head.js :: do_throw :: line 197
JS frame :: /home/ddahl/code/moz/mozilla-central/mozilla/testing/xpcshell/head.js :: do_check_eq :: line 227
JS frame :: /home/ddahl/code/moz/mozilla-central/obj-i686-pc-linux-gnu-debug/_tests/xpcshell/test_storage/unit/test_statement_executeAsync.js :: anonymous :: line 996
Assignee | ||
Comment 6•15 years ago
|
||
the above mentioned tests fail with this patch:(
Reporter | ||
Comment 7•15 years ago
|
||
(In reply to comment #5)
> NS_ENSURE_ARG_POINTER(*_row);
You do not want to dereference _row. That is what we are trying to protect against crashing on.
Assignee | ||
Comment 8•15 years ago
|
||
Is a test required as well, or is this code path tested well enough?
Attachment #408731 -
Attachment is obsolete: true
Attachment #408882 -
Flags: review?(sdwilsh)
Reporter | ||
Comment 9•15 years ago
|
||
(In reply to comment #8)
> Is a test required as well, or is this code path tested well enough?
Can't really write a test for this unless we write a native code test. It's just a null check, and I'm happy with this.
Reporter | ||
Comment 10•15 years ago
|
||
Comment on attachment 408882 [details] [diff] [review]
v 0.2 All tests pass
r=sdwilsh
Would like to see this on branches.
Attachment #408882 -
Flags: review?(sdwilsh)
Attachment #408882 -
Flags: review+
Attachment #408882 -
Flags: approval1.9.2?
Attachment #408882 -
Flags: approval1.9.1.5?
Reporter | ||
Updated•15 years ago
|
Status: NEW → ASSIGNED
Keywords: checkin-needed
Comment 11•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Comment 12•15 years ago
|
||
Comment on attachment 408882 [details] [diff] [review]
v 0.2 All tests pass
Approved for 1.9.1.6, a=dveditz for release-drivers
Attachment #408882 -
Flags: approval1.9.1.6? → approval1.9.1.6+
Updated•15 years ago
|
Flags: blocking1.9.2?
Comment 13•15 years ago
|
||
Comment on attachment 408882 [details] [diff] [review]
v 0.2 All tests pass
Approved for 1.9.2 - simple hygiene. Don't think we'd hold the release for this bug though, so I'll blocking- this momentarily.
Attachment #408882 -
Flags: approval1.9.2? → approval1.9.2+
Updated•15 years ago
|
Flags: blocking1.9.2? → blocking1.9.2-
Assignee | ||
Updated•15 years ago
|
Keywords: checkin-needed
Comment 14•15 years ago
|
||
status1.9.2:
--- → final-fixed
Keywords: checkin-needed
Comment 15•15 years ago
|
||
status1.9.1:
--- → .6-fixed
Updated•14 years ago
|
Crash Signature: [@mozStorageResultSet::GetNextRow(mozIStorageRow**) ]
Updated•5 months ago
|
Product: Toolkit → Core
You need to log in
before you can comment on or make changes to this bug.
Description
•