Closed Bug 21604 Opened 25 years ago Closed 23 years ago

Sorting messages on Sender throws assertion

Categories

(SeaMonkey :: MailNews: Message Display, defect, P3)

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED INVALID

People

(Reporter: kinmoz, Assigned: sspitzer)

Details

In my 12/13/1999 SeaMonkey WinNt build, I try to sort my messages by
sender by pressing the Sender column header. This causes an assertion to be
thrown:

NTDLL! 77f76148()
nsDebug::Assertion(const char * 0x10093248, const char * 0x10093238, const char
* 0x10093214, int 1127) line 186 + 13 bytes
nsDebug::WarnIfFalse(const char * 0x10093248, const char * 0x10093238, const
char * 0x10093214, int 1127) line 242 + 21 bytes
nsString::Append(const char * 0x037ed8f0, int 13) line 1127 + 31 bytes
nsString::Assign(const char * 0x037ed8f0, int 13) line 1008
nsString::SetString(const char * 0x037ed8f0, int 13) line 408 + 23 bytes
nsCollation::CreateSortKey(nsICollation * 0x037e0b60, nsCollationStrength
kCollationCaseInSensitive, const nsString & {...}, nsString & {...}) line 144
nsCollationWin::CreateSortKey(nsCollationWin * const 0x037e0b60,
nsCollationStrength kCollationCaseInSensitive, const nsString & {...}, nsString
& {...}) line 62 + 30 bytes
nsMsgDatabase::CreateCollationKey(nsString & {...}, nsString & {...}) line 2185
+ 36 bytes
nsMsgHdr::GetAuthorCollationKey(nsMsgHdr * const 0x03501240, nsString *
0x0012c9c4) line 608 + 22 bytes
nsMessage::GetAuthorCollationKey(nsMessage * const 0x03501200, nsString *
0x0012c9c4) line 273 + 30 bytes
nsMsgMessageDataSource::createMessageSenderNode(nsIMessage * 0x03501200, int 1,
nsIRDFNode * * 0x0012cf78) line 761 + 19 bytes
nsMsgMessageDataSource::createMessageNode(nsIMessage * 0x03501200,
nsIRDFResource * 0x02f718d0, nsIRDFNode * * 0x0012cf78) line 694 + 18 bytes
nsMsgMessageDataSource::GetTarget(nsMsgMessageDataSource * const 0x02f71e40,
nsIRDFResource * 0x035011f0, nsIRDFResource * 0x02f718d0, int 1, nsIRDFNode * *
0x0012cf78) line 274 + 25 bytes
CompositeDataSourceImpl::GetTarget(CompositeDataSourceImpl * const 0x031b5530,
nsIRDFResource * 0x035011f0, nsIRDFResource * 0x02f718d0, int 1, nsIRDFNode * *
0x0012cf78) line 722 + 28 bytes
XULSortServiceImpl::GetCachedTarget(_sortStruct * 0x0012d2cc, nsIRDFResource *
0x035011f0, nsIRDFResource * 0x02f718d0, int 1, nsIRDFNode * * 0x0012cf78) line
924 + 42 bytes
XULSortServiceImpl::GetResourceValue(nsIRDFResource * 0x035011f0, nsIRDFResource
* 0x02f719b0, _sortStruct * 0x0012d2cc, nsIRDFNode * * 0x0012cf78, int & 0) line
1028 + 28 bytes
XULSortServiceImpl::GetNodeValue(nsIContent * 0x03500fa0, nsIRDFResource *
0x02f719b0, _sortStruct * 0x0012d2cc, nsIRDFNode * * 0x0012cf78, int & 0) line
1108 + 30 bytes
XULSortServiceImpl::InplaceSort(nsIContent * 0x03500fa0, nsIContent *
0x03511a30, _sortStruct * 0x0012d2cc, int & 0) line 1240 + 50 bytes
inplaceSortCallback(const void * 0x024dffc8, const void * 0x024e0044, void *
0x0012d2cc) line 1290 + 21 bytes
med3(char * 0x024dffc8, char * 0x024e0044, char * 0x024e00c0, int (const void *,
const void *, void *)* 0x01145760 inplaceSortCallback(const void *, const void
*, void *), void * 0x0012d2cc) line 99 + 15 bytes
NS_QuickSort(void * 0x024dffc8, unsigned int 251, unsigned int 4, int (const
void *, const void *, void *)* 0x01145760 inplaceSortCallback(const void *,
const void *, void *), void * 0x0012d2cc) line 128 + 34 bytes
XULSortServiceImpl::SortTreeChildren(nsIContent * 0x03501dd0, _sortStruct *
0x0012d2cc) line 1380 + 30 bytes
XULSortServiceImpl::DoSort(nsIDOMNode * 0x0317aa30, const nsString & {...},
const nsString & {...}) line 1701 + 30 bytes
XULSortServiceImpl::Sort(XULSortServiceImpl * const 0x0225b310, nsIDOMNode *
0x0317aa30, const char * 0x037e1da0, const char * 0x03273480) line 1627 + 62
bytes
XPTC_InvokeByIndex(nsISupports * 0x0225b310, unsigned int 3, unsigned int 3,
nsXPTCVariant * 0x0012d6bc) line 139
nsXPCWrappedNativeClass::CallWrappedMethod(JSContext * 0x02e0d690,
nsXPCWrappedNative * 0x037e1150, const XPCNativeMemberDescriptor * 0x037e11c4,
nsXPCWrappedNativeClass::CallMode CALL_METHOD, unsigned int 3, long *
0x024fd04c, long * 0x0012d86c) line 894 + 43 bytes
WrappedNative_CallMethod(JSContext * 0x02e0d690, JSObject * 0x02434e68, unsigned
int 3, long * 0x024fd04c, long * 0x0012d86c) line 191 + 34 bytes
js_Invoke(JSContext * 0x02e0d690, unsigned int 3, unsigned int 0) line 665 + 26
bytes
js_Interpret(JSContext * 0x02e0d690, long * 0x0012e0dc) line 2226 + 15 bytes
js_Invoke(JSContext * 0x02e0d690, unsigned int 2, unsigned int 0) line 681 + 13
bytes
js_Interpret(JSContext * 0x02e0d690, long * 0x0012e908) line 2226 + 15 bytes
js_Invoke(JSContext * 0x02e0d690, unsigned int 2, unsigned int 0) line 681 + 13
bytes
js_Interpret(JSContext * 0x02e0d690, long * 0x0012f134) line 2226 + 15 bytes
js_Invoke(JSContext * 0x02e0d690, unsigned int 1, unsigned int 2) line 681 + 13
bytes
js_InternalCall(JSContext * 0x02e0d690, JSObject * 0x02434dd0, long 37965288,
unsigned int 1, long * 0x0012f2b8, long * 0x0012f264) line 758 + 15 bytes
JS_CallFunctionValue(JSContext * 0x02e0d690, JSObject * 0x02434dd0, long
37965288, unsigned int 1, long * 0x0012f2b8, long * 0x0012f264) line 2752 + 29
bytes
nsJSContext::CallEventHandler(nsJSContext * const 0x02e0df40, void * 0x02434dd0,
void * 0x02434de8, unsigned int 1, void * 0x0012f2b8, int * 0x0012f2b4) line 547
+ 33 bytes
nsJSEventListener::HandleEvent(nsIDOMEvent * 0x037e40c4) line 128 + 57 bytes
nsEventListenerManager::HandleEventSubType(nsListenerStruct * 0x0317b700,
nsIDOMEvent * 0x037e40c4, unsigned int 4) line 651 + 19 bytes
nsEventListenerManager::HandleEvent(nsIPresContext * 0x02e367d0, nsEvent *
0x0012f7a4, nsIDOMEvent * * 0x0012f76c, unsigned int 7, nsEventStatus *
0x0012fa74) line 786 + 25 bytes
nsXULElement::HandleDOMEvent(nsXULElement * const 0x0317b8d0, nsIPresContext *
0x02e367d0, nsEvent * 0x0012f7a4, nsIDOMEvent * * 0x0012f76c, unsigned int 1,
nsEventStatus * 0x0012fa74) line 2675
nsEventStateManager::CheckForAndDispatchClick(nsEventStateManager * const
0x031d8f80, nsIPresContext * 0x02e367d0, nsMouseEvent * 0x0012fb68,
nsEventStatus * 0x0012fa74) line 1365 + 42 bytes
nsEventStateManager::PostHandleEvent(nsEventStateManager * const 0x031d8f80,
nsIPresContext * 0x02e367d0, nsGUIEvent * 0x0012fb68, nsIFrame * 0x0241ece8,
nsEventStatus * 0x0012fa74, nsIView * 0x031f47c0) line 558 + 24 bytes
PresShell::HandleEvent(PresShell * const 0x02e37e34, nsIView * 0x031f47c0,
nsGUIEvent * 0x0012fb68, nsEventStatus * 0x0012fa74) line 2613 + 43 bytes
nsView::HandleEvent(nsView * const 0x031f47c0, nsGUIEvent * 0x0012fb68, unsigned
int 8, nsEventStatus * 0x0012fa74, int & 0) line 841
nsView::HandleEvent(nsView * const 0x02e363f0, nsGUIEvent * 0x0012fb68, unsigned
int 28, nsEventStatus * 0x0012fa74, int & 0) line 826
nsViewManager::DispatchEvent(nsViewManager * const 0x02e365c0, nsGUIEvent *
0x0012fb68, nsEventStatus * 0x0012fa74) line 1678
HandleEvent(nsGUIEvent * 0x0012fb68) line 69
nsWindow::DispatchEvent(nsWindow * const 0x02e362c4, nsGUIEvent * 0x0012fb68,
nsEventStatus & nsEventStatus_eIgnore) line 421 + 10 bytes
nsWindow::DispatchWindowEvent(nsGUIEvent * 0x0012fb68) line 442
nsWindow::DispatchMouseEvent(unsigned int 301, nsPoint * 0x00000000) line 3332 +
21 bytes
ChildWindow::DispatchMouseEvent(unsigned int 301, nsPoint * 0x00000000) line
3550
nsWindow::ProcessMessage(unsigned int 514, unsigned int 0, long 4981254, long *
0x0012fdc8) line 2632 + 24 bytes
nsWindow::WindowProc(HWND__ * 0x246d0572, unsigned int 514, unsigned int 0, long
4981254) line 608 + 27 bytes
USER32! 77e71250()
JS

