Closed Bug 231725 Opened 22 years ago Closed 22 years ago

XBL/RDF/template mechanism crash!

Categories

(Core :: XBL, defect)

x86
All
defect
Not set
critical

Tracking

()

RESOLVED DUPLICATE of bug 228774

People

(Reporter: manelix2000, Assigned: hyatt)

Details

(Keywords: crash)

Attachments

(4 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.6) Gecko/20040113 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; es-ES; rv:1.6) Gecko/20040113 I'm not sure about the component, so sorry if I'm wrong. I have the following testcase: ------- XUL FILE --------- <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/css" href="testcase3.css"?> <xul:window xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <xul:label value="this is the testcase..."/> <xul:myoutliner/> <xul:button label="reload" onclick="document.location.reload()"/> </xul:window> ---------- CSS FILE ----------- myoutliner { -moz-binding:url("testcase.xbl#OUTLINERS"); } --------- XBL FLE ------------- <?xml version="1.0" encoding="ISO-8859-1"?> <xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <xbl:binding id="OUTLINERS"> <xbl:content> <xul:vbox flex="1"> <xul:tree datasources="rdf:null" ref="urn:null" style="height:150px;" flex="1"> <xul:treecols> <xul:treecol label="mycolumn" flex="1"/> </xul:treecols> <xul:template> <xul:rule> <xul:treechildren> <xul:treeitem uri="rdf:*" record="rdf:*"> <xul:treerow> <xul:treecell label="rdf:http://www.foo.com/foo#property1"/> </xul:treerow> </xul:treeitem> </xul:treechildren> </xul:rule> </xul:template> </xul:tree> </xul:vbox> <xbl:children/> </xbl:content> <xbl:implementation> <xbl:method name="init"> <xbl:body> <![CDATA[ var AC = document.getAnonymousNodes(this)[0]; this.ACBinding = AC.getElementsByAttribute("datasources","rdf:null")[0]; var RDF1 = '<?xml version="1.0"?>\n'; RDF1 += '\t\t<RDF:RDF xmlns:foo="http://www.foo.com/foo#" xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n' RDF1 += '<RDF:Description RDF:about="http://www.foo.com/foo#Dummy"/>\n' RDF1 += '<RDF:Seq RDF:about="urn:node">\n' RDF1 += '<RDF:li resource="urn:child:1"/>\n' RDF1 += '</RDF:Seq>\n' RDF1 += '<foo:Node RDF:about="urn:node"/>\n' RDF1 += '<RDF:Description RDF:about="urn:child:1" foo:property1="value1" foo:property2="value2" />\n' RDF1 += '</RDF:RDF>'; netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var url = Components.classes["@mozilla.org/network/standard-url;1"].getService(Components.interfaces.nsIURL); url.spec = "http://www.foo.com/"; var ds=Components.classes['@mozilla.org/rdf/datasource;1?name=in-memory-datasource'].createInstance(Components.interfaces.nsIRDFDataSource); ds.QueryInterface(Components.interfaces.nsIRDFPurgeableDataSource); var parser=Components.classes["@mozilla.org/rdf/xml-parser;1"].getService(Components.interfaces.nsIRDFXMLParser); parser.parseString(ds,url,RDF1); var reference = "http://www.foo.com/foo#Dummy"; netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); var datasources = this.ACBinding.database.GetDataSources(); while( datasources.hasMoreElements() ){ var datasource = datasources.getNext(); this.ACBinding.database.RemoveDataSource(datasource); } this.ACBinding.database.AddDataSource(ds); this.ACBinding.setAttribute("ref",reference); ]]> </xbl:body> </xbl:method> <xbl:constructor> <![CDATA[ this.init(); ]]> </xbl:constructor> <xbl:destructor> <![CDATA[ alert('destructor') ]]> </xbl:destructor> </xbl:implementation> </xbl:binding> </xbl:bindings> ------------------------------------------------------------- If you click the reload button from the xulfile, mozilla crashes! I have find out that if you don't set the "ref" attribute in the xbl file to "urn:null" and leave blank, i.e, ref="" instead of ref="urn:null" then mozilla doesn't crash! What is happening? It works for mozilla up to 1.4! tx in advance! Manel. Reproducible: Always Steps to Reproduce: 1. Click the reload button! Actual Results: Mozilla crashes! Expected Results: Page should be reloaded successfully!
Manel, could you split your testcase into separate files and add them as attachments?
Severity: normal → critical
Keywords: crash, stackwanted
Attached file The xul file (obsolete) —
Comment on attachment 139581 [details] The xul file fu.... this is not valid!
Attachment #139581 - Attachment is obsolete: true
Attached file The css file!
Attached file The xbl file!
crash: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7a) Gecko/20040120 I made the three files with copy and paste, and tested with Mozilla 1.7a: crash, DocWatson came up, NullPtr, I didn´t repeat Mozilla 1.4.1: o.k., reload, shift-reload, rinse and repeat, ok.
Confirmed on linux trunk. Stacktrace on the way.
Keywords: stackwanted
OS: Windows XP → All
Attached file stack trace
#6 0x413aefda in nsXULDocument::RemoveSubtreeFromDocument(nsIContent*) ( this=0x8748fc8, aElement=0x87c63f8) at nsXULDocument.cpp:1942 1942 rv = RemoveSubtreeFromDocument(aElement->GetChildAt(count)); (gdb) p aElement $1 = (class nsIContent *) 0x87c63f8 (gdb) p count $2 = 1 (gdb) p *aElement $3 = {<nsISupports> = {_vptr.nsISupports = 0x4155d628}, mDocument = 0x0, mParentPtrBits = 142369504}
Stack trace is identical to bug 228774. However, now we have a test case. *** This bug has been marked as a duplicate of 228774 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: