Closed
Bug 424038
Opened 17 years ago
Closed 17 years ago
Assertion thrown when setting query.sort to SORT_BY_ANNOTATION_*
Categories
(Firefox :: Bookmarks & History, defect, P2)
Firefox
Bookmarks & History
Tracking
()
RESOLVED
FIXED
Firefox 3
People
(Reporter: cmtalbert, Assigned: ondrej)
References
Details
Attachments
(3 files, 1 obsolete file)
There is an assertion/crash that occurs in XPCShell when setting SORT_BY_ANNOTATION_* on a query. It happens on both ascending and descending sorts.
I will attach a testcase. Here is the output from XPCShell:
<<<<<<<
../../../../_tests/xpcshell-simple/test_places/queries/test_simple-anno-crash.js: FAIL
../../../../_tests/xpcshell-simple/test_places/queries/test_simple-anno-crash.js.log:
>>>>>>>
+++ JavaScript debugging hooks installed.
*** test pending
###!!! ASSERTION: Invalid sorting mode: 'Not Reached', file /Users/clint/code/fx-trunk/mozilla/toolkit/components/places/src/nsNavHistory.cpp, line 3193
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x00013623]
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x000177A6]
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x00017D9C]
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x0002C84C]
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x00046718]
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x00046B0E]
UNKNOWN [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x000424AD]
nsCOMArray_base::Sort(int (*)(void const*, void const*, void*), void*)+0x00002BD8 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libplaces.dylib +0x000850D4]
NS_InvokeByIndex_P+0x00000062 [../../../../dist/bin/libxpcom_core.dylib +0x0007C2C2]
NSGetModule+0x000130A3 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libxpconnect.dylib +0x00040227]
nsCRT::IsUpper(char)+0x00001515 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libxpconnect.dylib +0x0007DCD9]
NSGetModule+0x0001ADEB [/Users/clint/code/fx-trunk/mozilla/dbg/i386/dist/bin/components/libxpconnect.dylib +0x00047F6F]
js_Invoke+0x00000A22 [../../../../dist/bin/libmozjs.dylib +0x00077ADC]
js_Invoke+0x00000D5A [../../../../dist/bin/libmozjs.dylib +0x00077E14]
js_Invoke+0x00000FA5 [../../../../dist/bin/libmozjs.dylib +0x0007805F]
js_FindProperty+0x000008F4 [../../../../dist/bin/libmozjs.dylib +0x0008CC11]
js_FindProperty+0x00002024 [../../../../dist/bin/libmozjs.dylib +0x0008E341]
JS_CompareValues+0x0000DB56 [../../../../dist/bin/libmozjs.dylib +0x000697B7]
js_Invoke+0x0000130F [../../../../dist/bin/libmozjs.dylib +0x000783C9]
JS_ExecuteScript+0x00000082 [../../../../dist/bin/libmozjs.dylib +0x00017777]
tart+0x00001799 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/toolkit/components/places/tests/../../../../dist/bin/xpcshell +0x00002039]
tart+0x00001AD6 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/toolkit/components/places/tests/../../../../dist/bin/xpcshell +0x00002376]
tart+0x0000212C [/Users/clint/code/fx-trunk/mozilla/dbg/i386/toolkit/components/places/tests/../../../../dist/bin/xpcshell +0x000029CC]
tart+0x000033D0 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/toolkit/components/places/tests/../../../../dist/bin/xpcshell +0x00003C70]
tart+0x00000102 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/toolkit/components/places/tests/../../../../dist/bin/xpcshell +0x000009A2]
tart+0x00000029 [/Users/clint/code/fx-trunk/mozilla/dbg/i386/toolkit/components/places/tests/../../../../dist/bin/xpcshell +0x000008C9]
It looks like we are falling through the switch statement here:
http://mxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsNavHistoryResult.cpp#662
= Expected Behavior =
Don't assert/crash.
Attachment #310691 -
Attachment is obsolete: true
Updated•17 years ago
|
Assignee: nobody → ondrej
OS: Mac OS X → All
Hardware: Macintosh → All
Also happens when using SORT_BY_TAG_* sorting methods.
I think we just need some kind of smart handling for TAG and ANNOTATION sorting methods in this switch statement so we don't assert.
http://mxr.mozilla.org/mozilla/source/toolkit/components/places/src/nsNavHistory.cpp#3198
OS: All → Mac OS X
Hardware: All → Macintosh
Comment 4•17 years ago
|
||
drivers: busted sorting options in the api, fallout from bug 385245.
OS: Mac OS X → All
Hardware: Macintosh → All
Updated•17 years ago
|
Flags: blocking-firefox3?
Updated•17 years ago
|
Updated•17 years ago
|
Flags: blocking-firefox3? → blocking-firefox3+
Assignee | ||
Comment 6•17 years ago
|
||
(In reply to comment #4)
> drivers: busted sorting options in the api, fallout from bug 385245.
It was missing at this place already before the bug 385245, and the test was not yet checked in, so the question is whether the test is not simply wrong or in better words expecting too much from the existing framework. However, I will check if it is possible to implement it.
Status: NEW → ASSIGNED
Whiteboard: [needs status update] → [swag: 2h]
Assignee | ||
Comment 7•17 years ago
|
||
The testing script is incomplete, when you use this
options.sortingMode = options.SORT_BY_ANNOTATION_ASCENDING;
you should say what annotation do we use for sorting:
options.sortingAnnotation = annoN;
According to IDL it should be called before setting sortingMode. Setting annotation on query influences just filtering.
The simple patch that I'm submitting seems to solve the problem. I have tested sorting by both ANNOTATION and by TAGS and it works.
Attachment #313912 -
Flags: review?(dietrich)
Assignee | ||
Updated•17 years ago
|
Keywords: regression
Whiteboard: [swag: 2h] → [needs review dietrich]
Comment 8•17 years ago
|
||
Comment on attachment 313912 [details] [diff] [review]
Do not assert on ANNO and TAGS sorting
r=me, thanks.
Attachment #313912 -
Flags: review?(dietrich) → review+
Comment 10•17 years ago
|
||
Checking in toolkit/components/places/src/nsNavHistory.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v <-- nsNavHistory.cpp
new revision: 1.285; previous revision: 1.284
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [needs review dietrich]
Comment 11•17 years ago
|
||
backed out due to unit test orange
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 12•17 years ago
|
||
(In reply to comment #11)
> backed out due to unit test orange
I doubt it could be my patch. Tests in toolkit are ok, and I can see test in browser places failing too with latest build. Nothing in them looks like they would expect an assertion on the now added sorting modes.
Comment 14•17 years ago
|
||
Checking in toolkit/components/places/src/nsNavHistory.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistory.cpp,v <-- nsNavHistory.cpp
new revision: 1.287; previous revision: 1.286
done
Status: REOPENED → RESOLVED
Closed: 17 years ago → 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Keywords: checkin-needed
Comment 15•15 years ago
|
||
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h".
In Thunderbird 3.0b, you do that as follows:
Tools | Message Filters
Make sure the correct account is selected. Click "New"
Conditions: Body contains places-to-b-and-h
Change the action to "Delete Message".
Select "Manually Run" from the dropdown at the top.
Click OK.
Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter.
Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in
before you can comment on or make changes to this bug.
Description
•