Closed Bug 24499 Opened 25 years ago Closed 25 years ago

Adding a nsIRDFXMLSinkObserver to a nsIRDFXMLSink, then reloading, causes crash.

Categories

(SeaMonkey :: General, defect, P3)

x86
Windows 98
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mj, Assigned: waterson)

References

Details

(Keywords: crash)

Attachments

(3 files)

When experimenting with a nsIXMLSinkObserver to follow the state of a remote RDF Datasource, I managed to reproducibly crash Mozilla. The following code shows how: <html><head><title>XML Sink Observer Test</title> <script> // LoadObserver observes the status of the remote datasources. var oLoadObserver = { OnBeginLoad: function(oDS) { dump('OnBeginLoad\n'); }, OnInterrupt: function(oDS) { dump('OnInterrupt\n'); }, OnResume: function(oDS) { dump('OnResume\n'); }, OnEndLoad: function(oDS) { dump('OnEndLoad\n'); } } // Get RDF Service var oRDFS = Components.classes['component://netscape/rdf/rdf- service'].getService(); oRDFS = oRDFS.QueryInterface(Components.interfaces.nsIRDFService); // Get remote RDF var oRDS = oRDFS.GetDataSource ('http://www.zope.org/Members/mj/Mozilla/RDFTree/tree.rdf'); // Try and add a nsIRDFXMLSinkObserver oRDS = oRDS.QueryInterface(Components.interfaces.nsIRDFXMLSink); oRDS.AddXMLSinkObserver(oLoadObserver); // Force a refesh. We want to see the dosh. oRDS = oRDS.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource); // Crash: oRDS.Refresh(false); </script> </head> <body></body> </html> Comment out the Refresh, and no crash occurs. Tested on build 200001908. Sorry, no traceback (don't know how =()
Blocks: 24403
Status: NEW → ASSIGNED
Target Milestone: M14
We need to hold strong refs to nsIXMLSinkObservers for this to work.
Attached file test case, RDF file
To verify, 1. Save the second attachment as 24499.xul in the ${DIST}/bin/chrome/tests/content/default directory (you'll need to probably create that path: sorry, bug norris). 2. In the browser, load "chrome://tests/content/24499.xul", 3. Click the button. You should see "yippee, the load finished" the first time you click the button, and then "it was already there" on subsequent clicks.
Attached patch proposed fixSplinter Review
dougt: you are (as far as I know) the only person in the world using the nsIRDFXMLSink interfaces. Let me know if the un-initial-capitalization of the IDL is going to affect you.
Added zopestudio keyword for our own tracking.
Keywords: zopestudio
waterson, thanks for the heads up. I do not think that I have any js that uses this interface, but I do have c++ code that does.
fix checked in, r=shaver
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
waterson or zopestudio folks. Can you please mark bug Verified is all is well now. Thanks!
QA Contact: nobody → waterson
When I force an error, not all error cases are reported. Also error messages are broken. In the test case: Change line 14 to read: var ds = RDF.GetDataSource("http://generate/an/error"); and the test XUL file will print: ooh, an error occurred! it's null Note the 'null' value for the Error Message parameter. If I use a valid URL, to an existing server, but not an existing document, like this: var ds = RDF.GetDataSource("http://bugzilla.mozilla.org/not/existing"); I don't get any errors reported. Same for any other non-RDF exiting document. The purpose of the aResult code is unclear to me. <official_voice>I hereby declare this bug to be _reopenend_</official_voice>
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
This is reported as bug 25045.
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Adding crash keyword
Keywords: crash
moving from architecture product to Browser. Architecture product is going away.
Component: RDF → Browser-General
Product: Architecture → Browser
Target Milestone: M14 → ---
Version: 5.0 → other
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: