Jump to content

XML Parser Reference Count Crash


mje

Recommended Posts

Summary: When dealing with the XML DOM functions if you close any reference to the DOMDocument and try to use another reference to the DOMDocument, LabVIEW crashes. The DOMDocument references do not appear to count properly.

See attached VI: crashtacular.vi

Steps to reproduce:

Open attached VI, set a path to a file which will be written. Execute the VI. Notice how the execution succeeds, and the file is written.

Open the block diagram of the VI. Look for the following code...

post-11742-126669973214_thumb.png

Note the call to NI_XML.lvlib:Close.vi in the diagram disabled structure. Swap the cases such that the close call is made.

Warning! This will crash LabVIEW, make sure you've saved any other data you have open: Execute the VI.

Expected behavior: After obtaining a new reference to the Document, I expect I should have to close it as I would any other reference I obtain dynamically. I'd only expect the Document to fall from scope after the last reference to it has been closed, instead closing any reference appears to destroy the data.

This bug has existed as long as I can remember, but after being bitten by it again I decided to try to document it. What are your opinions?

My $0.02: It's a bug. If it's by design, it is at best inconsistent with how references are used in the rest of the library, let alone the rest of LabVIEW or programming in general. I see no mention of it in the list of known issues, however I've seen previous posts regarding the issue over at ni.com in the past.

-Michael

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.