[Insight-developers] How to run the tests: itkGDCMImageIOTest3

Luis Ibanez luis.ibanez at kitware.com
Mon Mar 7 19:51:23 EST 2011


Hi  Mark


On Mon, Mar 7, 2011 at 7:11 PM, Mark Roden <mmroden at gmail.com> wrote:
> Hi Luis,
>
> Wow, you think using an IDE slows down development, and you have to go
> through all of this to debug something?


I ran this in a debugger a week ago,
and it took me five minutes to do so
including finding the line of code in
which the code crashes.

You have been struggling with it for
several days and still have not run it....

I would call that "evidence".       :-)


but that's fine,
we all develop with our poison of choice...


> I think you and I need to
> discuss how to use IDE tools over a beer at the next conference.

It is a deal !


> Something about hitting 'f5' and just having it work is pretty sweet.
> Especially if that test is hardcoded somewhere using relative paths,
> which definitely looks like a possibility if the test can be run from
> the command line directly.
>


That's what the middle mouse button is for    :-)


> In any event, when I run the program, I get:
>
> Starting program:
> /Users/mmroden/Documents/src/itk/itk-build-unix/bin/IOCxxTests
> "itkGDCMImageIOTest"
> "/Users/mmroden/Documents/src/itk/ITK/Testing/Data/Input/012345.002.050"
> "/Users/mmroden/Documents/src/itk/itk-build-unix/Testing/Temporary/itkGDCMImageIOTest3.dcm"
> "/Users/mmroden/Documents/src/itk/itk-build-unix/Testing/Temporary/itkGDCMImageIOTest3.png"
> "/Users/mmroden/Documents/src/itk/itk-build-unix/Testing/Temporary/itkGDCMRescaleImageIOTest3.dcm"
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000050
> 0x0000000100740d85 in gdcm::JPEGCodec::Decode ()
>
> That's a very different stack trace than what you were reporting.
>


Well,
that's not a stack trace.

You need to type "backtrace" or "bt" inside gdb
after the program crashes, to see the real stack trace.


> I'm going to wrestle with this a bit more, but this just hurts.


You need to put a break point in the call of that function,
and you will see that it calls itself in a loop.


> there no way to have a direct command line application that a) reads
> in whatever files are used by the ctest app so that I don't have to
> manually enter all the command line stuff (all it is is another
> opportunity for error) and b) let's me trace right in there?  Maybe
> IDE development has made me soft by thinking I could debug something
> in ten minutes or less :)
>

The fastest way to debug this will be to take the test
out of the test driver, write a CMakeList.txt file for it,
and run it locally with a copy of the input DICOM file.

That will take less than ten minutes.


     Luis


More information about the Insight-developers mailing list