• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 924
  • Last Modified:

IXMLDOMDocument2::load crashes when source is from http

The attached code works reliably on XP SP2, but fails on Vista. Furthermore, when I attempt to load local xml, it works on both platforms

MSXML::IXMLDOMDocument2Ptr plZEPHYRInfoDomDocument;
HRESULT hr = plZEPHYRInfoDomDocument.CreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER);
   throw ZephyrException::Create(__LINE__, __FILE__, "Couldn't create IXMLDOMDocument2");
wostringstream bstrZEPHYRInfoURL;
#if 0
bstrZEPHYRInfoURL << L"file://C:\\dev\\MySpace\\ParentCare\\"; // test MSXML by loading a local file
bstrZEPHYRInfoURL << L"http://" << zephyrSiteTokenized->get_URL() << L"/pav/";
bstrZEPHYRInfoURL << zephyrSiteTokenized->get_VersionMajor() << L"." << zephyrSiteTokenized->get_VersionMinor() << L"/";
bstrZEPHYRInfoURL << L"siteinfo.xml";
variant_t doc = bstrZEPHYRInfoURL.str().c_str();
vBool = plZEPHYRInfoDomDocument->load(doc);

Open in new window

  • 3
  • 2
1 Solution
This could have to do with a certain bugfix, published by Microsoft.
Here's the link for a fix for Vista based computers:

This might be the cause for your crash:
After installing 936181 (MS07-042) on Vista, leaked DomDocument objects
cause AV

Can you check, if you've got 936181 installed?
Can you tell a little more about the crash?
Is there a call stack?
larry-allenAuthor Commented:
Thanks to primeMover2004 for interesting comments. Re your first suggestion, it applies to MSXML4. I'm using MSXML3 because its gauranteed to be installed on the systems we're running on.

I'm not sure its specific to a particulate MSXML version, because I built a MSXML6 version that had identical behavior.

I'm still considering the MS07-042 issue, thanks for the suggestion.

I realize I didn't say enough about the nature of the crash (it was the end of a frustrating day).

Referring to the code snippet, the crash occurs at the call to plZEPHYRInfoDomDocument->load at line #21. Other observations:

1. The production code has a try/catch around the load, so I know its not an exception.
2. The load() call terminates the EXE, which happens to be a windows service.
3. There is no exception dialog, AV dialog, blue screen, event log entry, or any other indication. The executable just shuts down.
4. I tested loading the same xml from disk by changing the #define at line 8, it works fine.
5. It works fine on XP SP2. Its has also worked on Vista machines, I'm beginning to suspect the configuration of my test machine.
6. I was testing in a corporate network environment that is locked down pretty tight. I'll be testing in a more open environment today.
This sounds like ExitProcess is called. And you cannot catch ExitProcess :)
Just to be sure:
Can you reproduce the crash with the codesnippet from http://www.hostingforum.ca/715642-problem-latest-ms-patches-msxml4-vista.html?
still crashing?
larry-allenAuthor Commented:
Thanks to everyone who responded, I've figured it out. It's kinda complicated:

1. Opening the http document invokes a TCP/IP stack
2. The TCP/IP stack loads a Layered Service Provider (part of my app)
3. The LSP communicates to another thread in the same EXE.
4. -That- thread is the one that was crashing.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now