f



smooth() bug in (at least) version 8.5.1

Hi,
I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.

The crashing commands are (try at own risk!):
sm = smooth(indgen(512,511), 9, /edge_mirror)
sm = smooth(indgen(512,510), 9, /edge_mirror)

And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
sm = smooth(indgen(512,512), 9, /edge_mirror)
sm = smooth(indgen(511,511), 9, /edge_mirror)

It appears that smooth (stopped?) being able to smooth rectangular arrays.

By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
% Array has a corrupted descriptor: <no name>
% Execution halted at: $Main$

And my IDL version.
IDL> !version
{
    "ARCH": "x86_64",
    "OS": "Win32",
    "OS_FAMILY": "Windows",
    "OS_NAME": "Microsoft Windows",
    "RELEASE": "8.5.1",
    "BUILD_DATE": "Nov 14 2015",
    "MEMORY_BITS": 64,
    "FILE_OFFSET_BITS": 64
}

I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.

Cheers,
Helder
0
Helder
12/2/2016 2:03:23 PM
comp.lang.idl-pvwave 12260 articles. 4 followers. Post Follow

6 Replies
467 Views

Similar Articles

[PageSpeed] 29

On Friday, December 2, 2016 at 9:03:27 AM UTC-5, Helder wrote:
> Hi,
> I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.
> 
> The crashing commands are (try at own risk!):
> sm = smooth(indgen(512,511), 9, /edge_mirror)
> sm = smooth(indgen(512,510), 9, /edge_mirror)
> 
> And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
> sm = smooth(indgen(512,512), 9, /edge_mirror)
> sm = smooth(indgen(511,511), 9, /edge_mirror)
> 
> It appears that smooth (stopped?) being able to smooth rectangular arrays.
> 
> By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
> % Array has a corrupted descriptor: <no name>
> % Execution halted at: $Main$
> 
> And my IDL version.
> IDL> !version
> {
>     "ARCH": "x86_64",
>     "OS": "Win32",
>     "OS_FAMILY": "Windows",
>     "OS_NAME": "Microsoft Windows",
>     "RELEASE": "8.5.1",
>     "BUILD_DATE": "Nov 14 2015",
>     "MEMORY_BITS": 64,
>     "FILE_OFFSET_BITS": 64
> }
> 
> I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.
> 
> Cheers,
> Helder

It also crashes on my Macbook running 8.5.1 and on my Linux systems running (32 bit) 8.2.2 and (64 bit) 8.5.1.    So it looks like a problem in the internal SMOOTH() algorithm.  --Wayne

    "ARCH": "x86_64",
    "OS": "darwin",
    "OS_FAMILY": "unix",
    "OS_NAME": "Mac OS X",
    "RELEASE": "8.5.1",
    "BUILD_DATE": "Nov 14 2015",
    "MEMORY_BITS": 64,
    "FILE_OFFSET_BITS": 64

   ARCH            STRinG    'x86_64'
   OS              STRING    'linux'
   OS_FAMILY       STRING    'unix'
   OS_NAME         STRING    'linux'
   RELEASE         STRING    '8.5.1'
   BUILD_DATE      STRING    'Nov 14 2015'
   MEMORY_BITS     INT             64
   FILE_OFFSET_BITS
                   INT             64



   ARCH            STRING    'x86'
   OS              STRING    'linux'
   OS_FAMILY       STRING    'unix'
   OS_NAME         STRING    'linux'
   RELEASE         STRING    '8.2.2'
   BUILD_DATE      STRING    'Jan 23 2013'
   MEMORY_BITS     INT             32
   FILE_OFFSET_BITS
                   INT             64