The assertion being thrown looks something like:


    #ifdef NS_DEBUG
      PRInt32 len=nsStr::FindChar(temp,0,PR_FALSE,0);
      NS_WARN_IF_FALSE(kNotFound==len,"possible embedded null in
append(char*)");
    #endif
Forgot to mention that this assertion is hit several times during the sorting
process.
Assignee: phil → putterman
Assignee: putterman → nhotta
reassigning to nhotta since it's asserting in collation code.
Assignee: nhotta → putterman
This is because we are using nsString to hold binary data (i.e., collation key).
The collation interface has another methods which do not use nsString but
instead uses a raw bytes (PRUint8*). They are CreateRawSortKey and
CompareRawSortKey.
Scott, could you check if your code can use them instead?
QA Contact: lchiang → fenella
Status: NEW → ASSIGNED
Target Milestone: M13
will look into for M13.  Incredibly annoying.  Doesn't affect release build.
I could do it if I could pass it up to RDF and the sorting code could handle it.
cc'ing rjc.
When did it become true that nsString et.al. couldn't hold binary data?
(I.E. Why is that NS_DEBUG check for a null character there?)
I checked in a work around in the collation code to reduce the assertions. But
it still asserts if the key contains 0x0000 (it didn't happen in my test cases
but it is possible).
Target Milestone: M13 → M14
I think I fixed it so that the empty string case doesn't crash anymore.  Anyway,
we need to decide how we will do this.  M14.
Doesn't seem like any bad consequences for the user, so moving out to M16.
Target Milestone: M14 → M16
Target Milestone: M16 → M19
QA Contact: fenella → laurel
reassigning to sspitzer.  I have no idea if this assertion is still occurring. 
If it's not, somebody please mark this worksforme.
Assignee: putterman → sspitzer
Status: ASSIGNED → NEW
This assertion-bug was filed *way* before the whole outliner era, so I'm taking 
a guess and marking this as invalid. Kin, if you can reproduce this still, 
report back.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → INVALID
marking old invalid and wontfix bugs verified.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.