bugGNU Octave - Bugs: bug #63549, [octave forge] (control) Octave...

 
 

bug #63549: [octave forge] (control) Octave crash on certain inputs to place function

Submitter:  Luiz Antonio Maccari Junior <luiz>
Submitted:  Mon 19 Dec 2022 01:08:25 PM UTC
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Confirmed Assigned to:  None
Originator Name:  Luiz Antonio Maccari Jr. Open/Closed:  * Open
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Wed 21 Dec 2022 06:49:50 AM UTC, comment #4: 

Just to add more information.

I am using here Linux mint 20.3 with Octave 7.3. So the crash happens on linux too.

Luiz Antonio Maccari Junior <luiz>
Wed 21 Dec 2022 03:59:38 AM UTC, comment #3: 

Looking at sl_sb01bd.cc


octave_value_list retval;
<...>
        // return values
        retval(0) = f;
        retval(1) = octave_value (nfp);
        retval(2) = octave_value (nap);
        retval(3) = octave_value (nup);
        retval(4) = z;
    } //<-- this is line 162

    return retval;
}

Dangling pointer?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 21 Dec 2022 03:45:15 AM UTC, comment #2: 

On linux (octave 8.0.1 9be3a2706d62)

octave:11> L1 = place(A,C2',poloso)
free(): invalid pointer

Thread 7 "QThread" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffed66ad6c0 (LWP 20062)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
44              return INTERNAL_SYSCALL_ERROR_P (ret) ? INTERNAL_SYSCALL_ERRNO (ret) : 0;
<...deleted...>
Thread 7 (Thread 0x7ffed66ad6c0 (LWP 20062) "QThread"):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007ffff1eafee3 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2  0x00007ffff1e5faa6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff1e497fc in __GI_abort () at abort.c:79
#4  0x00007ffff1ea40ae in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff1fbd465 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#5  0x00007ffff1eb9bbc in malloc_printerr (str=str@entry=0x7ffff1fbb0b1 "free(): invalid pointer") at malloc.c:5660
#6  0x00007ffff1ebb9fc in _int_free (av=<optimized out>, p=<optimized out>, have_lock=0) at malloc.c:4435
#7  0x00007ffff1ebe343 in __GI___libc_free (mem=<optimized out>) at malloc.c:3385
#8  0x00007ffed4c004bd in std::__new_allocator<double>::deallocate(double*, unsigned long) (this=0x7ffec851ff80, __p=0x7ffec850caa0, __n=2) at /usr/include/c++/12/bits/new_allocator.h:158
#9  0x00007ffed4bffd28 in std::allocator_traits<std::allocator<double> >::deallocate(std::allocator<double>&, double*, unsigned long) (__a=..., __p=0x7ffec850caa0, __n=2) at /usr/include/c++/12/bits/alloc_traits.h:496
#10 0x00007ffed4bff122 in Array<double, std::allocator<double> >::ArrayRep::deallocate(double*, unsigned long) (this=0x7ffec851ff80, data=0x7ffec850caa0, len=2) at /usr/local/include/octave-8.0.1/octave/../octave/Array.h:208
#11 0x00007ffed4bfdf05 in Array<double, std::allocator<double> >::ArrayRep::~ArrayRep() (this=0x7ffec851ff80, __in_chrg=<optimized out>) at /usr/local/include/octave-8.0.1/octave/../octave/Array.h:188
#12 0x00007ffed4bfcfb6 in Array<double, std::allocator<double> >::~Array() (this=0x7ffed66a9860, __in_chrg=<optimized out>) at /usr/local/include/octave-8.0.1/octave/../octave/Array.h:358
#13 0x00007ffed4bfbd92 in MArray<double>::~MArray() (this=0x7ffed66a9860, __in_chrg=<optimized out>) at /usr/local/include/octave-8.0.1/octave/../octave/MArray.h:79
#14 0x00007ffed4c01484 in ColumnVector::~ColumnVector() (this=0x7ffed66a9860, __in_chrg=<optimized out>) at /usr/local/include/octave-8.0.1/octave/../octave/dColVector.h:36
#15 0x00007ffed4bd882a in F__sl_sb01bd__(octave_value_list const&, int) (args=..., nargout=5) at /tmp/oct-OGngHX/control-3.4.0/src/sl_sb01bd.cc:162
#16 0x00007ffff6e7fe02 in octave::tree_evaluator::execute_builtin_function(octave_builtin&, int, octave_value_list const&) (this=0x7ffec800a378, builtin_function=..., nargout=5, args=...) at ../libinterp/parse-tree/pt-eval.cc:3439
<...deleted...>

Full trace is attached.

Dmitri.
--

(file #54133)

Dmitri A. Sergatskov <dasergatskov>
Wed 21 Dec 2022 03:27:05 AM UTC, comment #1: 

Confirming the crash happens in both the gui and the CLI on Windows with version 7.3.0 and 8.0.1 (hg id: 24bd675bceab) with control package version 3.4.0

stepping through `place`, the crash happens toward the end when calling the compiled function _sl_sb01bd_.

>> which __sl_sb01bd__
'__sl_sb01bd__' is a function from the file C:\Octave\octave-7.3.0-w64-64\mingw64\lib\octave
\packages\control-3.4.0\x86_64-w64-mingw32-api-v57\__control_slicot_functions__.oct

cc package maintainers

Nicholas Jankowski <nrjank>
Project Member
Mon 19 Dec 2022 01:08:25 PM UTC, original submission:  

Hi,

I tried to put a single complex number as input in the place function and the GUI closes after this. The code to reproduce the error is below:

L = 0.5e-3
R = 10
C = 1e-3
Vi = 150

A = [-1/(C*R) 1/C;
-1/L 0]

B = [0;
1/L]

C2 = [1 0]

D = []


poloso =  [0 0.7020+0.1455*j]
L1 = place(A,C2',poloso)

I suspect the error is not only the bad pole location but also related to a numerical issue. The next example does not close the GUI

A = [1 1; 1 1;]

B = [1;1;]

%pole = [1 -1*J];
pole =  [0 0.7020+0.1455*j]
K = place(A,B,pole)

Best Regards

Luiz Antonio Maccari Junior <luiz>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54133:  control_bt.txt.gz added by dasergatskov (4KiB - 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 nrjank
  • -email is unavailable- added by dasergatskov (Updated the item)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by nrjank
  • -email is unavailable- added by nrjank
  • -email is unavailable- added by nrjank
  • -email is unavailable- added by luiz (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 project members can vote.

     

     

     

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-12-21 nrjank Operating SystemMicrosoft Windows Any
    2022-12-21 nrjank Carbon-Copy- Added -email is unavailable-
    2022-12-21 dasergatskov Attached File- Added control_bt.txt.gz, #54133
    2022-12-21 nrjank Item GroupUnexpected Error or Warning Segfault, Bus Error, etc.
        StatusNone Confirmed
        Release7.3.0 other
        Operating SystemGNU/Linux Microsoft Windows
        Summary[octave forge] (control) GUI closing suddenly after wrong inputs in place function [octave forge] (control) Octave crash on certain inputs to place function
        Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added dastew
        Carbon-Copy- Added ttl

    Back to the top

    Powered by Savane 3.10