bugGNU Octave - Bugs: bug #52998, Segmentation fault for OpenGL...

 
 

bug #52998: Segmentation fault for OpenGL printing of non-visible figures

Submitter:  Dan Sebald <sebald>
Submitted:  Mon 29 Jan 2018 06:24:11 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 27 Aug 2018 06:48:03 PM UTC, comment #11: 

Ok, thanks, closing report.

Pantxo Diribarne <pantxo>
Group Member
Mon 27 Aug 2018 04:53:41 PM UTC, comment #10: 

This is no longer a problem.  I've tested the same commands here and there is no crash, which is expected since the figure's for the manual have plotted fine in the Octave build for a while now.  Thanks.

Dan Sebald <sebald>
Mon 27 Aug 2018 03:03:58 PM UTC, comment #9: 

@Dan: Is this bug still relevant or should we close it?

Pantxo Diribarne <pantxo>
Group Member
Tue 30 Jan 2018 03:30:25 AM UTC, comment #8: 

This is what I got:

+verbose+
glxinfo -B
name of display: :1
display: :1  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: X.Org (0x1002)
    Device: AMD OLAND (DRM 2.50.0 / 4.14.14-300.fc27.x86_64, LLVM 5.0.0) (0x6610)
    Version: 17.2.4
    Accelerated: yes
    Video memory: 2048MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
....
OpenGL vendor string: X.Org
OpenGL renderer string: AMD OLAND (DRM 2.50.0 / 4.14.14-300.fc27.x86_64, LLVM 5.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.2.4
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

==========

LIBGL_ALWAYS_SOFTWARE=1 glxinfo -B
name of display: :1
display: :1  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0xffffffff)
    Device: llvmpipe (LLVM 5.0, 256 bits) (0xffffffff)
    Version: 17.2.4
    Accelerated: no
    Video memory: 15920MB
    Unified memory: no
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 5.0, 256 bits)
OpenGL version string: 2.1 Mesa 17.2.4
OpenGL shading language version string: 1.30

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 17.2.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
-verbatim-

Dmitri.
--


Dmitri A. Sergatskov <dasergatskov>
Tue 30 Jan 2018 02:19:18 AM UTC, comment #7: 

Thanks for the tip, but that doesn't work either:


linux@ ~/octave/bug/52998 $ LIBGL_ALWAYS_SOFTWARE=1 LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGL.so /usr/local/src/octave/octave/build1/run-octave --no-gui
[snip]
octave:1> graphics_toolkit qt
octave:2> set(gcf, 'visible', 'off')
octave:3> libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
exit
[hang]


SWRAST is one of the OpenGL drivers, deprecated.  I probably don't have it installed.  Strange this works to generate manual figures... I'm looking at that right now.

Dan Sebald <sebald>
Tue 30 Jan 2018 01:15:14 AM UTC, comment #6: 

Try:


LIBGL_ALWAYS_SOFTWARE=1 LD_PRELOAD=/usr/lib64/libGLX_mesa.so.0 octave


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 30 Jan 2018 01:11:12 AM UTC, comment #5: 

Yes, it probably is.  I just got confused with debugging, testing versions of code last night.  I usually use the prefix

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGL.so

these days for building, but don't always when testing.

However, this prefix doesn't lead to complete success.  FLTK appears to run fine, but Qt has problems:


octave:1> graphics_toolkit fltk
octave:2> set(gcf, 'visible', 'off')
octave:3> plot(1:50)
octave:4> print junk.pdf
octave:5> exit



octave:1> graphics_toolkit qt
octave:2> set(gcf, 'visible', 'off')
octave:3> plot(1:50)
octave:4> print junk.pdf
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
octave:5> exit

