[Insight-developers] FloatingPointExceptions and failed tests in Mac

Bill Lorensen bill.lorensen at gmail.com
Mon Dec 20 19:58:34 EST 2010


I'm pretty sure the AddPixel method in RankHistogram is not thread
safe. It modifies m_Entries which is also used in GetValueBruteForce
(and GetValue). I think RemovePIxel has the same issue.


On Mon, Dec 20, 2010 at 7:44 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> It may be a threading issue.
>
> On Mon, Dec 20, 2010 at 7:24 PM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Hi Bill,
>>
>> Here is a first peek at what GDB shows for
>>
>>    ctest -R itkRankImageFilterTest3
>>
>> ---
>>
>> It seem to stop at itkRankHistogram.h:279
>>
>> ----
>>
>> Program received signal EXC_ARITHMETIC, Arithmetic exception.
>> 0x0040deb8 in itk::Function::VectorRankHistogram<unsigned
>> char>::GetValueBruteForce (this=0x1d8e4f0) at itkRankHistogram.h:279
>> 279         unsigned long target = (unsigned long)( m_Rank * ( m_Entries -
>> 1 ) ) + 1;
>> (gdb) bt
>> #0  0x0040deb8 in itk::Function::VectorRankHistogram<unsigned
>> char>::GetValueBruteForce (this=0x1d8e4f0) at itkRankHistogram.h:279
>> #1  0x003ff885 in itk::Function::VectorRankHistogram<unsigned
>> char>::GetValue (this=0x1d8e4f0) at itkRankHistogram.h:293
>> #2  0x00401390 in itk::MovingHistogramImageFilter<itk::Image<unsigned
>> char, 2u>, itk::Image<unsigned char, 2u>,
>> itk::FlatStructuringElement<2u>, itk::Function::RankHistogram<unsigned
>> char> >::ThreadedGenerateData (this=0x1d89500,
>> outputRegionForThread=@0xbffff20c, threadId=0) at
>> itkMovingHistogramImageFilter.txx:130
>> #3  0x000948fc in itk::ImageSource<itk::Image<unsigned char, 2u>
>>>::ThreaderCallback (arg=0x200ea44) at itkImageSource.txx:302
>> #4  0x00530243 in itk::MultiThreader::SingleMethodExecute
>> (this=0x200ea00) at
>> /Users/ibanez/Dashboards/src/ITK/Code/Common/itkMultiThreader.cxx:324
>> #5  0x00094823 in itk::ImageSource<itk::Image<unsigned char, 2u>
>>>::GenerateData (this=0x1d89500) at itkImageSource.txx:251
>> #6  0x0053ebce in itk::ProcessObject::UpdateOutputData
>> (this=0x1d89500) at
>> /Users/ibanez/Dashboards/src/ITK/Code/Common/itkProcessObject.cxx:978
>> #7  0x0052a849 in itk::DataObject::UpdateOutputData (this=0x1d89630)
>> at /Users/ibanez/Dashboards/src/ITK/Code/Common/itkDataObject.cxx:408
>> #8  0x0000eec3 in itk::ImageBase<2u>::UpdateOutputData
>> (this=0x1d89630) at itkImageBase.txx:283
>> #9  0x0052a59a in itk::DataObject::Update (this=0x1d89630) at
>> /Users/ibanez/Dashboards/src/ITK/Code/Common/itkDataObject.cxx:333
>> #10 0x0053f809 in itk::ProcessObject::Update (this=0x1d89500) at
>> /Users/ibanez/Dashboards/src/ITK/Code/Common/itkProcessObject.cxx:612
>> #11 0x003fc562 in itkRankImageFilterTest (ac=4, av=0xbffff990) at
>> /Users/ibanez/Dashboards/src/ITK/Testing/Code/Review/itkRankImageFilterTest.cxx:99
>> #12 0x00009e66 in main (ac=5, av=0xbffff98c) at itkTestMain.h:175
>>
>>
>> I don't quite see why...
>>
>> The relevant values in this line are:
>>
>> (gdb) print m_Rank
>> $1 = 0.5
>> (gdb) print m_Entries
>> $2 = 20
>> (gdb) print target
>> $3 = 30991600
>>
>>
>> I'm wondering if I should tell gdb to stop when
>> that specific exceptions are thrown...
>>
>> I'm taking a look at the gdb tutorial / documentation...
>>
>>
>>     Luis
>>
>>
>> ----------------------
>> On Mon, Dec 20, 2010 at 4:35 PM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>> Luis,
>>>
>>> These may be related to the compiler using "old" fp instructions for
>>> some math functions.
>>> See for example:
>>> http://www.mail-archive.com/core-libs-dev@openjdk.java.net/msg01325.html
>>>
>>> If you run one of the failing tests with gdb it should pinpoint the problem.
>>>
>>> It may be we can't fix it, but at least give it a shot,
>>>
>>> Bill
>>>
>>> On Sun, Dec 19, 2010 at 8:55 AM, Hans Johnson <hans-johnson at uiowa.edu> wrote:
>>>> Luis,
>>>>
>>>> I don’t think there are special flags required.  There are flags that can
>>>> change the behavior of how floating point exceptions behave, but these are
>>>> usually things that simply ignore exceptions, or allow undefined behavior in
>>>> order to get speed increases.
>>>>
>>>> My gut feeling is that we should spend a little more time verifying that the
>>>> floating point report can not be made cleaner by fortifying the code (rather
>>>> than changing what is reported).
>>>>
>>>> Kent is on vacation until after the first of the year, so perhaps we should
>>>> dis-able this for the next 2 weeks and then take this back up in January.
>>>>
>>>> Hans
>>>>
>>>> Hans
>>>> --
>>>> Hans J. Johnson, Ph.D.
>>>> Hans-johnson at uiowa.edu
>>>>
>>>> 278 GH
>>>> The University of Iowa
>>>> Iowa City, IA 52241
>>>> (319) 353 8587
>>>>
>>>>
>>>> ________________________________
>>>> From: Luis Ibanez <luis.ibanez at kitware.com>
>>>> Date: Sat, 18 Dec 2010 19:01:40 -0500
>>>> To: Bill Lorensen <bill.lorensen at gmail.com>
>>>> Cc: Hans Johnson <hans-johnson at uiowa.edu>, ITK <insight-developers at itk.org>,
>>>> Kent Williams <norman-k-williams at uiowa.edu>
>>>> Subject: Re: [Insight-developers] FloatingPointExceptions and failed tests
>>>> in Mac
>>>>
>>>> Hi Bill,
>>>>
>>>> Yes, that's the flag that I have ON in thurmite.kitware.
>>>>
>>>> I may have misunderstood Hans, but I thought that
>>>> he was implying that an additional set of compilation
>>>> options will make this flag to work correctly in the mac.
>>>>
>>>> Currently this build is reporting
>>>>
>>>> 19 failing tests in Debug
>>>> http://www.cdash.org/CDash/buildSummary.php?buildid=804592
>>>>
>>>> and
>>>>
>>>> 139 failing tests in Release:
>>>> http://www.cdash.org/CDash/buildSummary.php?buildid=804592
>>>>
>>>>
>>>>      Luis
>>>>
>>>>
>>>> ----------------------
>>>> On Fri, Dec 17, 2010 at 5:05 PM, Bill Lorensen <bill.lorensen at gmail.com>
>>>> wrote:
>>>>
>>>> //Enable Floating Point Exceptions for Testing
>>>> ITK_USE_FLOATINGPOINTEXCEPTIONS:BOOL=ON
>>>>
>>>>
>>>> On Fri, Dec 17, 2010 at 5:04 PM, Luis Ibanez <luis.ibanez at kitware.com>
>>>> wrote:
>>>>> Hi Hans,
>>>>>
>>>>> What compilation options should I use in Mac in order
>>>>> to get the floating point exceptions to work ?
>>>>>
>>>>> I'll add them to the ctest script for thurmite.kitware.
>>>>>
>>>>>
>>>>>      Luis
>>>>>
>>>>>
>>>>> --------------------------------------------
>>>>> On Fri, Dec 17, 2010 at 11:15 AM, Hans Johnson <hans-johnson at uiowa.edu>
>>>>> wrote:
>>>>>>
>>>>>> Luis,
>>>>>>
>>>>>> Let’s not rule out the possibility that a different set of floating point
>>>>>> exceptions ARE Working on mac with the compile options.  So far the
>>>>>> reported
>>>>>> errors have identified real problems in ITK.
>>>>>>
>>>>>> Hans
>>>>>>
>>>>>>
>>>>>>
>>>>>> On 12/17/10 10:11 AM, "Luis Ibanez" <luis.ibanez at kitware.com> wrote:
>>>>>>
>>>>>>
>>>>>> Kent, Hans, Brad,
>>>>>>
>>>>>> Looking closer at the tests that are failing in thurmite.kitware (a Mac
>>>>>> mini):
>>>>>>
>>>>>> In Debug mode: 19 failing tests:
>>>>>> http://www.cdash.org/CDash/viewTest.php?onlyfailed&buildid=803613
>>>>>>
>>>>>> and in Release mode, 139 failing tests:
>>>>>> http://www.cdash.org/CDash/viewTest.php?onlyfailed&buildid=802532
>>>>>>
>>>>>>
>>>>>> They turned out to be related to the fact that this build has ON the
>>>>>> flag:
>>>>>>
>>>>>>                   ITK_USE_FLOATINGPOINTEXCEPTIONS
>>>>>>
>>>>>> When I turn the flag OFF, the build returns with only 6 tests failing:
>>>>>> http://www.cdash.org/CDash/viewTest.php?onlyfailed&buildid=803142
>>>>>>
>>>>>>
>>>>>> Are you aware of any reason why the floating point exceptions
>>>>>> shouldn't  work in a Mac ?
>>>>>>
>>>>>> and if so, ...
>>>>>> should we add some logic in the CMakeLists.txt file to
>>>>>> hide this flag when configuring in macs ?
>>>>>>
>>>>>>
>>>>>>
>>>>>>      Thanks
>>>>>>
>>>>>>
>>>>>>            Luis
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com <http://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://kitware.com/products/protraining.html
>>>>>
>>>>> 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-developers
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>


More information about the Insight-developers mailing list