bugGNU Octave - Bugs: bug #49482, GL2PS buffer overflow

 
 

bug #49482: GL2PS buffer overflow

Submitter:  Clinton Winant <cwinant>
Submitted:  Sun 30 Oct 2016 07:15:59 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Works For Me Assigned to:  None
Originator Name:  Clinton Winant Open/Closed:  * Closed
Release:  * 4.2.0-rc2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 31 Oct 2016 07:35:39 PM UTC, comment #11: 

Octave doesn't have control over the wording of the message--it is produced by GL2PS.  Instead, I added an additional message from Octave that informs the user what is happening.  I checked that change in here (http://hg.savannah.gnu.org/hgweb/octave/rev/b5407b1ab11a).

When I run the example in this report I now get these messages:


GL2PS info: OpenGL feedback buffer overflow
warning: gl2ps_renderer::draw: retrying with buffer size: 8.4E+06 B
GL2PS info: OpenGL feedback buffer overflow
warning: gl2ps_renderer::draw: retrying with buffer size: 1.7E+07 B
GL2PS info: OpenGL feedback buffer overflow
warning: gl2ps_renderer::draw: retrying with buffer size: 8.4E+06 B
GL2PS info: OpenGL feedback buffer overflow
warning: gl2ps_renderer::draw: retrying with buffer size: 1.7E+07 B


The messages are repeated twice because when producing Latex output the scene is rendered twice.  This seems like a point that could be optimized so I filed a bug report about that at bug #49492.


Rik <rik5>
Group administrator
Mon 31 Oct 2016 07:30:11 PM UTC, comment #10: 

The status is closed. so this is probably useless, but please realize that the current message is exactly the same as was sent before this problem was resolved (bug 46417).  Since there has been no announcement that that bug was resolved, a user has no way of knowing where this is a problem or not.  Unlike developers, the lay user is trying to get something done that is quite different, eg getting figures ready for publication.  While it could be that a message like "don't worry Im still trying" might help the impatient, the current message stating that there is a buffer overflow w/o indication that something is done about it is unhelpful at best.

Clinton Winant <cwinant>
Mon 31 Oct 2016 05:58:41 PM UTC, comment #9: 

Maybe simply change the message:

"GL2PS info: OpenGL feedback buffer overflow"

into

"GL2PS info: OpenGL feedback buffer overflow, buffer size adapted"

-or-

"GL2PS info: OpenGL feedback buffer overflow, re-trying with larger buffer"

-or maybe even simply-

"GL2PS info: re-trying with larger buffer"
?

I second Andreas' comment that the message can be useful info, but I also seond Clinton's comment that unwary users should receive info that isn't needlessly worrying for them.
I find that many users simply do not know/appreciate that the word "info" means that what follows refers to a harmless condition, while for developers that seems obvious.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 31 Oct 2016 08:06:27 AM UTC, comment #8: 

Octave doesn't "built the displayed image" it uses OpenGL which  the face culling, tesselation and so on. gl2ps uses the glFeedbackBuffer to capture the commands and convert them to postscript. It's like listening on a serial port: You don't know how much data will be sent until it's finished because there is no header.

The info message you see is output by the gl2ps. We can just disable all output or let it be chatty. For me the message is usefull to show that there is still progress and the buffer keeps growing.

Andreas Weber <andy1978>
Group Member
Mon 31 Oct 2016 03:00:14 AM UTC, comment #7: 

One would think that in such a process, octave would first evaluate the required buffer size. It has already built the displayed image so must have the required information. This would avoid time consuming and inefficient iterations.

From the user's perspective the question is if the message is irrelevant to her process, why bombard her with information she can do nothing about except wonder if the file produced is correct or not?

Clinton Winant <cwinant>
Mon 31 Oct 2016 02:57:51 AM UTC, comment #6: 

Dmitri has diagnosed this correctly.  We can't know initially what buffer size will work for all images, so we start with a given size and let gl2ps try and render it.  If gl2ps tells Octave that the buffer was too small, then we double the buffer and try again.  We keep doing this until the image is finally rendered successfully.  The messages that are sent to stderr include the word "info" to indicate that this is not an error.

Rik <rik5>
Group administrator
Mon 31 Oct 2016 01:32:10 AM UTC, comment #5: 

Octave tries to print with some pre-determined buffer size.
If it is too small gl2ps returns error and octave double the buffer size and tries again and so on.
You can see the code in gl2ps-print.cc file starting at about line 210.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 31 Oct 2016 01:18:03 AM UTC, comment #4: 

Not sure I understand the latest comment.  The output file is either correct or not.  If it is correct why would the user be informed repeatedly that there is a buffer overflow?


Clinton Winant <cwinant>
Mon 31 Oct 2016 12:59:10 AM UTC, comment #3: 

This is not an error, just an information message.

You do get a correct output file, don't you?

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Mon 31 Oct 2016 12:02:30 AM UTC, comment #2: 

Same problem with 4.2.0-rc2, only for a slightly larger file size:


GNU Octave, version 4.2.0-rc2
Copyright (C) 2016 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

>> nx=400;x=linspace(0,2*pi,nx);
>> ny=400;y=linspace(0,2*pi,ny);
>> array=sin(x).*transpose(sin(y));
>> pcolor(x,y,array);
>> print("temp","-depslatexstandalone");
GL2PS info: OpenGL feedback buffer overflow
GL2PS info: OpenGL feedback buffer overflow
GL2PS info: OpenGL feedback buffer overflow
GL2PS info: OpenGL feedback buffer overflow

Isnt this a gl2ps issue rather than an octave issue??

Clinton Winant <cwinant>
Sun 30 Oct 2016 09:34:24 PM UTC, comment #1: 

Version 4.0.3 is just about to be deprecated.  Please try with the latest 4.2.0-rc2 release candidate (http://alpha.gnu.org/gnu/octave/octave-4.2.0-rc2.tar.xz).  This works for me.

Rik <rik5>
Group administrator
Sun 30 Oct 2016 07:15:59 PM UTC, original submission:  



Ubuntu 16.04 and 16.10
GL2PS 1.3.8 and 1.3.9

This issue was the subject of the bug report 46417
The issue ii unresolved

When trying to render image to eps, program issues
GL2PS info: OpenGL feedback buffer overflow
output files are corrupt.
 Following is output from running testgl2ps (file attached)

GNU Octave, version 4.0.3
Copyright (C) 2016 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

warning: function /home/abr_ca/Software/Octave/cdw/clabel.m shadows a core library function
warning: called from
    /home/abr_ca/.octaverc at line 1 column 1
>> testgl2ps
GL2PS info: OpenGL feedback buffer overflow
GL2PS info: OpenGL feedback buffer overflow
GL2PS info: OpenGL feedback buffer overflow
GL2PS info: OpenGL feedback buffer overflow



Clinton Winant <cwinant>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38843:  testgl2ps.m added by cwinant (185B - text/x-objcsrc - see currently closed bug report 46417)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by andy1978 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by cwinant (Submitted the item)
  • -email is unavailable- added by cwinant (see currently closed bug report 46417)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-10-31 rik5 Open/ClosedOpen Closed
    2016-10-30 rik5 StatusNone Works For Me
        Release4.0.3 4.2.0-rc2
    2016-10-30 cwinant Attached File- Added testgl2ps.m, #38843
        Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code