bugGNU Octave - Bugs: bug #45298, Error when using a plot command...

 
 

bug #45298: Error when using a plot command inside a for cycle

Submitter:  None
Submitted:  Wed 10 Jun 2015 09:32:24 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Works For Me Assigned to:  None
Originator Name:  Mario Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.0.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Thu 31 Mar 2016 04:02:33 PM UTC, comment #13: 

Please file a separate bug about failure to compile the default branch on your system.

Mike Miller <mtmiller>
Group Member
Thu 31 Mar 2016 04:01:12 PM UTC, comment #12: 

Furthermore, it is the same platform (same compilers, autotools, etc) in which I was able to install from scratch (i.e. with continue/make procedure) the version 4.0.1. No problem found then.

Rafael López <rlopez>
Thu 31 Mar 2016 03:56:46 PM UTC, comment #11: 

I am using gcc version 4.9.2

Rafael López <rlopez>
Thu 31 Mar 2016 03:54:47 PM UTC, comment #10: 

This seems like a separate issue, please take this to the help mailing list if you need help compiling Octave. But this looks like you may be building with gcc 6, which has known problems with Octave's use of gnulib.

Mike Miller <mtmiller>
Group Member
Thu 31 Mar 2016 03:44:29 PM UTC, comment #9: 

I have tried to install development version of octave-4.1.0+ from the tarball to check the issue, but the make failed giving the following message:

CXX      liboctave/util/liboctave_util_libutil_la-sparse-util.lo
In file included from /usr/include/suitesparse/SuiteSparse_config.h:47:0,
                 from /usr/include/suitesparse/amd.h:46,
                 from liboctave/util/oct-sparse.h:29,
                 from liboctave/util/sparse-util.cc:31:
libgnu/math.h: In function 'int signbit(double)':
libgnu/math.h:2577:1: error: conflicting declaration of C function 'int signbit(double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
libgnu/math.h:2577:1: note: previous declaration 'int signbit(float)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
libgnu/math.h: In function 'int signbit(long double)':
libgnu/math.h:2577:1: error: conflicting declaration of C function 'int signbit(long double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
libgnu/math.h:2577:1: note: previous declaration 'int signbit(double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
libgnu/math.h:2577:1: error: conflicting declaration of C function 'int signbit(long double)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
 ^
libgnu/math.h:2577:1: note: previous declaration 'int signbit(float)'
 _GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)


Configure displayed some warnings:

configure: WARNING: CAMD library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: COLAMD library not found.  This will result in some lack of functionality for sparse matrices.
configure: WARNING: CCOLAMD library not found.  This will result in some lack of functionality for sparse matrices.

Since I don't know whether they may have any relation with the error, I tried configure using options:

--with-amd-includedir=/usr/include/suisparse
--with-amd-libdir=/usr/lib64 
etc.

and using the respective   --without-... options.

Nothing changed in either case. The error abode.

Any hint?

Rafael López <rlopez>
Wed 30 Mar 2016 04:41:35 PM UTC, comment #8: 

@Rafael: Is it possible for you to build the development version of Octave and test with that?  There has been a huge amount of code re-factoring on the development branch and my guess is that this problem has been eliminated.

Rik <rik5>
Group administrator
Wed 30 Mar 2016 08:42:41 AM UTC, comment #7: 

Octave version: 4.0.1
System: Linux 64 (mageia 5)
Desktop: KDE 4.14.5

I have run again my script using stoch_simul.m from dynare-4.4.3/matlab but changing the graphics toolkit to gnuplot (instead of fltk) and now it works fine.

Rafael López <rlopez>
Wed 30 Mar 2016 08:26:20 AM UTC, comment #6: 

Octave version: 4.0.1
System: Linux 64 (mageia 5)
Desktop: KDE 4.14.5

I have run the script of the original submission in my laptop and it works.

However, I have a more complicated script (using stoch_simul.m from dynare-4.4.3/matlab among other scripts) and it fails when plotting inside a loop in stoch_simul.m with exactly the same error messages as reported in the original post.

Any hint?

Rafael López <rlopez>
Sat 03 Oct 2015 11:25:58 PM UTC, comment #5: 

Attaching a backtrace of an occurrence of this bug. The bug manifests in graphics.cc, axes::properties::update_font. At least one of the properties "fontname", "fontweight", "fontangle" retrieved in this method is an instance of class octave_base_value, and not of a derived class.

I suspect that instances of plain octave_base_value should not exist, and I further suspect that this is caused by a timing sensitivity when plot creates a new figure window.

