[Insight-users] Resampling 64-bit crash

Atwood, Robert C r.atwood at imperial.ac.uk
Thu Feb 15 06:37:20 EST 2007


> What is the result of sizeof(size_t) and sizeof(ptrdiff_t)?
> (Both types are from <cstddef> header.)

My results: 8 for both. Some details of compiler/system below.
Hope it helps. Allocation appears to work but file i/o (.mhd or .hdr so
far tested) does not, for such large files.
Hope it helps find the problems. 

Many thanks,
Robert

 
[rcatwood at mt-xe04 testbig]$ cat > testsize.cxx
#include <cstddef>
#include <iostream>
int main(){
std::cout << sizeof(size_t) << std::endl;
std::cout << sizeof(ptrdiff_t) << std::endl;
}
[rcatwood at mt-xe04 testbig]$ c++ testsize.cxx
[rcatwood at mt-xe04 testbig]$ ./a.out
8
8


[rcatwood at mt-xe04 testbig]$ c++ --version
c++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

[rcatwood at mt-xe04 testbig]$ cat /proc/version
Linux version 2.6.9-42.0.8.ELsmp
(brewbuilder at ls20-bc1-14.build.redhat.com) (gcc version 3.4.6 20060404
(Red Hat 3.4.6-3)) #1 SMP Tue Jan 23 12:49:51 EST 2007
[rcatwood at mt-xe04 testbig]


[rcatwood at mt-xe04 testbig]$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model  : 33
model name : Dual Core AMD Opteron(tm) Processor 270
stepping  : 2
cpu MHz   : 1994.714
cache size : 1024 KB
physical id  : 0
siblings  : 2
core id   : 0
cpu cores : 2
fpu  : yes
fpu_exception  : yes
cpuid level  : 1
wp   : yes
flags  : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext lm 3dnowext
3dnow pni
bogomips  : 3992.00
TLB size  : 1088 4K pages
clflush size : 64
cache_alignment : 64
address sizes  : 40 bits physical, 48 bits virtual
power management: ts fid vid ttp

... And so on ...


> -----Original Message-----
> From: insight-users-bounces+r.atwood=imperial.ac.uk at itk.org 
> [mailto:insight-users-bounces+r.atwood=imperial.ac.uk at itk.org]
>  On Behalf Of Peter Cech
> Sent: 15 February 2007 11:25
> To: Florian Pierron
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] Resampling 64-bit crash
> 
> On Thu, Feb 15, 2007 at 10:12:25 +0000, Florian Pierron wrote:
> > Hi Robert,
> > 
> > Thank you for your tests.
> > 
> > I think I found the problem. I did a smaller test where I 
> only try to 
> > allocate an image of 5 GB:
> > 
> > **********
> >  const     unsigned int   Dimension = 2;
> >  typedef   unsigned char  InputPixelType;
> >  typedef   unsigned char  OutputPixelType;
> >  typedef itk::Image< InputPixelType,  Dimension >   InputImageType;
> >  typedef itk::Image< OutputPixelType, Dimension >   OutputImageType;
> > 
> >  InputImageType::Pointer myImage = InputImageType::New ();
> > 
> >  InputImageType::IndexType index = {{0, 0}};
> >  InputImageType::SizeType  size;
> > 
> >  size[0] = 5 * 1000 * 1000;
> >  size[1] = 1 * 1000;
> > 
> >  InputImageType::RegionType region;
> >  region.SetIndex (index);
> >  region.SetSize (size);
> >  myImage->SetRegions (region);
> >  myImage->Allocate ();
> > **********
> > 
> > And here is my comments:
> > 1) On my computer, sizeof (long) = 4 bytes. (Is there a way 
> to tell the 
> > compiler to make it 8 bytes?)
> 
> What is the result of sizeof(size_t) and sizeof(ptrdiff_t)?
> (Both types are from <cstddef> header.)
> 
> Regards,
> Peter
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list