[Insight-users] ImageSeriesReader memory corruption

Alberto Bert bert at isiosf.isi.it
Thu Feb 15 14:34:46 EST 2007


Hi all,

during my program I need to read a series of slices into a 3D itk
image, and I've tryed to use ImageSeriesReader.
If the original slices are in DICOM, there's no problem, but if
they're analyze or nifti I cannot read them.

I use NumericSeriesFileNames to generate the file names, and those
(printed out) seem to be OK. But when I update the reader, I get a
long memory corruption message (see the end of the emaill). The
program, if executed in debug, it aborts with the following message:

free(): invalid next size (fast): ...

and I noticed that (by debugging) in the reader filter the starting
filename is correct, but the last one is missing, and there's this
message at its place:

0x48 <Address 0x48 out of bounds>

Then I tried a simple program of the itk examples,
ImageSeriesReadWrite.cxx, just modifying the type of the read file
(from png to nifti), to make it able to read my slices, and it aborts
just as my original program.

The nifti slice files seems to be OK, when read by imagej.

I searched in the list, but I couldn't find anything about memory
problems with ImageSeriesReader reported.

I hope you can help me,
thank you very much,
bye,
Alberto

Error message:

*** glibc detected *** /home/bert/src/test/ImageSeriesReadWrite:
malloc(): memory corruption: 0x08415158 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7dc21cd]
/lib/tls/i686/cmov/libc.so.6(malloc+0x7f)[0xb7dc383f]
/usr/lib/libstdc++.so.6(_Znwj+0x27)[0xb7f4c4b7]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep9_S_createEjjRKSaIcE+0x6b)[0xb7f2787b]
/usr/lib/libstdc++.so.6[0xb7f28a65]
/usr/lib/libstdc++.so.6(_ZNSsC1EPKcRKSaIcE+0x47)[0xb7f28c17]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk19EncapsulateMetaDataISsEEvRNS_18MetaDataDictionaryEPKcRKT_+0x22)[0x8135b72]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk12NiftiImageIO20ReadImageInformationEv+0xc44)[0x81341e4]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk15ImageFileReaderINS_5ImageIhLj3EEENS_25DefaultConvertPixelTraitsIhEEE25GenerateOutputInformationEv+0x795)[0x80cf705]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk13ProcessObject23UpdateOutputInformationEv+0xde)[0x80e8dfe]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk17ImageSeriesReaderINS_5ImageIhLj3EEEE25GenerateOutputInformationEv+0x19e)[0x80d4154]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk13ProcessObject23UpdateOutputInformationEv+0xde)[0x80e8dfe]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk13ProcessObject27UpdateLargestPossibleRegionEv+0x1a)[0x80e8e3a]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk15ImageFileWriterINS_5ImageIhLj3EEEE5WriteEv+0x1035)[0x80d66b9]
/home/bert/src/test/ImageSeriesReadWrite(_ZN3itk15ImageFileWriterINS_5ImageIhLj3EEEE6UpdateEv+0x1a)[0x80b783e]
/home/bert/src/test/ImageSeriesReadWrite(main+0x205)[0x80b7397]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xdc)[0xb7d708cc]
/home/bert/src/test/ImageSeriesReadWrite(__gxx_personality_v0+0x141)[0x80b7061]
======= Memory map: ========
08048000-0837f000 r-xp 00000000 08:09 221914
/home/bert/src/test/ImageSeriesReadWrite
0837f000-08395000 rw-p 00336000 08:09 221914
/home/bert/src/test/ImageSeriesReadWrite
08395000-0843b000 rw-p 08395000 00:00 0          [heap]
b7c00000-b7c21000 rw-p b7c00000 00:00 0
b7c21000-b7d00000 ---p b7c21000 00:00 0
b7d59000-b7d5b000 rw-p b7d59000 00:00 0
b7d5b000-b7e88000 r-xp 00000000 08:05 622600     
/lib/tls/i686/cmov/libc-2.4.so
b7e88000-b7e8a000 r--p 0012c000 08:05 622600     
/lib/tls/i686/cmov/libc-2.4.so
b7e8a000-b7e8c000 rw-p 0012e000 08:05 622600     
/lib/tls/i686/cmov/libc-2.4.so
b7e8c000-b7e8f000 rw-p b7e8c000 00:00 0
b7e8f000-b7e99000 r-xp 00000000 08:05 593257     /lib/libgcc_s.so.1
b7e99000-b7e9a000 rw-p 00009000 08:05 593257     /lib/libgcc_s.so.1
b7e9a000-b7f6e000 r-xp 00000000 08:05 133815     
/usr/lib/libstdc++.so.6.0.8
b7f6e000-b7f71000 r--p 000d4000 08:05 133815     
/usr/lib/libstdc++.so.6.0.8
b7f71000-b7f73000 rw-p 000d7000 08:05 133815     
/usr/lib/libstdc++.so.6.0.8
b7f73000-b7f79000 rw-p b7f73000 00:00 0
b7f79000-b7f9d000 r-xp 00000000 08:05 622604     
/lib/tls/i686/cmov/libm-2.4.so
b7f9d000-b7f9f000 rw-p 00023000 08:05 622604     
/lib/tls/i686/cmov/libm-2.4.so
b7f9f000-b7fa0000 rw-p b7f9f000 00:00 0
b7fa0000-b7fa2000 r-xp 00000000 08:05 622603     
/lib/tls/i686/cmov/libdl-2.4.so
b7fa2000-b7fa4000 rw-p 00001000 08:05 622603     
/lib/tls/i686/cmov/libdl-2.4.so
b7fa4000-b7fb3000 r-xp 00000000 08:05 622617
/lib/tls/i686/cmov/libpthread-2.4.so
b7fb3000-b7fb5000 rw-p 0000f000 08:05 622617
/lib/tls/i686/cmov/libpthread-2.4.so
b7fb5000-b7fb7000 rw-p b7fb5000 00:00 0
b7fc9000-b7fcb000 rw-p b7fc9000 00:00 0
b7fcb000-b7fe4000 r-xp 00000000 08:05 589903     /lib/ld-2.4.so
b7fe4000-b7fe6000 rw-p 00018000 08:05 589903     /lib/ld-2.4.so
bfad6000-bfaeb000 rw-p bfad6000 00:00 0          [stack]
ffffe000-fffff000 ---p 00000000 00:00 0          [vdso]
Aborted




More information about the Insight-users mailing list