bugGNU Octave - Bugs: bug #55170, imagesc never ends on complex...

 
 

bug #55170: imagesc never ends on complex matrix display

Submitter:  Georg Wiora <gwiora>
Submitted:  Thu 06 Dec 2018 09:43:05 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  gwiora Open/Closed:  * Closed
Release:  * 4.4.1 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 08 Dec 2018 06:04:23 PM UTC, comment #9: 

Why it hangs on the original reporter's computer is an open question.  However, it doesn't hurt to add an input validation test to image.m so that the situation never occurs.  I did that on the development branch here (https://hg.savannah.gnu.org/hgweb/octave/rev/572329faeb3b).

Closing report.

Rik <rik5>
Group administrator
Fri 07 Dec 2018 10:56:20 PM UTC, comment #8: 

Regarding comment #7: The code of comment #0 results for Matlab R2018b in an error:


>> imagesc(a)
Error using image
Complex values are not supported. Specify the color data as numeric or logical values.

Error in imagesc (line 52)
    hh = image(varargin{:}, 'CDataMapping', 'scaled');

>>


Kai Torben Ohlhus <siko1056>
Group Member
Fri 07 Dec 2018 09:38:30 PM UTC, comment #7: 

Thanks for testing Philip.  I can't say exactly what is going on here, it might be specific to Georg's hardware.

Of course, since image and imagesc are both just m-files, maybe we should add an input validation check that the image data is real, not complex.

What does Matlab do with the sample code from comment #0?

Rik <rik5>
Group administrator
Fri 07 Dec 2018 09:13:54 PM UTC, comment #6: 

.. and octave-4.4.1 does the same on that Windows box ==> works for me.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 07 Dec 2018 09:06:53 PM UTC, comment #5: 

On Windows 7 with dev Octave from Dec 5, I get:

>> a = zeros(3,3);
>> a(2,2) = 5;
>> a(1,1) = -1+3i;
>> figure('name','imagesc never ends');
>> imagesc(a)
error: invalid value for array property "cdata"
error: __go_image__: unable to create graphics handle
error: called from
    image>__img__ at line 201 column 5
    image at line 121 column 10
    imagesc at line 101 column 12


... and the plot comprises just a 1x1 box with ticks every 0.2.

Philip Nienhuis <philipnienhuis>
Group Member
Fri 07 Dec 2018 06:44:23 PM UTC, comment #4: 

This works for me on Linux.  I get an immediate error from the call to imagesc.


>> imagesc(a);
error: invalid value for array property "cdata"
error: __go_image__: unable to create graphics handle
error: called from
    image>__img__ at line 201 column 5
    image at line 121 column 10
    imagesc at line 101 column 12


It is possible that there is an issue only with Octave on Windows.  Perhaps someone else running Windows can verify whether they have the same issue.

Rik <rik5>
Group administrator
Thu 06 Dec 2018 10:03:40 AM UTC, comment #3: 

Work around




I enclosed the crashing command in line 201 of image.m with a try catch block:


  try
    h = __go_image__ (hax, "cdata", img, "xdata", xdata, "ydata", ydata,
                         "cdatamapping", "direct", varargin{:});
  catch e
     rethrow(lasterror());
  end_try_catch


This prevents octave from becoming unresponsive and works for me.

Nevertheless in my understanding octave should not become unresponsive in this situation.

Georg Wiora <gwiora>
Thu 06 Dec 2018 09:56:09 AM UTC, comment #2: 

When stepping through imagesc.m and image.m using the debugger I can see the correct error message issued in line 201 of image.m:


error: invalid value for array property "cdata"
error: called from
    image>__img__ at line 201 column 5
    image at line 120 column 10
    imagesc at line 98 column 12
    Test_imagesc_crash at line 5 column 1


If I try to step one command further octave becomes unresponsive. If I stop octave here everything is fine.

Georg Wiora <gwiora>
Thu 06 Dec 2018 09:46:44 AM UTC, comment #1: 

This bug shows up with qt graphics toolkit on windows. Using fltk or gnuplot an error is issued as expected.

Georg Wiora <gwiora>
Thu 06 Dec 2018 09:43:05 AM UTC, original submission:  

When calling imagesc with a complex matrix the image is never displayed and octave becomes unresponsive.

Test procedure:

a = zeros(3,3);
a(2,2) = 5;
a(1,1) = -1+3i;
figure('name','imagesc never ends');
imagesc(a);


This bug seems to have something in common with bug #36866 that existed in an ancient version of.

Georg Wiora <gwiora>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45589:  image.m added by gwiora (8KiB - application/octet-stream - Patched version of "image.m" with work around.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by siko1056 (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by gwiora (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-12-08 rik5 StatusNone Fixed
        Open/ClosedOpen Closed
    2018-12-06 gwiora Attached File- Added image.m, #45589

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code