WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: sdorn on December 13, 2022, 09:53:08 PM

Title: x64 FileGet() causes crash in Studio 2022E beta
Post by: sdorn on December 13, 2022, 09:53:08 PM
Hello, I get a repeatable crash in x64 Studio 2022C and 2022E beta when using FileGet() with a large-ish (55MB) file.
  - The file is XML (ASCII text)
  - The error is "64-bit debugger connection failed - 800706C6"
                (https://postimg.cc/HJ7jFGYf)
  - No error when running in 32 bit mode
  - The XML file can be downloaded here if needed  -  https://file.io/yKbFtNbBlnG5
Thanks.
Title: Re: x64 FileGet() causes crash in Studio 2022E beta
Post by: td on December 13, 2022, 10:23:03 PM
This is a 64-bit debugger problem and not a WinBatch or the WIL DLL or any changes made for the beta problem. We will try to get the debugger fixed before the next release. Thanks for taking the time to report the problem.
Title: Re: x64 FileGet() causes crash in Studio 2022E beta
Post by: td on December 15, 2022, 10:45:29 AM
Well, that was interesting. It was very much a data-driven problem. As it happened the reported XML file's lines were all terminated with a carriage return-line feed pair except for the fourth line which only had a line feed terminator. The missing carriage return caused the 64-bit debugger to overwrite by one character the buffer used to pass the variable's partial content back to WinBatch Studio's variable list window. Because the 64-bit debugger runs in a 64-bit process it uses a thunking technique to pass data back to WinBatch Studio's 32-bit process. The thunking process is much more sensitive to a buffer overwrite than the 32-bit debugger running in a different thread in the 32-bit WinBatch Studio because no thunking is involved.

The problem will be corrected in the next general release.
Title: Re: x64 FileGet() causes crash in Studio 2022E beta
Post by: kdmoyers on December 15, 2022, 12:22:00 PM
((I just love that "thunking" is a word.  It's so great.))
Title: Re: x64 FileGet() causes crash in Studio 2022E beta
Post by: td on December 15, 2022, 01:36:09 PM
According to Meriam-Webster, it is both a verb and noun:
https://www.merriam-webster.com/dictionary/thunk (https://www.merriam-webster.com/dictionary/thunk)

In computer science, the word is usually used as a noun but in the best MSFT tradition of using nouns as verbs, I have used it as a verb.
https://en.wikipedia.org/wiki/Thunk (https://en.wikipedia.org/wiki/Thunk)

The part that is so unusual about this issue is that to encounter the bug you needed to have a line feed or tab character at exactly one location in a string. If either character occurs anywhere else in the string the error will not occur.
Title: Re: x64 FileGet() causes crash in Studio 2022E beta
Post by: sdorn on December 15, 2022, 08:47:30 PM
I'm glad I found a way to upload the file, saved you from a mystery "snipe hunt". I'm not sure where I lost the LF, maybe an error on my side driving that. Thanks for looking into it and the analysis.