bugGNU Octave - Bugs: bug #66024, (signal) cl2bp crashes Octave...

 
 

bug #66024: (signal) cl2bp crashes Octave 9.2.0 on Windows 10

Submitter:  Dennis Cote <dennisc_hi>
Submitted:  Thu 25 Jul 2024 07:57:30 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  lostbard
Originator Name:  Dennis Cote Open/Closed:  * Closed
Release:  * 9.2.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 22 Sep 2024 08:31:29 PM UTC, comment #11: 

v1.4.6 was released

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 06:47:44 PM UTC, comment #10: 

Documentation gets generated via the package sources so will update at the time of the next signal package release

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 06:32:44 PM UTC, comment #9: 


> and added a note on the function inputs for default and max value.


Will that automatically update the online documentation, or does that need to be done elsewhere?

Dennis Cote <dennisc_hi>
Fri 26 Jul 2024 06:19:36 PM UTC, comment #8: 

I pushed a change to the repo to use a default 2048, and added a note on the function inputs for default and max value.

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 05:53:16 PM UTC, comment #7: 

2048 that is

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 03:47:25 PM UTC, comment #6: 

The R package uses a fefault of 204, so will set that as the default value if not specified

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 03:29:55 PM UTC, comment #5: 

The Matlab equivalent function fircls (see https://www.mathworks.com/help/signal/ref/fircls.html) does not require a gridsize argument for the same algorithm.

The authors of the original paper cited in the cl2bp documentation published an improved algorithm in a later paper that is available at https://www.researchgate.net/publication/3316722_A_Modified_Algorithm_for_Constrained_Least_Square_Design_of_Multiband_FIR_Filters_without_Specified_Transition_Bands.

This paper mentions a grid of frequency values used for the algorithm but says: "When implementing the algorithm described herein, the frequency response can be calculated over a grid of frequency values. However, it is advised that the location of the extremal frequencies be refined by Newton’s method; otherwise, a rather dense grid is sometimes required for convergence. The use of Newton’s method is easily incorporated."

At the very least a default value of perhaps 2^8 or something similar should be provided and documented.

Dennis Cote <dennisc_hi>
Fri 26 Jul 2024 02:43:08 PM UTC, comment #4: 

Looking at the code, despite the function doc saying gridsize is optional, it is not, although it does allow not specifying it which causes the crash.

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 02:31:06 PM UTC, comment #3: 

Quick look, accessing arg(5) when one wasnt passed in (ie: when default gridsize):

const int L = args(5).int_value(true);

Ill take a look

John Donoghue <lostbard>
Group Member
Fri 26 Jul 2024 07:09:21 AM UTC, comment #2: 

CC'ing package maintainers.

Markus Mützel <mmuetzel>
Group administrator
Thu 25 Jul 2024 08:15:31 PM UTC, comment #1: 

I can reproduce on linux / octave 9.2.1 / signal-1.4.5
+verbose+
Core was generated by `/usr/local/libexec/octave/9.2.1/exec/x86_64-pc-linux-gnu/octave-gui'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  octave_value::int_value (this=0x7faf6522c748, req_int=true, frc_str_conv=false) at /usr/local/include/octave-9.2.1/octave/../octave/ov.h:813
813   { return m_rep->int_value (req_int, frc_str_conv); }
[Current thread is 1 (Thread 0x7faf77647640 (LWP 156272))]

-verbose-

Full trace is attached.

Dmitri.
--


(file #56309)

Dmitri A. Sergatskov <dasergatskov>
Thu 25 Jul 2024 07:57:30 PM UTC, original submission:  

I have the control and signal packages loaded. I was trying to use the cl2bp function to generate an FIR filter. The following sequence of commands crashes Octave 9.2.0 on Windows 10. The Octave application closes without any error message. I can execute all the lines before the call to cl2bp without any error.


M = 30;
Fs = 16000;
Fn = Fs/2;
F1 = 50;
W1 = F1/Fn * pi;
F2 = 7000;
W2 = F2/Fn * pi;
UP = [1 db2mag(0.5) db2mag(-40)];
LO = [0 db2mag(-0.5) 0];
b = cl2bp(M, W1, W2, UP, LO);


I can execute the example command from the cl2bp documentation without error.


h = cl2bp(30, 0.3*pi, 0.6*pi, [0.02, 1.02, 0.02], [-0.02, 0.98, -0.02], 2^11);


If I change the cl2bp call in my script to add the optional gridsize argument with a value of 2^11 as in the example as shown below, the function executes without error.


b = cl2bp(M, W1, W2, UP, LO, 2^11);


There appears to be a crashing bug in the cl2bp function without the gridsize argument or with the default value of the gridsize argument.

Dennis Cote <dennisc_hi>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56309:  crash_signal.txt.gz added by dasergatskov (3KiB - application/gzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by mmuetzel
  • -email is unavailable- added by mmuetzel
  • -email is unavailable- added by dasergatskov (Updated the item)
  • -email is unavailable- added by dennisc_hi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-09-22 lostbard StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2024-07-26 lostbard StatusConfirmed Ready For Test
    2024-07-26 lostbard Assigned toNone lostbard
    2024-07-26 mmuetzel CategoryOctave Function Octave Package
        StatusNone Confirmed
        Operating SystemMicrosoft Windows Any
        Summarycl2bp crashes Octave 9.2.0 on Windows 10 (signal) cl2bp crashes Octave 9.2.0 on Windows 10
        Carbon-Copy- Added lostbard
        Carbon-Copy- Added mtmiller
    2024-07-25 dasergatskov Attached File- Added crash_signal.txt.gz, #56309

    Back to the top

    Powered by Savane 3.14-8e77.
    Corresponding source code