octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #48078] Crash when using signal's remez functi


From: anonymous
Subject: [Octave-bug-tracker] [bug #48078] Crash when using signal's remez function for close frequency band values + differentiator
Date: Wed, 1 Jun 2016 15:17:06 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

URL:
  <http://savannah.gnu.org/bugs/?48078>

                 Summary: Crash when using signal's remez function for close
frequency band values + differentiator
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 01 Jun 2016 03:17:04 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.2
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Hi,

I've found that, when using remez function from the forge package « signal
», if you give frequencies at the band edges too close from each other (as in
testcase.m), octave segfaults.

I've located the problem in remez.cc, l612-624:
  
for (i=0; i<numband; i++)
    {
      gridsize += (int)(2*r*griddensity*(bands[2*i+1] - bands[2*i]) + .5);
    }
  if (symmetry == NEGATIVE)
    {
      gridsize--;
    }

  Grid = (double *)malloc(gridsize * sizeof(double));


If 2*r*griddensity*(bands[2*i+1] - bands[2*i] <= 0.4, and the symmetry is
NEGATIVE (like in a differentiator), then gridsize = -1, and Grid points to
NULL, so octave crashes as soon as something tries to access it (like in
CreateDenseGrid).

I believe there should be a size check somewhere, but as I don't really now
how does remez work, I don't want to suggest something wrong.

Thanks!



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 01 Jun 2016 03:17:04 PM UTC  Name: testcase.m  Size: 269B   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=37331>
-------------------------------------------------------
Date: Wed 01 Jun 2016 03:17:04 PM UTC  Name: gdbdump  Size: 7kB   By: None

<http://savannah.gnu.org/bugs/download.php?file_id=37332>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?48078>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]