Try running valgrind on the executable.<br><br><div class="gmail_quote">On Thu, Aug 9, 2012 at 5:05 AM, <span dir="ltr"><<a href="mailto:Robert.Atwood@diamond.ac.uk" target="_blank">Robert.Atwood@diamond.ac.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I get a memory corruption upon reading a file , though the same program has worked on a different file as input. The reader->Update() is called from inside a try..catch but this mechanism is not activated.<br>
I am not sure what is the easiest way to find out what the problem is!<br>
<br>
I tried building ITK with git pull yesterday<br>
Thanks for any advice!<br>
Robert<br>
<br>
Code section :<br>
<br>
<br>
177 reader->SetFileName (ctrl->infile);<br>
178 reader->ReleaseDataFlagOn();<br>
179 if (ctrl->verbose >= 1 ) std::cout << reader << std::endl;<br>
180 if (ctrl->verbose >=2){<br>
181 timestamp("starting the reader... ");<br>
182 }<br>
183<br>
184 try {<br>
185 reader->Update ();<br>
186 } catch (itk::ExceptionObject & exp) {<br>
187<br>
<br>
<br>
Output:<br>
<br>
ImageFileReader (0x66f54d0)<br>
RTTI typeinfo: itk::ImageFileReader<itk::Image<float, 3u>, itk::DefaultConvertPixelTraits<float> ><br>
Reference Count: 2<br>
Modified Time: 46<br>
Debug: Off<br>
Observers:<br>
none<br>
Inputs:<br>
FileName: (0x66fa120)<br>
No Required Input Names<br>
Outputs:<br>
Primary: (0x66f9920)<br>
NumberOfIndexedInputs: 0<br>
NumberOfRequiredInputs: 0<br>
NumberOfIndexedOutputs: 1<br>
NumberOfRequiredOutputs: 1<br>
Number Of Threads: 16<br>
ReleaseDataFlag: On<br>
ReleaseDataBeforeUpdateFlag: Off<br>
AbortGenerateData: Off<br>
Progress: 0<br>
Multithreader:<br>
RTTI typeinfo: itk::MultiThreader<br>
Reference Count: 1<br>
Modified Time: 30<br>
Debug: Off<br>
Observers:<br>
none<br>
Thread Count: 16<br>
Global Maximum Number Of Threads: 128<br>
Global Default Number Of Threads: 16<br>
ImageIO: (null)<br>
UserSpecifiedImageIO flag: 0<br>
m_UseStreaming: 1<br>
<br>
0.002900 1344502793.982344 0.002857 starting the reader...<br>
<br>
*** glibc detected *** /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca: malloc(): memory corruption: 0x00000000066fc480 ***<br>
======= Backtrace: =========<br>
/lib64/libc.so.6[0x3176e71a1e]<br>
/lib64/libc.so.6(__libc_malloc+0x6e)[0x3176e7374e]<br>
/lib64/libc.so.6[0x3176e6017a]<br>
/usr/lib64/libstdc++.so.6(_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei+0x54)[0x317bebbc94]<br>
/usr/lib64/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode+0x83)[0x317be6a583]<br>
/dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1(_ZN9MetaImage10ReadStreamEiPSt14basic_ifstreamIcSt11char_traitsIcEEbPv+0x818)[0x2b9a973c76a8]<br>
/dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1(_ZN9MetaImage4ReadEPKcbPv+0x16b)[0x2b9a973c2f2b]<br>
/dls_sw/apps/itk/itk-master/lib/libITKIOMeta-4.3.so.1(_ZN3itk11MetaImageIO4ReadEPv+0x1e2)[0x2b9a9b2edff2]<br>
/home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(_ZN3itk15ImageFileReaderINS_5ImageIfLj3EEENS_25DefaultConvertPixelTraitsIfEEE12GenerateDataEv+0xdce)[0x4a35a8]<br>
/dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1(_ZN3itk13ProcessObject16UpdateOutputDataEPNS_10DataObjectE+0xd3)[0x2b9a966acd03]<br>
/home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(_ZN3itk9ImageBaseILj3EE16UpdateOutputDataEv+0x6d)[0x485705]<br>
/home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(main+0x35a)[0x44c9fc]<br>
/lib64/libc.so.6(__libc_start_main+0xf4)[0x3176e1d994]<br>
/home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(_ZN3itk34PNGImageIOFactoryRegister__PrivateEv+0x61)[0x44bdb9]<br>
======= Memory map: ========<br>
00400000-004cf000 r-xp 00000000 00:13 53510401 /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca<br>
006ce000-006d8000 rw-p 000ce000 00:13 53510401 /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca<br>
062a1000-06852000 rw-p 062a1000 00:00 0 [heap]<br>
3176a00000-3176a1c000 r-xp 00000000 fd:00 3306410 /lib64/<a href="http://ld-2.5.so" target="_blank">ld-2.5.so</a><br>
3176c1c000-3176c1d000 r--p 0001c000 fd:00 3306410 /lib64/<a href="http://ld-2.5.so" target="_blank">ld-2.5.so</a><br>
3176c1d000-3176c1e000 rw-p 0001d000 fd:00 3306410 /lib64/<a href="http://ld-2.5.so" target="_blank">ld-2.5.so</a><br>
3176e00000-3176f4d000 r-xp 00000000 fd:00 3306582 /lib64/<a href="http://libc-2.5.so" target="_blank">libc-2.5.so</a><br>
3176f4d000-317714d000 ---p 0014d000 fd:00 3306582 /lib64/<a href="http://libc-2.5.so" target="_blank">libc-2.5.so</a><br>
317714d000-3177151000 r--p 0014d000 fd:00 3306582 /lib64/<a href="http://libc-2.5.so" target="_blank">libc-2.5.so</a><br>
3177151000-3177152000 rw-p 00151000 fd:00 3306582 /lib64/<a href="http://libc-2.5.so" target="_blank">libc-2.5.so</a><br>
3177152000-3177157000 rw-p <a href="tel:3177152000" value="+13177152000">3177152000</a> 00:00 0<br>
3177200000-3177202000 r-xp 00000000 fd:00 3306601 /lib64/<a href="http://libdl-2.5.so" target="_blank">libdl-2.5.so</a><br>
3177202000-3177402000 ---p 00002000 fd:00 3306601 /lib64/<a href="http://libdl-2.5.so" target="_blank">libdl-2.5.so</a><br>
3177402000-3177403000 r--p 00002000 fd:00 3306601 /lib64/<a href="http://libdl-2.5.so" target="_blank">libdl-2.5.so</a><br>
3177403000-3177404000 rw-p 00003000 fd:00 3306601 /lib64/<a href="http://libdl-2.5.so" target="_blank">libdl-2.5.so</a><br>
3177600000-3177682000 r-xp 00000000 fd:00 3306600 /lib64/<a href="http://libm-2.5.so" target="_blank">libm-2.5.so</a><br>
3177682000-3177881000 ---p 00082000 fd:00 3306600 /lib64/<a href="http://libm-2.5.so" target="_blank">libm-2.5.so</a><br>
3177881000-3177882000 r--p 00081000 fd:00 3306600 /lib64/<a href="http://libm-2.5.so" target="_blank">libm-2.5.so</a><br>
3177882000-3177883000 rw-p 00082000 fd:00 3306600 /lib64/<a href="http://libm-2.5.so" target="_blank">libm-2.5.so</a><br>
3177e00000-3177e16000 r-xp 00000000 fd:00 3306628 /lib64/<a href="http://libpthread-2.5.so" target="_blank">libpthread-2.5.so</a><br>
3177e16000-3178015000 ---p 00016000 fd:00 3306628 /lib64/<a href="http://libpthread-2.5.so" target="_blank">libpthread-2.5.so</a><br>
3178015000-3178016000 r--p 00015000 fd:00 3306628 /lib64/<a href="http://libpthread-2.5.so" target="_blank">libpthread-2.5.so</a><br>
3178016000-3178017000 rw-p 00016000 fd:00 3306628 /lib64/<a href="http://libpthread-2.5.so" target="_blank">libpthread-2.5.so</a><br>
3178017000-317801b000 rw-p <a href="tel:3178017000" value="+13178017000">3178017000</a> 00:00 0<br>
317b600000-317b60d000 r-xp 00000000 fd:00 3306608 /lib64/libgcc_s-4.1.2-20080825.so.1<br>
317b60d000-317b80d000 ---p 0000d000 fd:00 3306608 /lib64/libgcc_s-4.1.2-20080825.so.1<br>
317b80d000-317b80e000 rw-p 0000d000 fd:00 3306608 /lib64/libgcc_s-4.1.2-20080825.so.1<br>
317be00000-317bee6000 r-xp 00000000 fd:00 11229786 /usr/lib64/libstdc++.so.6.0.8<br>
317bee6000-317c0e5000 ---p 000e6000 fd:00 11229786 /usr/lib64/libstdc++.so.6.0.8<br>
317c0e5000-317c0eb000 r--p 000e5000 fd:00 11229786 /usr/lib64/libstdc++.so.6.0.8<br>
317c0eb000-317c0ee000 rw-p 000eb000 fd:00 11229786 /usr/lib64/libstdc++.so.6.0.8<br>
317c0ee000-317c100000 rw-p 317c0ee000 00:00 0<br>
2b9a95907000-2b9a95909000 rw-p 2b9a95907000 00:00 0<br>
2b9a95909000-2b9a9594a000 r-xp 00000000 00:1f 101777739 /dls_sw/apps/itk/itk-master/lib/libitksys-4.3.so.1<br>
2b9a9594a000-2b9a95b49000 ---p 00041000 00:1f 101777739 /dls_sw/apps/itk/itk-master/lib/libitksys-4.3.so.1<br>
2b9a95b49000-2b9a95b4b000 rw-p 00040000 00:1f 101777739 /dls_sw/apps/itk/itk-master/lib/libitksys-4.3.so.1<br>
2b9a95b4b000-2b9a95bb8000 r-xp 00000000 00:1f 105712941 /dls_sw/apps/itk/itk-master/lib/libitkvnl_algo-4.3.so.1<br>
2b9a95bb8000-2b9a95db8000 ---p 0006d000 00:1f 105712941 /dls_sw/apps/itk/itk-master/lib/libitkvnl_algo-4.3.so.1<br>
2b9a95db8000-2b9a95dba000 rw-p 0006d000 00:1f 105712941 /dls_sw/apps/itk/itk-master/lib/libitkvnl_algo-4.3.so.1<br>
2b9a95dba000-2b9a95dbb000 rw-p 2b9a95dba000 00:00 0<br>
2b9a95dbb000-2b9a96163000 r-xp 00000000 00:1f 102040246 /dls_sw/apps/itk/itk-master/lib/libitkvnl-4.3.so.1<br>
2b9a96163000-2b9a96362000 ---p 003a8000 00:1f 102040246 /dls_sw/apps/itk/itk-master/lib/libitkvnl-4.3.so.1<br>
2b9a96362000-2b9a9636b000 rw-p 003a7000 00:1f 102040246 /dls_sw/apps/itk/itk-master/lib/libitkvnl-4.3.so.1<br>
2b9a9636b000-2b9a9636c000 rw-p 2b9a9636b000 00:00 0<br>
2b9a9636c000-2b9a96450000 r-xp 00000000 00:1f 102040242 /dls_sw/apps/itk/itk-master/lib/libitkv3p_netlib-4.3.so.1<br>
2b9a96450000-2b9a9664f000 ---p 000e4000 00:1f 102040242 /dls_sw/apps/itk/itk-master/lib/libitkv3p_netlib-4.3.so.1<br>
2b9a9664f000-2b9a96651000 rw-p 000e3000 00:1f 102040242 /dls_sw/apps/itk/itk-master/lib/libitkv3p_netlib-4.3.so.1<br>
2b9a96651000-2b9a96652000 rw-p 2b9a96651000 00:00 0<br>
2b9a96652000-2b9a96704000 r-xp 00000000 00:1f 105712945 /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1<br>
2b9a96704000-2b9a96904000 ---p 000b2000 00:1f 105712945 /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1<br>
2b9a96904000-2b9a9690c000 rw-p 000b2000 00:1f 105712945 /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1<br>
2b9a9690c000-2b9a96920000 rw-p 2b9a9690c000 00:00 0<br>
2b9a96920000-2b9a96925000 r-xp 00000000 00:1f 105712947 /dls_sw/apps/itk/itk-master/lib/libitkNetlibSlatec-4.3.so.1<br>
2b9a96925000-2b9a96b24000 ---p 00005000 00:1f 105712947 /dls_sw/apps/itk/itk-master/lib/libitkNetlibSlatec-4.3.so.1<br>
2b9a96b24000-2b9a96b25000 rw-p 00004000 00:1f 105712947 /dls_sw/apps/itk/itk-master/lib/libitkNetlibSlatec-4.3.so.1<br>
2b9a96b25000-2b9a96b40000 r-xp 00000000 00:1f 105712949 /dls_sw/apps/itk/itk-master/lib/libITKStatistics-4.3.so.1<br>
2b9a96b40000-2b9a96d3f000 ---p 0001b000 00:1f 105712949 /dls_sw/apps/itk/itk-master/lib/libITKStatistics-4.3.so.1<br>
2b9a96d3f000-2b9a96d41000 rw-p 0001a000 00:1f 105712949 /dls_sw/apps/itk/itk-master/lib/libITKStatistics-4.3.so.1<br>
2b9a96d41000-2b9a96d6b000 r-xp 00000000 00:1f 105712951 /dls_sw/apps/itk/itk-master/lib/libITKIOImageBase-4.3.so.1<br>
2b9a96d6b000-2b9a96f6a000 ---p 0002a000 00:1f 105712951 /dls_sw/apps/itk/itk-master/lib/libITKIOImageBase-4.3.so.1<br>
2b9a96f6a000-2b9a96f6c000 rw-p 00029000 00:1f 105712951 /dls_sw/apps/itk/itk-master/lib/libITKIOImageBase-4.3.so.1<br>
2b9a96f6c000-2b9a96f6d000 rw-p 2b9a96f6c000 00:00 0<br>
2b9a96f6d000-2b9a96f71000 r-xp 00000000 00:1f 105712953 /dls_sw/apps/itk/itk-master/lib/libITKMesh-4.3.so.1<br>
2b9a96f71000-2b9a97170000 ---p 00004000 00:1f 105712953 /dls_sw/apps/itk/itk-master/lib/libITKMesh-4.3.so.1<br>
2b9a97170000-2b9a97171000 rw-p 00003000 00:1f 105712953 /dls_sw/apps/itk/itk-master/lib/libITKMesh-4.3.so.1<br>
2b9a97171000-2b9a97185000 r-xp 00000000 00:1f 168624136 /dls_sw/apps/itk/itk-master/lib/libitkzlib-4.3.so.1<br>
2b9a97185000-2b9a97384000 ---p 00014000 00:1f 168624136 /dls_sw/apps/itk/itk-master/lib/libitkzlib-4.3.so.1<br>
2b9a97384000-2b9a97385000 rw-p 00013000 00:1f 168624136 /dls_sw/apps/itk/itk-master/lib/libitkzlib-4.3.so.1<br>
2b9a97385000-2b9a9740e000 r-xp 00000000 00:1f 168624138 /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1<br>
2b9a9740e000-2b9a9760e000 ---p 00089000 00:1f 168624138 /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1<br>
2b9a9760e000-2b9a97611000 rw-p 00089000 00:1f 168624138 /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1<br>
2b9a97611000-2b9a97612000 rw-p 2b9a97611000 00:00 0<br>
2b9a97612000-2b9a9765a000 r-xp 00000000 00:1f 168624140 /dls_sw/apps/itk/itk-master/lib/libITKSpatialObjects-4.3.so.1<br>
2b9a9765a000-2b9a97859000 ---p 00048000 00:1f 168624140 /dls_sw/apps/itk/itk-master/lib/libITKSpatialObjects-4.3.so.1<br>
2b9a97859000-2b9a9785e000 rw-p 00047000 00:1f 168624140 /dls_sw/apps/itk/itk-master/lib/libITKSpatialObjects-4.3.so.1<br>
2b9a9785e000-2b9a9786a000 r-xp 00000000 00:1f 168624142 /dls_sw/apps/itk/itk-master/lib/libITKPath-4.3.so.1<br>
2b9a9786a000-2b9a97a6a000 ---p 0000c000 00:1f 168624142 /dls_sw/apps/itk/itk-master/lib/libITKPath-4.3.so.1<br>
2b9a97a6a000-2b9a97a6c000 rw-p 0000c000 00:1f 168624142 /dls_sw/apps/itk/itk-master/lib/libITKPath-4.3.so.1<br>
2b9a97a6c000-2b9a97a6d000 r-xp 00000000 00:1f 168624144 /dls_sw/apps/itk/itk-master/lib/libITKLabelMap-4.3.so.1<br>
2b9a97a6d000-2b9a97c6d000 ---p 00001000 00:1f 168624144 /dls_sw/apps/itk/itk-master/lib/libITKLabelMap-4.3.so.1<br>
2b9a97c6d000-2b9a97c6e000 rw-p 00001000 00:1f 168624144 /dls_sw/apps/itk/itk-master/lib/libITKLabelMap-4.3.so.1<br>
2b9a97c6e000-2b9a97c6f000 rw-p 2b9a97c6e000 00:00 0<br>
2b9a97c6f000-2b9a97c72000 r-xp 00000000 00:1f 168624146 /dls_sw/apps/itk/itk-master/lib/libITKQuadEdgeMesh-4.3.so.1<br>
2b9a97c72000-2b9a97e71000 ---p 00003000 00:1f 168624146 /dls_sw/apps/itk/itk-master/lib/libITKQuadEdgeMesh-4.3.so.1<br>
2b9a97e71000-2b9a97e72000 rw-p 00002000 00:1f 168624146 /dls_sw/apps/itk/itk-master/lib/libITKQuadEdgeMesh-4.3.so.1<br>
2b9a97e72000-2b9a97ed5000 r-xp 00000000 00:1f 168624148 /dls_sw/apps/itk/itk-master/lib/libITKOptimizers-4.3.so.1<br>
2b9a97ed5000-2b9a980d5000 ---p 00063000 00:1f 168624148 /dls_sw/apps/itk/itk-master/lib/libITKOptimizers-4.3.so.1<br>
2b9a980d5000-2b9a980da000 rw-p 00063000 00:1f 168624148 /dls_sw/apps/itk/itk-master/lib/libITKOptimizers-4.3.so.1<br>
2b9a980da000-2b9a980df000 r-xp 00000000 00:1f 168624150 /dls_sw/apps/itk/itk-master/lib/libITKPolynomials-4.3.so.1<br>
2b9a980df000-2b9a982de000 ---p 00005000 00:1f 168624150 /dls_sw/apps/itk/itk-master/lib/libITKPolynomials-4.3.so.1<br>
2b9a982de000-2b9a982df000 rw-p 00004000 00:1f 168624150 /dls_sw/apps/itk/itk-master/lib/libITKPolynomials-4.3.so.1<br>
2b9a982df000-2b9a982e0000 rw-p 2b9a982df000 00:00 0<br>
2b9a982e0000-2b9a982e3000 r-xp 00000000 00:1f 168624152 /dls_sw/apps/itk/itk-master/lib/libITKBiasCorrection-4.3.so.1<br>
2b9a982e3000-2b9a9Aborted<br>
[kny48981@i12-ws011 reduced]$<br>
____________________<br>
<br>
Dr. Robert C. Atwood<br>
Senior Support Scientist<br>
Beamline I12-JEEP<br>
The Joint Engineering and Environmental Processing Beamline<br>
Diamond Light Source<br>
The Harwell Science and Innovation Campus<br>
Didcot,OXON<br>
OX11 0DE<br>
<a href="tel:%2B44%20%280%29%201235%20778%20670" value="+441235778670">+44 (0) 1235 778 670</a><br>
<br>
<br>
<br>
<br>
--<br>
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.<br>
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.<br>
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.<br>
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom<br>
<br>
<br>
<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>