(file #35057)

Anonymous
Sat 26 Sep 2015 05:49:50 AM UTC, comment #4: 

This error occurs intermittently also on Linux 64 bits. Attaching transscript of octave session. I have saved example code lives in m-file /tmp/errortest.m. As you can see, on first invocation, the error occurs, on second, it does not occur, after a "clear all" it occurs again, then does not occur any more, even after more "clear all"s.

I've found this bug report by searching for

error: octave_base_value::convert_to_str_internal (): wrong type argument '<unknown type>'

I've searched because I get intermittent errors with this message with my own scripts.

T Herzke

(file #34980)

Anonymous
Wed 17 Jun 2015 06:08:18 AM UTC, comment #3: 

I see the problem running the script on some Windows7-64 machines, but not all!

JBH <u3p141592654>
Thu 11 Jun 2015 08:20:28 PM UTC, comment #2: 

You script works for me on Windows 7 64-bit with octave-4.0.0 from ftp.gnu.org  and dev version (4.1.0+), with fltk and qt. I get 10 plots windows with sinusoidal-like curves.

In my code I have several plot commands in nested for loops that work fine, so I suppose you have other problems.
What happens if you run your script from an entirely different location (subdirectory) ?

Philip Nienhuis <philipnienhuis>
Group Member
Wed 10 Jun 2015 10:47:20 PM UTC, comment #1: 

Works for me on a Linux.  This may be something specific to the Windows version.

Rik <rik5>
Group administrator
Wed 10 Jun 2015 09:32:24 PM UTC, original submission:  


The following issue will disappear if the entire program is running in debug mode. After the error description you can find the script:

error: octave_base_value::convert_to_str_internal (): wrong type argument '<unknown type>'
error: called from
    __line__ at line 117 column 21
    line at line 56 column 8
    __plt__>__plt2vv__ at line 500 column 10
    __plt__>__plt2__ at line 246 column 14
    __plt__>__plt1__ at line 205 column 10
    __plt__ at line 119 column 17
    plot at line 220 column 10
    Check_fase at line 25 column 8
error: octave_base_value::convert_to_str_internal (): wrong type argument '<unknown type>'
error: called from
    __line__ at line 117 column 21
    line at line 56 column 8
    __plt__>__plt2vv__ at line 500 column 10
    __plt__>__plt2__ at line 246 column 14
    __plt__>__plt1__ at line 205 column 10
    __plt__ at line 119 column 17
    plot at line 220 column 10
    Check_fase at line 25 column 8
error: octave_base_value::convert_to_str_internal (): wrong type argument '<unknown type>'
error: octave_base_value::convert_to_str_internal (): wrong type argument '<unknown type>'
error: octave_base_value::matrix_value(): wrong type argument '<unknown type>'
error: drawnow: A(I,J): row index out of bounds; value 1 out of bound 0


----------------------------------------------------------------
script:

f = 50; %Hz
w = 2*pi *f;
num_of_samples = 30;
time_d = ([1 : num_of_samples]/num_of_samples*0.01)';

theta_d = w*time_d;
theta_p_120_d = theta_d +2/3*pi;
theta_m_120_d = theta_d -2/3*pi;

ab_sin_b_d = abs(sin(theta_d));
ab_sin_p_120_d = abs(sin(theta_p_120_d));
ab_sin_m_120_d = abs(sin(theta_m_120_d));
plot (time_d,[ab_sin_b_d, ab_sin_p_120_d, ab_sin_m_120_d])

f1_d = ab_sin_b_d;
f2_d = ab_sin_p_120_d;
f3_d = ab_sin_m_120_d;

f_v_d= [ f1_d,f2_d,f3_d];

for idx_1 = 1:3
    for idx_2 = 1:3
       %cross_var (idx_1, idx_2) = trapz(f_v(:,idx_1) .* f_v(:,idx_2));
       figure
       plot(f_v_d(:,idx_1) .* f_v_d(:,idx_2))
       hold on
       plot(f_v_d(:,idx_1))
       plot(f_v_d(:,idx_2))
       mean_var_d (idx_1, idx_2) = mean( f_v_d(:,idx_1) .* f_v_d(:,idx_2));
    end
end

mean_var_d
mean_var_d_pu = mean_var_d /max(max(mean_var_d))


Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #35057:  backtrace.txt added by None (5KiB - text/plain)
file #34980:  transscript.txt added by None (6KiB - text/plain - Transscript: Error occurs intermittently also on Linux)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by rlopez (Posted a comment)
  • -email is unavailable- added by u3p141592654 (Posted a comment)
  • -email is unavailable- added by rik5 (Updated 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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-03 None Attached File- Added backtrace.txt, #35057
    2015-09-26 None Attached File- Added transscript.txt, #34980
    2015-06-15 rik5 Open/ClosedOpen Closed
    2015-06-11 philipnienhuis StatusNone Works For Me
    2015-06-10 rik5 Carbon-CopyRemoved 72865 -
    2015-06-10 rik5 Item GroupSegfault, Bus Error, etc. Incorrect Result

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code