Closed
Bug 523672
Opened 15 years ago
Closed 15 years ago
test_handlerService.js asserting on Linux debug unittests: ###!!! ASSERTION: index exceeds allowable range: 'i < mLength'
Categories
(Core Graveyard :: File Handling, defect, P1)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.9.3a1
People
(Reporter: ted, Assigned: dbaron)
References
()
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
937 bytes,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Currently both test_handlerService.js and test_bookmarks.js are consistently crashing with what looks like the same stack on the Linux debug unittest runs. It's complicated by not having symbols for the stack (bug 519196).
Reporter | ||
Comment 1•15 years ago
|
||
Marco, Shawn, have either of you run this test on a debug Linux build?
Comment 2•15 years ago
|
||
hm, i did run all places toolkit tests on a linux debug build last month, but did not see anything strange. Same stack for both? those tests are testing really different code paths...
Reporter | ||
Comment 3•15 years ago
|
||
Right, I assume the faulty code is lower in the platform somewhere, and both tests just happen to trigger it.
Reporter | ||
Comment 4•15 years ago
|
||
Ok, I reproduced these in a Linux debug build, they're separate issues. Not having symbols just makes it really tough to see! The test_bookmarks failure is bug 520445. The test_handlerService.js failure is different.
Summary: test_bookmarks.js and test_handlerService.js crashing on Linux debug unittests → test_handlerService.js crashing on Linux debug unittests
Reporter | ||
Comment 5•15 years ago
|
||
This is really lame. Inside the assertion here: http://hg.mozilla.org/mozilla-central/annotate/7f1f309a34f8/uriloader/exthandler/unix/nsGNOMERegistry.cpp#l129 aFileExt is an empty string, so accessing aFileExt[0] hits the assertion here: http://hg.mozilla.org/mozilla-central/annotate/7f1f309a34f8/xpcom/string/public/nsTSubstring.h#l235 CCing reed since he added that assertion.
Component: General → File Handling
QA Contact: general → file-handling
Summary: test_handlerService.js crashing on Linux debug unittests → test_handlerService.js asserting on Linux debug unittests: ###!!! ASSERTION: index exceeds allowable range: 'i < mLength'
Reporter | ||
Comment 6•15 years ago
|
||
Oh, I guess he just landed the patch in CVS. CCing Mike Hommey, who authored it.
Reporter | ||
Comment 7•15 years ago
|
||
Some more info, I think the bug is slightly up the stack. GetFromExtension is being called from here: http://hg.mozilla.org/mozilla-central/annotate/7f1f309a34f8/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp#l83 but I think the GetPrimaryExtension() call right before that is failing, because mExtensions is an empty array: http://hg.mozilla.org/mozilla-central/annotate/7f1f309a34f8/uriloader/exthandler/nsMIMEInfoImpl.cpp#l127 But GetHasDefaultHandler is ignoring the NS_ERROR_NOT_INITIALIZED return value and using the empty ext string.
Comment 8•15 years ago
|
||
(In reply to comment #6) > Oh, I guess he just landed the patch in CVS. CCing Mike Hommey, who authored > it. IIRC, this has landed a while ago.
Comment 9•15 years ago
|
||
(In reply to comment #7) > Some more info, I think the bug is slightly up the stack. GetFromExtension is > being called from here: > http://hg.mozilla.org/mozilla-central/annotate/7f1f309a34f8/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp#l83 > but I think the GetPrimaryExtension() call right before that is failing, > because mExtensions is an empty array: > http://hg.mozilla.org/mozilla-central/annotate/7f1f309a34f8/uriloader/exthandler/nsMIMEInfoImpl.cpp#l127 > > But GetHasDefaultHandler is ignoring the NS_ERROR_NOT_INITIALIZED return value > and using the empty ext string. Yes, it looks like this change is the culprit http://hg.mozilla.org/mozilla-central/diff/99f24b52e463/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
Comment 10•15 years ago
|
||
Ccing Wolfgang, who landed the patch.
Updated•15 years ago
|
Keywords: regression
Reporter | ||
Comment 11•15 years ago
|
||
The "obvious" patch, just returning rv on failure, makes this test fail (but not assert), since it propagates up to the JS as an exception. Returning NS_OK here when we get NS_ERROR_NOT_INITIALIZED seems...weird, but it works and the test passes. I'm not sure if this is the right fix. Should we be propagating the NS_ERROR_NOT_INITIALIZED, and make the test expect it? What else would that break?
Assignee: nobody → ted.mielczarek
Status: NEW → ASSIGNED
Attachment #407751 -
Flags: review?(bzbarsky)
Reporter | ||
Comment 12•15 years ago
|
||
Mike, Wolfgang, does this patch look like the right solution?
No longer depends on: 519196
Comment 13•15 years ago
|
||
Comment on attachment 407751 [details] [diff] [review] don't ignore failure That looks wrong. We are only supposed to leave with NS_OK if we got an answer. If not we need to fall through to the next nsMIMEIfoImpl::GetHasDefaultHandler, don't we?
Comment 14•15 years ago
|
||
(In reply to comment #13) > (From update of attachment 407751 [details] [diff] [review]) > That looks wrong. > We are only supposed to leave with NS_OK if we got an answer. If not we need to > fall through to the next nsMIMEIfoImpl::GetHasDefaultHandler, don't we? I was about to tell you something like that: you should let the hildon and mimeinfoimpl path go through. I'd say setting mimeinfo to NULL when you get NS_ERROR_NOT_INITIALIZED would be good.
Comment 15•15 years ago
|
||
Yeah, the right fix here is to only call the GetFromExtension if the ext is nonempty.
Comment 16•15 years ago
|
||
(In reply to comment #14) > I was about to tell you <snip> I though that was Ted, sorry Wolfgang.
Reporter | ||
Comment 17•15 years ago
|
||
Someone else want to take this and do the right fix? I don't really know this code.
Assignee | ||
Comment 18•15 years ago
|
||
Assignee: ted.mielczarek → dbaron
Attachment #407751 -
Attachment is obsolete: true
Attachment #407818 -
Flags: review?(bzbarsky)
Attachment #407751 -
Flags: review?(bzbarsky)
Updated•15 years ago
|
Attachment #407818 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 19•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/5ec653ccfb52
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Priority: -- → P1
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•