L
Lee Gillie
A surprising, and unexplained behavior was seen from a RELEASE build of
a VB application (essentially a console app). It processes thousands of
pages of text, and occasionally drops the first character of the first
line of the page. I really felt this was likely my own bug. In a DEBUG
build now I captured data from the page and wrote the result for each
page to the debug window. The result was consistent with the release
build, and occurred at the same pages, as expected. Next I let it run UP
TO THE PAGE of concern, and NOW stepped through in the debugger, so I
could see the problem. THIS TIME the character DID NOT DROP. I let it
step through to the DEBUG.WRITELINE (as described above), and it shows
the character was NOT DROPPED as well. The page reader works with
arrays of StringBuilder objects. I am certain there are lots of GC's
going on while running, but I try and reuse the same SB's for
efficiency, and set length to zero when reusing, to hopefully avoid
re-allocation overhead. So I am suspicious of StringBuilder.
Looking for any clues. I use VB.NET a lot, and have not seen this where
stepping through makes the code run differently. Maybe if others have,
and understand it, it will help me understand it well enough to mitigate
the problem. It probably still is my own bug, but the change in behavior
has served to confuse, not illuminate for me.
Thanks for anything anyone can share.
Best regards - Lee Gillie - Online Data Processing, Spokane, WA
a VB application (essentially a console app). It processes thousands of
pages of text, and occasionally drops the first character of the first
line of the page. I really felt this was likely my own bug. In a DEBUG
build now I captured data from the page and wrote the result for each
page to the debug window. The result was consistent with the release
build, and occurred at the same pages, as expected. Next I let it run UP
TO THE PAGE of concern, and NOW stepped through in the debugger, so I
could see the problem. THIS TIME the character DID NOT DROP. I let it
step through to the DEBUG.WRITELINE (as described above), and it shows
the character was NOT DROPPED as well. The page reader works with
arrays of StringBuilder objects. I am certain there are lots of GC's
going on while running, but I try and reuse the same SB's for
efficiency, and set length to zero when reusing, to hopefully avoid
re-allocation overhead. So I am suspicious of StringBuilder.
Looking for any clues. I use VB.NET a lot, and have not seen this where
stepping through makes the code run differently. Maybe if others have,
and understand it, it will help me understand it well enough to mitigate
the problem. It probably still is my own bug, but the change in behavior
has served to confuse, not illuminate for me.
Thanks for anything anyone can share.
Best regards - Lee Gillie - Online Data Processing, Spokane, WA