0
wlandsman
12/2/2016 3:06:05 PM
On Friday, December 2, 2016 at 4:06:08 PM UTC+1, wlandsman wrote:
> On Friday, December 2, 2016 at 9:03:27 AM UTC-5, Helder wrote:
> > Hi,
> > I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.
> > 
> > The crashing commands are (try at own risk!):
> > sm = smooth(indgen(512,511), 9, /edge_mirror)
> > sm = smooth(indgen(512,510), 9, /edge_mirror)
> > 
> > And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
> > sm = smooth(indgen(512,512), 9, /edge_mirror)
> > sm = smooth(indgen(511,511), 9, /edge_mirror)
> > 
> > It appears that smooth (stopped?) being able to smooth rectangular arrays.
> > 
> > By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
> > % Array has a corrupted descriptor: <no name>
> > % Execution halted at: $Main$
> > 
> > And my IDL version.
> > IDL> !version
> > {
> >     "ARCH": "x86_64",
> >     "OS": "Win32",
> >     "OS_FAMILY": "Windows",
> >     "OS_NAME": "Microsoft Windows",
> >     "RELEASE": "8.5.1",
> >     "BUILD_DATE": "Nov 14 2015",
> >     "MEMORY_BITS": 64,
> >     "FILE_OFFSET_BITS": 64
> > }
> > 
> > I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.
> > 
> > Cheers,
> > Helder
> 
> It also crashes on my Macbook running 8.5.1 and on my Linux systems running (32 bit) 8.2.2 and (64 bit) 8.5.1.    So it looks like a problem in the internal SMOOTH() algorithm.  --Wayne
> 
>     "ARCH": "x86_64",
>     "OS": "darwin",
>     "OS_FAMILY": "unix",
>     "OS_NAME": "Mac OS X",
>     "RELEASE": "8.5.1",
>     "BUILD_DATE": "Nov 14 2015",
>     "MEMORY_BITS": 64,
>     "FILE_OFFSET_BITS": 64
> 
>    ARCH            STRinG    'x86_64'
>    OS              STRING    'linux'
>    OS_FAMILY       STRING    'unix'
>    OS_NAME         STRING    'linux'
>    RELEASE         STRING    '8.5.1'
>    BUILD_DATE      STRING    'Nov 14 2015'
>    MEMORY_BITS     INT             64
>    FILE_OFFSET_BITS
>                    INT             64
> 
> 
> 
>    ARCH            STRING    'x86'
>    OS              STRING    'linux'
>    OS_FAMILY       STRING    'unix'
>    OS_NAME         STRING    'linux'
>    RELEASE         STRING    '8.2.2'
>    BUILD_DATE      STRING    'Jan 23 2013'
>    MEMORY_BITS     INT             32
>    FILE_OFFSET_BITS
>                    INT             64

Hi Wayne,
thanks. I just the info from Harris, that this bug will most likely not make it into 8.6 (January?). It has been logged with ID:IDL-69705.
Thanks for testing.

Cheers,
Helder
0
Helder
12/2/2016 3:13:33 PM
On Friday, December 2, 2016 at 8:03:27 AM UTC-6, Helder wrote:
> Hi,
> I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.
> 
> The crashing commands are (try at own risk!):
> sm = smooth(indgen(512,511), 9, /edge_mirror)
> sm = smooth(indgen(512,510), 9, /edge_mirror)
> 
> And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
> sm = smooth(indgen(512,512), 9, /edge_mirror)
> sm = smooth(indgen(511,511), 9, /edge_mirror)
> 
> It appears that smooth (stopped?) being able to smooth rectangular arrays.
> 
> By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
> % Array has a corrupted descriptor: <no name>
> % Execution halted at: $Main$
> 
> And my IDL version.
> IDL> !version
> {
>     "ARCH": "x86_64",
>     "OS": "Win32",
>     "OS_FAMILY": "Windows",
>     "OS_NAME": "Microsoft Windows",
>     "RELEASE": "8.5.1",
>     "BUILD_DATE": "Nov 14 2015",
>     "MEMORY_BITS": 64,
>     "FILE_OFFSET_BITS": 64
> }
> 
> I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.
> 
> Cheers,
> Helder

It failed for me too. However, I was able to work around it by doing the following:

IDL> arr = indgen(512,511)
IDL> sm1 = smooth(arr, [9,1], /edge_mirror)
IDL> sm2 = smooth(sm1, [1,9], /edge_mirror)

Interestingly, this only failed for me when using integer types. For example, when using floats it worked fine:

IDL> arrFloat = float(arr)
IDL> smFloat = smooth(arrFloat, 9, /edge_mirror)

and to show that I get the same answer as above (at least in this case) by smoothing along each dimension in separate commands:

IDL> smFLoat1 = smooth(arrFloat, [9,1], /edge_mirror)
IDL> smFloat2 = smooth(smFloat1, [1,9], /edge_mirror)
IDL> print, moment(smFloat2 - smFloat)
      0.00000      0.00000          NaN          NaN

IDL> !version
{
    "ARCH": "x86_64",
    "OS": "darwin",
    "OS_FAMILY": "unix",
    "OS_NAME": "Mac OS X",
    "RELEASE": "8.5",
    "BUILD_DATE": "Jul  7 2015",
    "MEMORY_BITS": 64,
    "FILE_OFFSET_BITS": 64
}

-Jeff

