MSXML hangs on bad XML with Embedded Visual C 4.2


This article only applies to people using EVC to debug applications and an image generated with Platform Builder.  It does not, to my knowledge, affect any of the debugging tools or MSXML on PocketPC or SmartPhone development environments.


There is a known bug in EVC 4.2 and its interaction with MSXML.  If you pass to MSXML either bogus XML or a non-existent file or anything other than perfectly formatted MSXML, the calling thread will hang.


At first blush this seems to be a bug in MSXML on Windows CE.  In reality it's an EVC bug.  When MSXML hits an error, it calls RaiseException() and has a __try/__except block to handle this.  For some reason, EVC gets confused by this and ends up hanging your thread.


To workaround this, simply do not attach the EVC debugger to processes that use MSXML unless you are sure that all the XML you are using is legit.  Currently there are no plans to create a hot-fix to EVC to fix this problem, since a workaround exists.  Sorry.


[UPDATE 9/7/05:] According to Antonie van Woerdekom, on CE 5.0 you can work around this problem as below.  Thanks Antonie!


<


It looks like all you have to do is to add the exception ID to the list of known
exceptions in EVC. You can do this through the

       Debug\Exceptions

menu in EVC. Fill in


       E0000001                   under number
       MSXML-Exception        under Name

Then click "add". When you now hit an exception in MSXML, EVC will show a
dialog reading "First chance excption in <program name>: 0xE0000001:
MSXML-Exception"

If you hit F5 to continue your program, it will continue running as
expected. This is not perfect because you don't have a stack trace, but at
least EVC does not hang anymore.


>


 


[Author: John Spaith]

Skip to main content