1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/xul/tree/crashtests/730441-1.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +<?xml version="1.0"?> 1.5 +<!-- 1.6 +Program received signal SIGSEGV, Segmentation fault. 1.7 +0xb6457185 in nsIContent::SetAttr (this=0x0, aNameSpaceID=0, aName=0xb0cb064c, aValue=..., aNotify=1) at ../../dist/include/nsIContent.h:285 1.8 +285 return SetAttr(aNameSpaceID, aName, nsnull, aValue, aNotify); 1.9 +(gdb) p this 1.10 +$6 = (nsIContent * const) 0x0 1.11 +(gdb) bt 3 1.12 +#0 0xb6457185 in nsIContent::SetAttr (this=0x0, aNameSpaceID=0, aName=0xb0cb064c, aValue=..., aNotify=1) at ../../dist/include/nsIContent.h:285 1.13 +#1 0xb6b72072 in nsTreeColumns::RestoreNaturalOrder (this=0xaaf83cc0) at layout/xul/base/src/tree/src/nsTreeColumns.cpp:605 1.14 +#2 0xb736c76f in NS_InvokeByIndex_P () at xpcom/reflect/xptcall/src/md/unix/xptcinvoke_gcc_x86_unix.cpp:69 1.15 +(More stack frames follow...) 1.16 +(gdb) frame 1 1.17 +#1 0xb6b72072 in nsTreeColumns::RestoreNaturalOrder (this=0xaaf83cc0) at layout/xul/base/src/tree/src/nsTreeColumns.cpp:605 1.18 +605 child->SetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, ordinal, PR_TRUE); 1.19 +(gdb) list 1.20 +600 PRUint32 numChildren = colsContent->GetChildCount(); 1.21 +601 for (PRUint32 i = 0; i < numChildren; ++i) { 1.22 +602 nsIContent *child = colsContent->GetChildAt(i); 1.23 +603 nsAutoString ordinal; 1.24 +604 ordinal.AppendInt(i); 1.25 +605 child->SetAttr(kNameSpaceID_None, nsGkAtoms::ordinal, ordinal, PR_TRUE); 1.26 +606 } 1.27 +(gdb) p child 1.28 +$7 = (nsIContent *) 0x0 1.29 + 1.30 +First loop iteration: |child->SetAttr()| dispatches "DOMAttrModified" event. 1.31 +Event listener removes next column. Second loop iteration: |colsContent->GetChildAt(i)| 1.32 +returns null. Then we have |null->SetAttr()|. 1.33 +--> 1.34 +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 1.35 + onload="run();"> 1.36 +<tree id="tree"> 1.37 + <treecols> 1.38 + <treecol id="col1"/> 1.39 + <treecol id="col2"/> 1.40 + </treecols> 1.41 + <treechildren/> 1.42 +</tree> 1.43 +<script type="text/javascript"><![CDATA[ 1.44 +function listener() { 1.45 + var col2 = document.getElementById("col2"); 1.46 + col2.parentNode.removeChild(col2); 1.47 +} 1.48 + 1.49 +function run() { 1.50 + var col1 = document.getElementById("col1"); 1.51 + col1.addEventListener("DOMAttrModified", listener, true); 1.52 + var tree = document.getElementById("tree"); 1.53 + tree.columns.restoreNaturalOrder(); 1.54 +} 1.55 +]]></script> 1.56 +</window> 1.57 +