0
Jeff
12/2/2016 6:38:00 PM
On Friday, December 2, 2016 at 12:38:03 PM UTC-6, Jeff B wrote:
> On Friday, December 2, 2016 at 8:03:27 AM UTC-6, Helder wrote:
> > Hi,
> > I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.
> > 
> > The crashing commands are (try at own risk!):
> > sm = smooth(indgen(512,511), 9, /edge_mirror)
> > sm = smooth(indgen(512,510), 9, /edge_mirror)
> > 
> > And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
> > sm = smooth(indgen(512,512), 9, /edge_mirror)
> > sm = smooth(indgen(511,511), 9, /edge_mirror)
> > 
> > It appears that smooth (stopped?) being able to smooth rectangular arrays.
> > 
> > By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
> > % Array has a corrupted descriptor: <no name>
> > % Execution halted at: $Main$
> > 
> > And my IDL version.
> > IDL> !version
> > {
> >     "ARCH": "x86_64",
> >     "OS": "Win32",
> >     "OS_FAMILY": "Windows",
> >     "OS_NAME": "Microsoft Windows",
> >     "RELEASE": "8.5.1",
> >     "BUILD_DATE": "Nov 14 2015",
> >     "MEMORY_BITS": 64,
> >     "FILE_OFFSET_BITS": 64
> > }
> > 
> > I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.
> > 
> > Cheers,
> > Helder
> 
> It failed for me too. However, I was able to work around it by doing the following:
> 
> IDL> arr = indgen(512,511)
> IDL> sm1 = smooth(arr, [9,1], /edge_mirror)
> IDL> sm2 = smooth(sm1, [1,9], /edge_mirror)
> 
> Interestingly, this only failed for me when using integer types. For example, when using floats it worked fine:
> 
> IDL> arrFloat = float(arr)
> IDL> smFloat = smooth(arrFloat, 9, /edge_mirror)
> 
> and to show that I get the same answer as above (at least in this case) by smoothing along each dimension in separate commands:
> 
> IDL> smFLoat1 = smooth(arrFloat, [9,1], /edge_mirror)
> IDL> smFloat2 = smooth(smFloat1, [1,9], /edge_mirror)
> IDL> print, moment(smFloat2 - smFloat)
>       0.00000      0.00000          NaN          NaN
> 
> IDL> !version
> {
>     "ARCH": "x86_64",
>     "OS": "darwin",
>     "OS_FAMILY": "unix",
>     "OS_NAME": "Mac OS X",
>     "RELEASE": "8.5",
>     "BUILD_DATE": "Jul  7 2015",
>     "MEMORY_BITS": 64,
>     "FILE_OFFSET_BITS": 64
> }
> 
> -Jeff

I'm sure you know this, but I should make clear that the results for floats will NOT be the same as the results for integers. If you input an integer type then smooth will do integer math:

IDL> arr = indgen(5)
IDL> print, smooth(arr, 3, /edge_mirror)
       0       1       2       3       3
IDL> print, smooth(float(arr), 3, /edge_mirror)
     0.333333      1.00000      2.00000      3.00000      3.66667

-Jeff
0
Jeff
12/2/2016 6:50:23 PM
On Friday, December 2, 2016 at 7:38:03 PM UTC+1, Jeff B wrote:
> On Friday, December 2, 2016 at 8:03:27 AM UTC-6, Helder wrote:
> > Hi,
> > I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.
> > 
> > The crashing commands are (try at own risk!):
> > sm = smooth(indgen(512,511), 9, /edge_mirror)
> > sm = smooth(indgen(512,510), 9, /edge_mirror)
> > 
> > And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
> > sm = smooth(indgen(512,512), 9, /edge_mirror)
> > sm = smooth(indgen(511,511), 9, /edge_mirror)
> > 
> > It appears that smooth (stopped?) being able to smooth rectangular arrays.
> > 
> > By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
> > % Array has a corrupted descriptor: <no name>
> > % Execution halted at: $Main$
> > 
> > And my IDL version.
> > IDL> !version
> > {
> >     "ARCH": "x86_64",
> >     "OS": "Win32",
> >     "OS_FAMILY": "Windows",
> >     "OS_NAME": "Microsoft Windows",
> >     "RELEASE": "8.5.1",
> >     "BUILD_DATE": "Nov 14 2015",
> >     "MEMORY_BITS": 64,
> >     "FILE_OFFSET_BITS": 64
> > }
> > 
> > I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.
> > 
> > Cheers,
> > Helder
> 
> It failed for me too. However, I was able to work around it by doing the following:
> 
> IDL> arr = indgen(512,511)
> IDL> sm1 = smooth(arr, [9,1], /edge_mirror)
> IDL> sm2 = smooth(sm1, [1,9], /edge_mirror)
> 
> Interestingly, this only failed for me when using integer types. For example, when using floats it worked fine:
> 
> IDL> arrFloat = float(arr)
> IDL> smFloat = smooth(arrFloat, 9, /edge_mirror)
> 
> and to show that I get the same answer as above (at least in this case) by smoothing along each dimension in separate commands:
> 
> IDL> smFLoat1 = smooth(arrFloat, [9,1], /edge_mirror)
> IDL> smFloat2 = smooth(smFloat1, [1,9], /edge_mirror)
> IDL> print, moment(smFloat2 - smFloat)
>       0.00000      0.00000          NaN          NaN
> 
> IDL> !version
> {
>     "ARCH": "x86_64",
>     "OS": "darwin",
>     "OS_FAMILY": "unix",
>     "OS_NAME": "Mac OS X",
>     "RELEASE": "8.5",
>     "BUILD_DATE": "Jul  7 2015",
>     "MEMORY_BITS": 64,
>     "FILE_OFFSET_BITS": 64
> }
> 
> -Jeff

