Closed
Bug 55771
Opened 24 years ago
Closed 24 years ago
crash in nsBoxSizeListImpl::GetBoxSize at startup on SGI Irix
Categories
(Core :: Layout, defect, P3)
Tracking
()
VERIFIED
FIXED
Future
People
(Reporter: rob, Assigned: eric)
Details
(Keywords: crash)
Attachments
(2 files)
28.28 KB,
text/plain
|
Details | |
632 bytes,
patch
|
Details | Diff | Splinter Review |
Built M17 and latest nightly source on SGI Irix 6.5.8m. Using MIPSpro 7.3.1.1m compilers for entire build. % run-mozilla.sh mozilla-bin Crashes every time at startup, just after debug output "WebShell += 4" The window has just popped up, and it is trying to draw the entries in the left hand sidebar "My Sidebar". I will attach a full stack trace; but partial stack trace as follows: % dbx mozilla-bin core dbx version 7.3 MR 55458_Apr30_MR Apr 30 1999 13:44:41 Core from signal SIGBUS: Bus error (dbx) w 426 mBoxSize.Clear(); 427 428 nsBoxSizeList* node = mFirst; 429 430 while(node) { >* 431 nsBoxSize size = node->GetBoxSize(aState, aIsHorizontal); 432 433 if (size.pref > mBoxSize.pref) 434 mBoxSize.pref = size.pref; 435 (dbx) (dbx) where > 0 nsBoxSizeListImpl::GetBoxSize(nsBoxLayoutState&,int)(this = 0x107e3ab8, aState = 0x7fff1870, aIsHorizontal = 0) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsMonumentLayout.cpp":431, 0x5fb4ccdc] 1 nsBoxSizeListImpl::GetBoxSize(nsBoxLayoutState&,int)(this = 0x107e3b18, aState = 0x7fff1870, aIsHorizontal = 0) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsMonumentLayout.cpp":431, 0x5fb4cccc] 2 nsObeliskLayout::GetMinSize(nsIBox*,nsBoxLayoutState&,nsSize&)(this = 0x107e5b28, aBox = 0x107a4eb8, aState = 0x7fff1870, aSize = 0x107a4ee0) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsObeliskLayout.cpp":198, 0x5fb45ca4] 3 nsContainerBox::GetMinSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4eb8, aState = 0x7fff1870, aSize = 0x107a4ee0) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsContainerBox.cpp":483, 0x5fb6aa88] 4 nsBoxFrame::GetMinSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4e80, aBoxLayoutState = 0x7fff1870, aSize = 0x7fff1060) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsBoxFrame.cpp":884, 0x5fb9844c] 5 nsSprocketLayout::GetMinSize(nsIBox*,nsBoxLayoutState&,nsSize&)(this = 0x107e5b08, aBox = 0x107a4e28, aState = 0x7fff1870, aSize = 0x107a4e50) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsSprocketLayout.cpp":1267, 0x5fb72704] 6 nsTempleLayout::GetMinSize(nsIBox*,nsBoxLayoutState&,nsSize&)(this = 0x107e5b08, aBox = 0x107a4e28, aState = 0x7fff1870, aSize = 0x107a4e50) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsTempleLayout.cpp":249, 0x5fb4984c] 7 nsContainerBox::GetMinSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4e28, aState = 0x7fff1870, aSize = 0x107a4e50) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsContainerBox.cpp":483, 0x5fb6aa88] 8 nsBoxFrame::GetMinSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4df0, aBoxLayoutState = 0x7fff1870, aSize = 0x7fff11b8) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsBoxFrame.cpp":884, 0x5fb9844c] 9 nsStackLayout::GetMinSize(nsIBox*,nsBoxLayoutState&,nsSize&)(this = 0x1084ce98, aBox = 0x107a4d88, aBoxLayoutState = 0x7fff1870, aSize = 0x107a4db0) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsStackLayout.cpp":108, 0x5fb78a48] 10 nsContainerBox::GetMinSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4d88, aState = 0x7fff1870, aSize = 0x107a4db0) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsContainerBox.cpp":483, 0x5fb6aa88] 11 nsBoxFrame::GetMinSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4d50, aBoxLayoutState = 0x7fff1870, aSize = 0x7fff12c8) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsBoxFrame.cpp":884, 0x5fb9844c] 12 nsContainerBox::GetPrefSize(nsBoxLayoutState&,nsSize&)(this = 0x107a4d88, aState = 0x7fff1870, aSize = 0x107a4da8) ["/disk1/sise/mozilla/devel/workpits/m17latest/workarea/mozilla/layout/xul/base/ src/nsContainerBox.cpp":455, 0x5fb6a8f4] ... ------------------ I believe the node being called at the point of crash: [nsMonumentLayout.cpp:431 nsBoxSize size = node->GetBoxSize(aState, IsHorizontal);] is a nsBoxSizeListNodeImpl, and the address in the node variable at this point is the same as that created by a new of such an object earlier on. --------- A hacky work around is to comment out the use of this service at the three places it is used in nsObeliskLayout.cpp: % cvs diff nsObeliskLayout.cpp Index: nsObeliskLayout.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/xul/base/src/nsObeliskLayout.cpp,v retrieving revision 1.14 diff -r1.14 nsObeliskLayout.cpp 99c99 < nsBoxSize size = node->GetBoxSize(aState, isHorizontal); --- > nsBoxSize size; // = node->GetBoxSize(aState, isHorizontal); 198c198 < nsBoxSize size = node->GetBoxSize(aState, isHorizontal); --- > nsBoxSize size; // = node->GetBoxSize(aState, isHorizontal); 235c235 < nsBoxSize size = node->GetBoxSize(aState, isHorizontal); --- > nsBoxSize size; // = node->GetBoxSize(aState, isHorizontal);
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
This problem is possibly a compiler bug with SGI MIPSpro 7.3.1.1 CC. Adding a copy constructor for nsBoxSize stops it crashing, and provides a working fix rather than just commenting out use of GetBoxSize as suggested earlier above. I'll put some preprocessing for Irix MIPSpro compilation around it, and have a go at getting it reviewed. % cvs diff -u nsSprocketLayout.h Index: nsSprocketLayout.h =================================================================== RCS file: /cvsroot/mozilla/layout/xul/base/src/nsSprocketLayout.h,v retrieving revision 1.11 diff -u -r1.11 nsSprocketLayout.h --- nsSprocketLayout.h 2000/06/23 05:14:55 1.11 +++ nsSprocketLayout.h 2000/10/13 03:23:51 @@ -35,6 +35,8 @@ nsBoxSize(); + nsBoxSize(const nsBoxSize & that) { *this = that; }; + nscoord pref; nscoord min; nscoord max;
Reporter | ||
Comment 3•24 years ago
|
||
Comment 4•24 years ago
|
||
Let's get this in if it's the right thing. Reassigning to evaughan, cc'ing scc for a=. /be
Assignee: clayton → evaughan
Assignee | ||
Comment 5•24 years ago
|
||
r=evaughan
Comment 6•24 years ago
|
||
The annoying thing about assignments containing |*this| is that they are confusing to the reader. I would like this patch better if the assignment looked like this operator=(that); or, if you prefer this->operator=(that); though the first form is sufficient for my needs. With that change and enhancing the comment to indicate that we have to define the copy-constructor by hand since SGI doesn't want to synthesize it, I'll be happy. Please attach a new patch and I'll sr= it.
Comment 7•24 years ago
|
||
The only problem with operator=() is that it is not defined. Anyway, I would like to confirm this bug (I am seeing it exactly as described here) and thank Rob for the patch (after applying mozilla works for me).
Comment 8•24 years ago
|
||
|operator=| (for copy assignment) is always defined, unless you do work to intentionally avoid it. If you don't explicitly declare it, C++ will generate it for you. If it didn't exist, the earlier form wouldn't have worked either ... my suggestion is just an explicit form of what was happening in Rob's earlier patch. It's just a form that can never be mistaken by the reader for something doing pointer manipulation or attempting to rebind |this|.
Reporter | ||
Comment 9•24 years ago
|
||
Rewriting the copy constructor as {operator=(that)} or {this->operator=(that);} I get the following compile error: cc-1132 CC: ERROR File = ../../../../../mozilla/layout/xul/base/src/nsSprocketLayout.h, Line = 41 The class "nsBoxSize" has no member "operator=". nsBoxSize(const nsBoxSize & that) { this->operator=(that); }; ^ -------- A quick test case showed that MIPSpro doesn't let you call operator= unless it is explicitly defined. Using g++ it is allowed. I don't really want to have to define an operator= as well as it adds additional maintainability issues. Is {*this = that} OK?
Comment 10•24 years ago
|
||
confirming, to get off of 'unknown crashers radar.'
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Future
Assignee | ||
Comment 11•24 years ago
|
||
Fixed
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•