[process is hung right here and won't come back to command line]


So, I can't get this to work either way for Qt.  I'm going to test the changeset attached here

https://savannah.gnu.org/bugs/?52940#comment40

this evening for how well the output looks and see if that gets around the Nvidia hardware/driver issue.

Dan Sebald <sebald>
Tue 30 Jan 2018 12:48:39 AM UTC, comment #4: 

@Dan: Isn't this the same OSMesa bug reported multiple times?  It seems to depend on the particular HW involved.  Your code works for me.

Rik <rik5>
Group administrator
Tue 30 Jan 2018 12:37:32 AM UTC, comment #3: 

@Sahil: I think Dan is correct.  You have found a different bug that deserves its own bug report.  This is very likely related to https://savannah.gnu.org/bugs/?48703.  The problem is the tricky issue of signals and threads when the GUI is running.

Rik <rik5>
Group administrator
Mon 29 Jan 2018 08:37:28 PM UTC, comment #2: 

That sounds like a different bug, one related to the -dpswrite -PPS_printer option combination.  Should probably file a separate bug report for that one.

Dan Sebald <sebald>
Mon 29 Jan 2018 07:51:55 AM UTC, comment #1: 

I have also noticed a problem related to print lately:

When printing something to a printer, if the printer doesn't exist, octave exits with SIGABRT (signal 6).

The output for version 4.0.0 is (which works fine in handling the exception):


>> clf()
>> surf(peaks)
>> print -dpswrite -PPS_printer
lpr: PS_printer: unknown printer
warning: broken pipe

>>


While the output for version 4.2.1 (stable) is :


octave:1> clf()
octave:2> surf(peaks)
octave:3> print -dpswrite -PPS_printer
lpr: PS_printer: unknown printer
warning: broken pipe
error: gl2ps_renderer::draw: internal pipe error
terminate called after throwing an instance of 'octave::execution_exception'
panic: Aborted -- stopping myself...


Whereas, the following was the output for the dev branch:


octave:1> clf()
octave:2> surf(peaks)
octave:3> print -dpswrite -PPS_printer
lpr: PS_printer: unknown printer
  ./base/gsicc_manage.c:1088: gsicc_open_search(): Could not find default_gray.icc
| ./base/gsicc_manage.c:1708: gsicc_set_device_profile(): cannot find device profile
arg_st =

  scalar structure containing the fields:

    append_to_file = 0
    canvas_size = [](0x0)
    debug = 0
    debug_file = octave-print-commands.log
    devopt = pswrite
    epstool_binary = /usr/bin/epstool
    figure =  1
    fig2dev_binary = /usr/bin/fig2dev
    fontsize =
    font =
    scalefontsize =  1
    force_solid = 0
    formatted_for_printing = 0
    ghostscript =

      scalar structure containing the fields:

        binary = /usr/bin/gs
        debug = 0
        device =
        epscrop = 1
        level =  2
        output =
        papersize =
        pageoffset = [](0x0)
        resolution =  150
        antialiasing = 0
        antialiasing_textalphabits =  4
        antialiasing_graphicsalphabits =  1

    loose = 0
    lpr_binary = /usr/bin/lpr
    name =
    orientation =
    pstoedit_binary = /usr/bin/pstoedit
    preview =
    printer = -PPS_printer
    send_to_printer = 0
    special_flag = textnormal
    tight_flag = 0
    use_color = 0
    lpr_options = -l
    unlink = {}(0x0)

error: gl2ps_renderer::draw: internal pipe error
terminate called after throwing an instance of 'octave::execution_exception'
fatal: caught signal Aborted -- stopping myself...


I could've posted it as a new bug but thought of it as almost the same problem that you encoutered and so posted it here as a comment.
 

Sahil <batterylow>
Mon 29 Jan 2018 06:24:11 AM UTC, original submission:  

Both Qt and FLTK toolkits are crashing with the following (changeset: 24636:9d01ce02d5cb) :


octave:1> graphics_toolkit qt
octave:2> set(gcf, 'visible', 'off')
octave:3> plot(1:50)
octave:4> print junk.pdf
fatal: caught signal Segmentation fault -- stopping myself...
Segmentation fault



octave:1> graphics_toolkit fltk
octave:2> set(gcf, 'visible', 'off')
octave:3> plot(1:50)
octave:4> print junk.pdf
fatal: caught signal Segmentation fault -- stopping myself...
Segmentation fault


while gnuplot toolkit seems to work


octave:1> graphics_toolkit gnuplot
octave:2> set(gcf, 'visible', 'off')
octave:3> plot(1:50)
octave:4> print junk.pdf
octave:5> exit


Here might be a clue from FLTK toolkit:


octave:1> graphics_toolkit fltk
octave:2> plot (1:10, 'o-')
octave:3> set(gcf, 'visible', 'off')
octave:4> print tst.pdf
error: __osmesa_print__: Depth and stencil doesn't match, are you sure you are using OSMesa >= 9.0?
error: called from
    __opengl_print__ at line 161 column 7
    print at line 552 column 14
octave:4> exit


while for Qt toolkit this also produces a crash:


octave:1> graphics_toolkit qt
octave:2> plot (1:10, 'o-')
octave:3> set(gcf, 'visible', 'off')
octave:4> print tst.pdf
fatal: caught signal Segmentation fault -- stopping myself...
Segmentation fault


I noted the changeset above (24636:9d01ce02d5cb) because there is some activity around this time regarding "print" ( http://savannah.gnu.org/bugs/?52940 ) that could fix this issue for at least Qt toolkit.

Dan Sebald <sebald>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (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 batterylow (Posted a comment)
  • -email is unavailable- added by sebald (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-08-27 pantxo StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2018-01-30 rik5 StatusNone Works For Me

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code