[Insight-users] 2GB VTK IO limit

Sean McBride sean at rogue-research.com
Fri Oct 10 11:05:10 EDT 2008


On 10/9/08 9:36 PM, Bradley Lowekamp said:

>	Specifically the io bug I have found can be illustrated in the  
>following with an apple x86_64:
>
>int main(void) {
>   std::streamsize large = std::streamsize(2)*1024*1024*1024;
>   char *foo = new char[large];
>   std::cout << "ptr size: " << sizeof(void*) << " streamsize:" <<  
>sizeof(std::streamsize) << " " << large << std::endl;
>   std::ofstream file("foo.dat", std::ofstream::binary);
>   file.write((char *)foo, large);
>   std::cout << "io good: " << file.good() << std::endl;
>   file.close();
>   return 0;
>};
>
>
>with the following output:
>
>ptr size: 8 streamsize:8 2147483648
>Filesize limit exceeded
>
>An exception is thrown and size for foo.dat is 0.

I don't seem to get an exception, but it prints "Filesize limit
exceeded" on stdout.  If I make 'large' 1 smaller it works.  Very
disappointing.

I suggest you file a bug with Apple at:
<https://bugreport.apple.com>

BTW, are you aware of gcc's "-Wshorten-64-to-32" warning flag?  It is
sadly only in Apple's fork of gcc, but catches a great many problems
when moving code from 32 to 64 bit.  You might want to try building ITK
with it if you suspect a 64 to 32 bit truncation problem.  (Last I
checked, it causes hundreds of warnings in VTK, so none of my dashboards
have it on.  Luis and I hacked away at a few once, but the project has
not advanced recently.)

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the Insight-users mailing list