Closed GoogleCodeExporter closed 8 years ago
Original comment by fgret...@gmail.com
on 26 Mar 2009 at 10:55
Original comment by fgret...@gmail.com
on 26 Mar 2009 at 10:56
Did this work pre-v3.0.6?
I think the issue is that the XML serialized stream contains a BOM. This is
getting
pulled into the string and is copied into the report. However, a BOM should not
appear in the middle of a document.
What surprises me is that I have CheckCharacters = false in the affected code
so I
wouldn't expect it to throw even if a BOM appeared in there. I guess it's just
time
I started performing early pre-filtering of report content to ensure that
characters
not valid in XML are stripped or replaced early.
Original comment by jeff.br...@gmail.com
on 27 Mar 2009 at 2:05
Here's the actual string in "pkt". Not a BOM but a whole mess of null padding!
"<?xml version=\"1.0\"?>\r\n<TestSomething
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <ID>abc</ID>\r\n
<Address>10.11.12.13</Address>\r\n</TestSomething>\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
You probably want to be using ToArray() instead of GetBuffer().
Original comment by jeff.br...@gmail.com
on 30 Mar 2009 at 11:22
Alternately use the variant of Encoding.UTF8.GetString() that takes a buffer,
start
position and count to extract just the part of the MEmoryStream that was
written to.
Or even better, tell the XmlSerializer to writer to an XmlWriter backed by a
StringWriter.
However, I still intend to provide a workaround for this problem in Gallio so at
least it doesn't crash.
Original comment by jeff.br...@gmail.com
on 30 Mar 2009 at 11:28
Ahh, yes, the GetBuffer() slipped by me. I will notify the author of the unit
test
and suggest the fix.
My original intent was to help strengthen Gallio so that it did not crash, but
instead show the unit test author that his was doing something very silly. ;-)
The
fact that Gallio crashed caused our CI builds to fail, but the output did not
show
which test was the culprit. Thanks.
Original comment by fgret...@gmail.com
on 30 Mar 2009 at 12:31
I'm going to hold off on adding the workaround until v3.0.7. Basically we will
just
need to prefilter the messages to ensure that the user doesn't try to write
crazy
binary content to the log.
Original comment by jeff.br...@gmail.com
on 31 Mar 2009 at 3:55
Original comment by jeff.br...@gmail.com
on 28 Apr 2009 at 7:24
Original comment by jeff.br...@gmail.com
on 29 Jun 2009 at 8:33
Issue 465 has been merged into this issue.
Original comment by jeff.br...@gmail.com
on 18 Jul 2009 at 5:12
Fixed in v3.1 by normalizing messages
Original comment by jeff.br...@gmail.com
on 19 Jul 2009 at 12:59
Original issue reported on code.google.com by
fgret...@gmail.com
on 26 Mar 2009 at 10:55