[Insight-users] Crash not caught by exception upon reading

Bill Lorensen bill.lorensen at gmail.com
Thu Aug 9 10:05:05 EDT 2012


Try running valgrind on the executable.

On Thu, Aug 9, 2012 at 5:05 AM, <Robert.Atwood at diamond.ac.uk> wrote:

> Hi,
> 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.
> I am not sure what is  the easiest way to find out what the problem is!
>
> I tried building ITK with git pull yesterday
> Thanks for any advice!
> Robert
>
> Code section :
>
>
> 177   reader->SetFileName (ctrl->infile);
> 178   reader->ReleaseDataFlagOn();
> 179   if (ctrl->verbose >= 1 ) std::cout << reader << std::endl;
> 180   if (ctrl->verbose >=2){
> 181      timestamp("starting the reader... ");
> 182   }
> 183
> 184   try {
> 185     reader->Update ();
> 186   } catch (itk::ExceptionObject & exp) {
> 187
>
>
> Output:
>
> ImageFileReader (0x66f54d0)
>   RTTI typeinfo:   itk::ImageFileReader<itk::Image<float, 3u>,
> itk::DefaultConvertPixelTraits<float> >
>   Reference Count: 2
>   Modified Time: 46
>   Debug: Off
>   Observers:
>     none
>   Inputs:
>     FileName: (0x66fa120)
>   No Required Input Names
>   Outputs:
>     Primary: (0x66f9920)
>   NumberOfIndexedInputs: 0
>   NumberOfRequiredInputs: 0
>   NumberOfIndexedOutputs: 1
>   NumberOfRequiredOutputs: 1
>   Number Of Threads: 16
>   ReleaseDataFlag: On
>   ReleaseDataBeforeUpdateFlag: Off
>   AbortGenerateData: Off
>   Progress: 0
>   Multithreader:
>     RTTI typeinfo:   itk::MultiThreader
>     Reference Count: 1
>     Modified Time: 30
>     Debug: Off
>     Observers:
>       none
>     Thread Count: 16
>     Global Maximum Number Of Threads: 128
>     Global Default Number Of Threads: 16
>   ImageIO: (null)
>   UserSpecifiedImageIO flag: 0
>   m_UseStreaming: 1
>
> 0.002900 1344502793.982344 0.002857 starting the reader...
>
> *** glibc detected ***
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca: malloc():
> memory corruption: 0x00000000066fc480 ***
> ======= Backtrace: =========
> /lib64/libc.so.6[0x3176e71a1e]
> /lib64/libc.so.6(__libc_malloc+0x6e)[0x3176e7374e]
> /lib64/libc.so.6[0x3176e6017a]
>
> /usr/lib64/libstdc++.so.6(_ZNSt12__basic_fileIcE4openEPKcSt13_Ios_Openmodei+0x54)[0x317bebbc94]
>
> /usr/lib64/libstdc++.so.6(_ZNSt13basic_filebufIcSt11char_traitsIcEE4openEPKcSt13_Ios_Openmode+0x83)[0x317be6a583]
>
> /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1(_ZN9MetaImage10ReadStreamEiPSt14basic_ifstreamIcSt11char_traitsIcEEbPv+0x818)[0x2b9a973c76a8]
>
> /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1(_ZN9MetaImage4ReadEPKcbPv+0x16b)[0x2b9a973c2f2b]
>
> /dls_sw/apps/itk/itk-master/lib/libITKIOMeta-4.3.so.1(_ZN3itk11MetaImageIO4ReadEPv+0x1e2)[0x2b9a9b2edff2]
>
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(_ZN3itk15ImageFileReaderINS_5ImageIfLj3EEENS_25DefaultConvertPixelTraitsIfEEE12GenerateDataEv+0xdce)[0x4a35a8]
>
> /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1(_ZN3itk13ProcessObject16UpdateOutputDataEPNS_10DataObjectE+0xd3)[0x2b9a966acd03]
>
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(_ZN3itk9ImageBaseILj3EE16UpdateOutputDataEv+0x6d)[0x485705]
>
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(main+0x35a)[0x44c9fc]
> /lib64/libc.so.6(__libc_start_main+0xf4)[0x3176e1d994]
>
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca(_ZN3itk34PNGImageIOFactoryRegister__PrivateEv+0x61)[0x44bdb9]
> ======= Memory map: ========
> 00400000-004cf000 r-xp 00000000 00:13 53510401
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca
> 006ce000-006d8000 rw-p 000ce000 00:13 53510401
> /home/kny48981/progs/itk_progs/build_master/itk_mreduce_rca
> 062a1000-06852000 rw-p 062a1000 00:00 0
>  [heap]
> 3176a00000-3176a1c000 r-xp 00000000 fd:00 3306410
>  /lib64/ld-2.5.so
> 3176c1c000-3176c1d000 r--p 0001c000 fd:00 3306410
>  /lib64/ld-2.5.so
> 3176c1d000-3176c1e000 rw-p 0001d000 fd:00 3306410
>  /lib64/ld-2.5.so
> 3176e00000-3176f4d000 r-xp 00000000 fd:00 3306582
>  /lib64/libc-2.5.so
> 3176f4d000-317714d000 ---p 0014d000 fd:00 3306582
>  /lib64/libc-2.5.so
> 317714d000-3177151000 r--p 0014d000 fd:00 3306582
>  /lib64/libc-2.5.so
> 3177151000-3177152000 rw-p 00151000 fd:00 3306582
>  /lib64/libc-2.5.so
> 3177152000-3177157000 rw-p 3177152000 00:00 0
> 3177200000-3177202000 r-xp 00000000 fd:00 3306601
>  /lib64/libdl-2.5.so
> 3177202000-3177402000 ---p 00002000 fd:00 3306601
>  /lib64/libdl-2.5.so
> 3177402000-3177403000 r--p 00002000 fd:00 3306601
>  /lib64/libdl-2.5.so
> 3177403000-3177404000 rw-p 00003000 fd:00 3306601
>  /lib64/libdl-2.5.so
> 3177600000-3177682000 r-xp 00000000 fd:00 3306600
>  /lib64/libm-2.5.so
> 3177682000-3177881000 ---p 00082000 fd:00 3306600
>  /lib64/libm-2.5.so
> 3177881000-3177882000 r--p 00081000 fd:00 3306600
>  /lib64/libm-2.5.so
> 3177882000-3177883000 rw-p 00082000 fd:00 3306600
>  /lib64/libm-2.5.so
> 3177e00000-3177e16000 r-xp 00000000 fd:00 3306628
>  /lib64/libpthread-2.5.so
> 3177e16000-3178015000 ---p 00016000 fd:00 3306628
>  /lib64/libpthread-2.5.so
> 3178015000-3178016000 r--p 00015000 fd:00 3306628
>  /lib64/libpthread-2.5.so
> 3178016000-3178017000 rw-p 00016000 fd:00 3306628
>  /lib64/libpthread-2.5.so
> 3178017000-317801b000 rw-p 3178017000 00:00 0
> 317b600000-317b60d000 r-xp 00000000 fd:00 3306608
>  /lib64/libgcc_s-4.1.2-20080825.so.1
> 317b60d000-317b80d000 ---p 0000d000 fd:00 3306608
>  /lib64/libgcc_s-4.1.2-20080825.so.1
> 317b80d000-317b80e000 rw-p 0000d000 fd:00 3306608
>  /lib64/libgcc_s-4.1.2-20080825.so.1
> 317be00000-317bee6000 r-xp 00000000 fd:00 11229786
> /usr/lib64/libstdc++.so.6.0.8
> 317bee6000-317c0e5000 ---p 000e6000 fd:00 11229786
> /usr/lib64/libstdc++.so.6.0.8
> 317c0e5000-317c0eb000 r--p 000e5000 fd:00 11229786
> /usr/lib64/libstdc++.so.6.0.8
> 317c0eb000-317c0ee000 rw-p 000eb000 fd:00 11229786
> /usr/lib64/libstdc++.so.6.0.8
> 317c0ee000-317c100000 rw-p 317c0ee000 00:00 0
> 2b9a95907000-2b9a95909000 rw-p 2b9a95907000 00:00 0
> 2b9a95909000-2b9a9594a000 r-xp 00000000 00:1f 101777739
>  /dls_sw/apps/itk/itk-master/lib/libitksys-4.3.so.1
> 2b9a9594a000-2b9a95b49000 ---p 00041000 00:1f 101777739
>  /dls_sw/apps/itk/itk-master/lib/libitksys-4.3.so.1
> 2b9a95b49000-2b9a95b4b000 rw-p 00040000 00:1f 101777739
>  /dls_sw/apps/itk/itk-master/lib/libitksys-4.3.so.1
> 2b9a95b4b000-2b9a95bb8000 r-xp 00000000 00:1f 105712941
>  /dls_sw/apps/itk/itk-master/lib/libitkvnl_algo-4.3.so.1
> 2b9a95bb8000-2b9a95db8000 ---p 0006d000 00:1f 105712941
>  /dls_sw/apps/itk/itk-master/lib/libitkvnl_algo-4.3.so.1
> 2b9a95db8000-2b9a95dba000 rw-p 0006d000 00:1f 105712941
>  /dls_sw/apps/itk/itk-master/lib/libitkvnl_algo-4.3.so.1
> 2b9a95dba000-2b9a95dbb000 rw-p 2b9a95dba000 00:00 0
> 2b9a95dbb000-2b9a96163000 r-xp 00000000 00:1f 102040246
>  /dls_sw/apps/itk/itk-master/lib/libitkvnl-4.3.so.1
> 2b9a96163000-2b9a96362000 ---p 003a8000 00:1f 102040246
>  /dls_sw/apps/itk/itk-master/lib/libitkvnl-4.3.so.1
> 2b9a96362000-2b9a9636b000 rw-p 003a7000 00:1f 102040246
>  /dls_sw/apps/itk/itk-master/lib/libitkvnl-4.3.so.1
> 2b9a9636b000-2b9a9636c000 rw-p 2b9a9636b000 00:00 0
> 2b9a9636c000-2b9a96450000 r-xp 00000000 00:1f 102040242
>  /dls_sw/apps/itk/itk-master/lib/libitkv3p_netlib-4.3.so.1
> 2b9a96450000-2b9a9664f000 ---p 000e4000 00:1f 102040242
>  /dls_sw/apps/itk/itk-master/lib/libitkv3p_netlib-4.3.so.1
> 2b9a9664f000-2b9a96651000 rw-p 000e3000 00:1f 102040242
>  /dls_sw/apps/itk/itk-master/lib/libitkv3p_netlib-4.3.so.1
> 2b9a96651000-2b9a96652000 rw-p 2b9a96651000 00:00 0
> 2b9a96652000-2b9a96704000 r-xp 00000000 00:1f 105712945
>  /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1
> 2b9a96704000-2b9a96904000 ---p 000b2000 00:1f 105712945
>  /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1
> 2b9a96904000-2b9a9690c000 rw-p 000b2000 00:1f 105712945
>  /dls_sw/apps/itk/itk-master/lib/libITKCommon-4.3.so.1
> 2b9a9690c000-2b9a96920000 rw-p 2b9a9690c000 00:00 0
> 2b9a96920000-2b9a96925000 r-xp 00000000 00:1f 105712947
>  /dls_sw/apps/itk/itk-master/lib/libitkNetlibSlatec-4.3.so.1
> 2b9a96925000-2b9a96b24000 ---p 00005000 00:1f 105712947
>  /dls_sw/apps/itk/itk-master/lib/libitkNetlibSlatec-4.3.so.1
> 2b9a96b24000-2b9a96b25000 rw-p 00004000 00:1f 105712947
>  /dls_sw/apps/itk/itk-master/lib/libitkNetlibSlatec-4.3.so.1
> 2b9a96b25000-2b9a96b40000 r-xp 00000000 00:1f 105712949
>  /dls_sw/apps/itk/itk-master/lib/libITKStatistics-4.3.so.1
> 2b9a96b40000-2b9a96d3f000 ---p 0001b000 00:1f 105712949
>  /dls_sw/apps/itk/itk-master/lib/libITKStatistics-4.3.so.1
> 2b9a96d3f000-2b9a96d41000 rw-p 0001a000 00:1f 105712949
>  /dls_sw/apps/itk/itk-master/lib/libITKStatistics-4.3.so.1
> 2b9a96d41000-2b9a96d6b000 r-xp 00000000 00:1f 105712951
>  /dls_sw/apps/itk/itk-master/lib/libITKIOImageBase-4.3.so.1
> 2b9a96d6b000-2b9a96f6a000 ---p 0002a000 00:1f 105712951
>  /dls_sw/apps/itk/itk-master/lib/libITKIOImageBase-4.3.so.1
> 2b9a96f6a000-2b9a96f6c000 rw-p 00029000 00:1f 105712951
>  /dls_sw/apps/itk/itk-master/lib/libITKIOImageBase-4.3.so.1
> 2b9a96f6c000-2b9a96f6d000 rw-p 2b9a96f6c000 00:00 0
> 2b9a96f6d000-2b9a96f71000 r-xp 00000000 00:1f 105712953
>  /dls_sw/apps/itk/itk-master/lib/libITKMesh-4.3.so.1
> 2b9a96f71000-2b9a97170000 ---p 00004000 00:1f 105712953
>  /dls_sw/apps/itk/itk-master/lib/libITKMesh-4.3.so.1
> 2b9a97170000-2b9a97171000 rw-p 00003000 00:1f 105712953
>  /dls_sw/apps/itk/itk-master/lib/libITKMesh-4.3.so.1
> 2b9a97171000-2b9a97185000 r-xp 00000000 00:1f 168624136
>  /dls_sw/apps/itk/itk-master/lib/libitkzlib-4.3.so.1
> 2b9a97185000-2b9a97384000 ---p 00014000 00:1f 168624136
>  /dls_sw/apps/itk/itk-master/lib/libitkzlib-4.3.so.1
> 2b9a97384000-2b9a97385000 rw-p 00013000 00:1f 168624136
>  /dls_sw/apps/itk/itk-master/lib/libitkzlib-4.3.so.1
> 2b9a97385000-2b9a9740e000 r-xp 00000000 00:1f 168624138
>  /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1
> 2b9a9740e000-2b9a9760e000 ---p 00089000 00:1f 168624138
>  /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1
> 2b9a9760e000-2b9a97611000 rw-p 00089000 00:1f 168624138
>  /dls_sw/apps/itk/itk-master/lib/libITKMetaIO-4.3.so.1
> 2b9a97611000-2b9a97612000 rw-p 2b9a97611000 00:00 0
> 2b9a97612000-2b9a9765a000 r-xp 00000000 00:1f 168624140
>  /dls_sw/apps/itk/itk-master/lib/libITKSpatialObjects-4.3.so.1
> 2b9a9765a000-2b9a97859000 ---p 00048000 00:1f 168624140
>  /dls_sw/apps/itk/itk-master/lib/libITKSpatialObjects-4.3.so.1
> 2b9a97859000-2b9a9785e000 rw-p 00047000 00:1f 168624140
>  /dls_sw/apps/itk/itk-master/lib/libITKSpatialObjects-4.3.so.1
> 2b9a9785e000-2b9a9786a000 r-xp 00000000 00:1f 168624142
>  /dls_sw/apps/itk/itk-master/lib/libITKPath-4.3.so.1
> 2b9a9786a000-2b9a97a6a000 ---p 0000c000 00:1f 168624142
>  /dls_sw/apps/itk/itk-master/lib/libITKPath-4.3.so.1
> 2b9a97a6a000-2b9a97a6c000 rw-p 0000c000 00:1f 168624142
>  /dls_sw/apps/itk/itk-master/lib/libITKPath-4.3.so.1
> 2b9a97a6c000-2b9a97a6d000 r-xp 00000000 00:1f 168624144
>  /dls_sw/apps/itk/itk-master/lib/libITKLabelMap-4.3.so.1
> 2b9a97a6d000-2b9a97c6d000 ---p 00001000 00:1f 168624144
>  /dls_sw/apps/itk/itk-master/lib/libITKLabelMap-4.3.so.1
> 2b9a97c6d000-2b9a97c6e000 rw-p 00001000 00:1f 168624144
>  /dls_sw/apps/itk/itk-master/lib/libITKLabelMap-4.3.so.1
> 2b9a97c6e000-2b9a97c6f000 rw-p 2b9a97c6e000 00:00 0
> 2b9a97c6f000-2b9a97c72000 r-xp 00000000 00:1f 168624146
>  /dls_sw/apps/itk/itk-master/lib/libITKQuadEdgeMesh-4.3.so.1
> 2b9a97c72000-2b9a97e71000 ---p 00003000 00:1f 168624146
>  /dls_sw/apps/itk/itk-master/lib/libITKQuadEdgeMesh-4.3.so.1
> 2b9a97e71000-2b9a97e72000 rw-p 00002000 00:1f 168624146
>  /dls_sw/apps/itk/itk-master/lib/libITKQuadEdgeMesh-4.3.so.1
> 2b9a97e72000-2b9a97ed5000 r-xp 00000000 00:1f 168624148
>  /dls_sw/apps/itk/itk-master/lib/libITKOptimizers-4.3.so.1
> 2b9a97ed5000-2b9a980d5000 ---p 00063000 00:1f 168624148
>  /dls_sw/apps/itk/itk-master/lib/libITKOptimizers-4.3.so.1
> 2b9a980d5000-2b9a980da000 rw-p 00063000 00:1f 168624148
>  /dls_sw/apps/itk/itk-master/lib/libITKOptimizers-4.3.so.1
> 2b9a980da000-2b9a980df000 r-xp 00000000 00:1f 168624150
>  /dls_sw/apps/itk/itk-master/lib/libITKPolynomials-4.3.so.1
> 2b9a980df000-2b9a982de000 ---p 00005000 00:1f 168624150
>  /dls_sw/apps/itk/itk-master/lib/libITKPolynomials-4.3.so.1
> 2b9a982de000-2b9a982df000 rw-p 00004000 00:1f 168624150
>  /dls_sw/apps/itk/itk-master/lib/libITKPolynomials-4.3.so.1
> 2b9a982df000-2b9a982e0000 rw-p 2b9a982df000 00:00 0
> 2b9a982e0000-2b9a982e3000 r-xp 00000000 00:1f 168624152
>  /dls_sw/apps/itk/itk-master/lib/libITKBiasCorrection-4.3.so.1
> 2b9a982e3000-2b9a9Aborted
> [kny48981 at i12-ws011 reduced]$
>   ____________________
>
>   Dr. Robert C. Atwood
>   Senior Support Scientist
>   Beamline I12-JEEP
>   The Joint Engineering and Environmental Processing Beamline
>   Diamond Light Source
>   The Harwell Science and Innovation Campus
>   Didcot,OXON
>   OX11 0DE
>   +44 (0) 1235 778 670
>
>
>
>
> --
> 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.
> Any opinions expressed within this e-mail are those of the individual and
> not necessarily of Diamond Light Source Ltd.
> 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.
> 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
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>



-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120809/fee7e6ee/attachment.htm>


More information about the Insight-users mailing list