Error reading large VTK files in the Windows version

Thank you Todd!

Here is a fresh 6 day link: https://velocite-public.s3.fr-par.scw.cloud/domain_00010000.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=SCW7BRXPRJM3D3G7DZKG%2F20211221%2Ffr-par%2Fs3%2Faws4_request&X-Amz-Date=20211221T112852Z&X-Amz-Expires=521990&X-Amz-Signature=713f4ebeaf7627ac9c3287dbba20a4287fc046d84846e358e3ee353ef7bef248&X-Amz-SignedHeaders=host

Hi @vmajor

A type conversion error is happening in the XML parser when the byte count passes 2^31 on Windows which results in a negative byte index. Here’s a quick and dirty fix for you to use, assuming you can do a local build, while a more rigorous solution is worked out. It won’t get you past the 4Gb file size limit on Windows but it will load past the 2Gb point. I hope that helps.

vtkTypeInt64 vtkXMLParser::GetXMLByteIndex()
{
  XML_Parser parser = static_cast<XML_Parser>(this->Parser);
#ifdef _WIN32
  unsigned long result = XML_GetCurrentByteIndex(parser);
  return result;
#else
  return XML_GetCurrentByteIndex(parser);
#endif 
}
1 Like