[Insight-developers] Help to debug on LInux64 and Mac 10.5

Bill Lorensen bill.lorensen at gmail.com
Thu Dec 20 13:52:08 EST 2007


Can you add some output to the Algorithms/itkStructHashFunction.h to
std::cout the key, len and hash? Then run the Review test.

Thanks,

Bill


On Dec 20, 2007 1:44 PM, Sean McBride <sean at rogue-research.com> wrote:

> On 12/20/07 8:46 AM, Bill Lorensen said:
>
> >It looks like the undefined behavior is only for signed integer overflow.
> >Could you try something for us?
> >
> >In Code/Common/itkStructHashFunction.h, change the line:
> >int hash = 0;
> >to
> >unsigned int hash = 0;
> >
> >and rerun the failing test.
>
> That didn't fix it.  But I think that change is worth committing anyway,
> as the function returns unsigned int.  We tried changing the hash
> function to unsigned long also, but that changed nothing.
>
> Mathieu and I looked at the code a bit... wow, templates! :)  So I tried
> building the test with 64-to-32-bit conversion warnings on, and there
> are many of them.  ITK in fact will need huge amounts of work to build
> cleanly.
>
> One thing we noticed was:
>
> typedef unsigned long IdentifierType
>
> Which makes IdentifierType 64 bit on 64 bit builds, and 32 bit on 32 bit
> builds.  Perhaps other code is expecting IdentifierType to be int-sized
> (ie 32 bit)...?
>
> Anything else we can try?
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20071220/9419154e/attachment.htm


More information about the Insight-developers mailing list