Thanks! This saves the day... or something like that.
:-)
Cheers,
Helder
0
Helder
12/2/2016 8:36:44 PM
On Friday, December 2, 2016 at 1:36:47 PM UTC-7, Helder wrote:
> On Friday, December 2, 2016 at 7:38:03 PM UTC+1, Jeff B wrote:
> > On Friday, December 2, 2016 at 8:03:27 AM UTC-6, Helder wrote:
> > > Hi,
> > > I came across this bug and it's a "heavy" one, meaning that IDL crashes and you're thrown back out.
> > > 
> > > The crashing commands are (try at own risk!):
> > > sm = smooth(indgen(512,511), 9, /edge_mirror)
> > > sm = smooth(indgen(512,510), 9, /edge_mirror)
> > > 
> > > And just to be pedantic, I've tested a few other cases and these did NOT result in a crash:
> > > sm = smooth(indgen(512,512), 9, /edge_mirror)
> > > sm = smooth(indgen(511,511), 9, /edge_mirror)
> > > 
> > > It appears that smooth (stopped?) being able to smooth rectangular arrays.
> > > 
> > > By running the above from the command line I get the following error (for a couple of seconds on the command line terminal):
> > > % Array has a corrupted descriptor: <no name>
> > > % Execution halted at: $Main$
> > > 
> > > And my IDL version.
> > > IDL> !version
> > > {
> > >     "ARCH": "x86_64",
> > >     "OS": "Win32",
> > >     "OS_FAMILY": "Windows",
> > >     "OS_NAME": "Microsoft Windows",
> > >     "RELEASE": "8.5.1",
> > >     "BUILD_DATE": "Nov 14 2015",
> > >     "MEMORY_BITS": 64,
> > >     "FILE_OFFSET_BITS": 64
> > > }
> > > 
> > > I others are brave enough, could you let me know if it crashes on other versions of IDL? Edge_mirror and _wrap have been added only in 8.1.
> > > 
> > > Cheers,
> > > Helder
> > 
> > It failed for me too. However, I was able to work around it by doing the following:
> > 
> > IDL> arr = indgen(512,511)
> > IDL> sm1 = smooth(arr, [9,1], /edge_mirror)
> > IDL> sm2 = smooth(sm1, [1,9], /edge_mirror)
> > 
> > Interestingly, this only failed for me when using integer types. For example, when using floats it worked fine:
> > 
> > IDL> arrFloat = float(arr)
> > IDL> smFloat = smooth(arrFloat, 9, /edge_mirror)
> > 
> > and to show that I get the same answer as above (at least in this case) by smoothing along each dimension in separate commands:
> > 
> > IDL> smFLoat1 = smooth(arrFloat, [9,1], /edge_mirror)
> > IDL> smFloat2 = smooth(smFloat1, [1,9], /edge_mirror)
> > IDL> print, moment(smFloat2 - smFloat)
> >       0.00000      0.00000          NaN          NaN
> > 
> > IDL> !version
> > {
> >     "ARCH": "x86_64",
> >     "OS": "darwin",
> >     "OS_FAMILY": "unix",
> >     "OS_NAME": "Mac OS X",
> >     "RELEASE": "8.5",
> >     "BUILD_DATE": "Jul  7 2015",
> >     "MEMORY_BITS": 64,
> >     "FILE_OFFSET_BITS": 64
> > }
> > 
> > -Jeff
> 
> Thanks! This saves the day... or something like that.
> :-)
> Cheers,
> Helder

Hi all,

Yes, this bug has been in the SMOOTH function since IDL 8.1 when the EDGE_MIRROR and EDGE_WRAP keywords were added. It works fine for square arrays, but walks off the end of the array for non-square arrays.

It's now been fixed, and will be in IDL Next (not 8.6).

Cheers,
Chris
Harris Geospatial Solutions
0
Chris
12/7/2016 8:25:55 PM
Reply: