bugGNU Octave - Bugs: bug #63700, Octave GUI freezes when printing...

 
 

bug #63700: Octave GUI freezes when printing to svg with system opengl drivers

Submitter:  Hartmut <hardy>
Submitted:  Wed 25 Jan 2023 10:02:44 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 8.0.90 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 26 Apr 2024 02:52:45 AM UTC, comment #22: 

now i just saw bug #64362, which pointed out svg hangs/crashes with system opengl driver. we recently opted to close that as a 'won't fix'. this appears to be the same issue.  also closing report as wont fix.  as that one is direct to the problem any solutions should probably get posted over there.

Nicholas Jankowski <nrjank>
Group Member
Fri 26 Apr 2024 02:11:55 AM UTC, comment #21: 

I didn't see other bugs out there about this specific issue. renaming the bug to better reflect where the problem lies.

Nicholas Jankowski <nrjank>
Group Member
Thu 25 Apr 2024 06:33:03 PM UTC, comment #20: 

just updating that this problem persists in octave 9.1.0, testing on w64 with 'system' opengl drivers.  tests pass with software drivers. with the comment #18 tests, it hangs on the n.run_all (); line.  stepping through the test, the hang occurs on

obj.run (i); when i = 8

that particular cell contains:


nbcell = obj.notebook.cells{cell_index};

nbcell
nbcell =

  scalar structure containing the fields:

    cell_type = code
    execution_count = 6
    metadata =

      scalar structure containing the fields:


    outputs =
    {
      [1,1] =

        scalar structure containing the fields:

          data =

            scalar structure containing the fields:

              image/svg+xml: 434x1 cell
              text/plain: 1x1 cell

          metadata =

            scalar structure containing the fields:


          output_type = display_data

    }

    source =
    {
      [1,1] = %plot -f svg -w 600

      [2,1] =

      [3,1] = % butterworth filter, order 2, cutoff pi/2 radians

      [4,1] = b = [0.292893218813452  0.585786437626905  0.292893218813452];

      [5,1] = a = [1  0  0.171572875253810];

      [6,1] = freqz(b, a, 32);
    }


the code hangs when it dives dives down to calling the embed_svg_image subfunction, calling the line 664:


print (figHandle, image_path, "-dsvg", ["-r" printOptions.resolution]);


the values of those inputs when it hangs are:


debug> figHandle
figHandle = 1
debug> image_path
image_path = c:\Octave\Temp\oct-TlU1aN\temp.svg
debug> printOptions
printOptions =

  scalar structure containing the fields:

    imageFormat = svg
    resolution = 0
    width = 600
    height = 480


the is no obvious issue with the figure.  if I do a Save As from the figure menu, it saves fine as raster images, but when I try to save it as a SVG, it hangs the same way.

So, based on the print -dsvg hanging the same way as Save As SVG, it seems like this bug should be able to be narrowed down to that issue, and it likely has nothing specific to do with jupyter notebook.


Are there any current bugs related to hangs/crashes when printing to SVG and using the hardware OpenGL drivers?

Nicholas Jankowski <nrjank>
Group Member
Fri 03 Feb 2023 01:08:28 AM UTC, comment #19: 

I also see "GL2PS warning: Unknown token in buffer" if I use fltk
backend. I wonder if the problem with gl2ps -- plotting works, printing does not.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 02 Feb 2023 01:23:29 AM UTC, comment #18: 

The following hangs octave for me (Intel 630 driver)

>> cd "C:/Program Files/GNU Octave/Octave-8.0.91/mingw64/share/octave/8.0.91/etc/tests/fixed/jupyter-notebook"
>> n = jupyter_notebook (fullfile ("octave_kernel.ipynb"));
>> n.run_all ();


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 02 Feb 2023 12:14:52 AM UTC, comment #17: 

adding - i never did a w32 check on a w32 system. Maybe my issue is only stemming from trying to test the w32 version on w64 platforms. Did this release candidate get any checks on such a platform?  It would help determining which recommendation to give to anyone running w32.

Nicholas Jankowski <nrjank>
Group Member
Wed 01 Feb 2023 10:08:41 PM UTC, comment #16: 

I notice the jupyter-notebook crash occurs on w32 and w64 versions, but IIRC we made the opengl switcher after determining the w32 version might need a switch to the system driver to avoid frequent graphics crashes (mine could not get through 'demo light' or the test suite without crashing to desktop for w32 8.0.90). Recommending they switch to software driver to get through this test conflicts with that initial reasoning. Maybe we shouldn't make this rec. for w32 users?  (or, as Markus said elsewhere, maybe it's time to give up on w32...)

Nicholas Jankowski <nrjank>
Group Member
Wed 01 Feb 2023 09:29:36 PM UTC, comment #15: 

On my laptop (i9-9880h) when using intel driver,
plot(1:3), print("t1.svg') will hang the octave with 100% cpu load.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 01 Feb 2023 09:20:02 PM UTC, comment #14: 

Could someone able to trigger the dead-lock try to pinpoint exactly which figure from which of the 4 test scripts is responsible.
I don't mean to hijack this bug report, just noting that it would be helpful to know exactly what is the problematic print operation.

Pantxo Diribarne <pantxo>
Group Member
Wed 01 Feb 2023 09:19:19 PM UTC, comment #13: 

@markus - this may work. It appears to find intel video drivers ok - untested for non intel ones



(file #54294)

John Donoghue <lostbard>
Group Member
Tue 31 Jan 2023 08:55:46 AM UTC, comment #12: 

Maybe, we could default to the software OpenGL renderer if we detect on installation time that an Intel graphics driver is installed/used.
@lostbard: Would that even be possible?

Alternatively, we could add a note in the README file of Octave for Windows that advices users with Intel graphics to select "Software OpenGL" during installation or switch to it using the "OpenGL Switcher" from the Start menu.

Markus Mützel <mmuetzel>
Group administrator
Tue 31 Jan 2023 07:33:22 AM UTC, comment #11: 

When I switch to the opengl software renderer (same PC as in all my previous comments), then the unit test jupyter-notebook.tst passes fine. So on this machine I only see the failing test with the hardware opengl (which is from a builtin Intel graphics).

Hartmut <hardy>
Wed 25 Jan 2023 07:09:13 PM UTC, comment #10: 

I can also confirm on Win10 with hybrid Intel/Nvidia graphics.
I tried to configure Windows to use Nvidia ("Performance Graphics) for octave, but octave always seems to use Intel's.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Wed 25 Jan 2023 04:45:33 PM UTC, comment #9: 

gdb trace attached. also noting that with my issue, sometning about the test is creating an endless loop slowly growing temp file that fills the disk (last time i stopped it at 15GB).

(file #54262)

Nicholas Jankowski <nrjank>
Group Member
Wed 25 Jan 2023 04:19:56 PM UTC, comment #8: 

just adding that I'm getting the same issue trying to run the 8.0.90 w32 version. For me this does appear the same as reported in  bug #63553. I'll also try to generate and attach a gdb trace.

Nicholas Jankowski <nrjank>
Group Member
Wed 25 Jan 2023 02:54:10 PM UTC, comment #7: 

Find attached a text file with the output of gdb after attaching it to the PID of a stuck Octave CLI.

(file #54261)

Hartmut <hardy>
Wed 25 Jan 2023 02:44:27 PM UTC, comment #6: 

There are some instructions on the Wiki:
https://wiki.octave.org/Debugging_Octave

In this case, it might be best to attach to the hanging Octave using its PID.
For this, start Octave and execute `getpid()` to display the PID of the Octave process.
Then, run whatever commands it takes to get Octave "stuck".
When it is stuck, open the bash, e.g., using the "Bash Shell" shortcut in the Start menu group for Octave, and attach gdb to the hanging process with `gdb -p PID` (using the PID from before).
On the `(gdb)` prompt execute `thread apply all bt` and copy its entire output to a file.

Markus Mützel <mmuetzel>
Group administrator
Wed 25 Jan 2023 02:33:11 PM UTC, comment #5: 

Yes, I can reproduce this on my machine. When first cd to the folder with this unit test, and then call "test 'jupyter-notebook.tst' I can always freeze my Octave process.

When doing this with Octave GUI, the whole windows becomes unresponsive. When doing this with Octave CLI, the window stays "alive", but Octave does not react any more, not even to Ctrl+C  in the CLI.

In Octave CLI I additionally get some warnings displayed before it freezes:

octave:16> test "jupyter-notebook.tst"
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer
GL2PS warning: Unknown token in buffer


I do not know how to generate a gdb backtrace. If you still consider this useful to get, please point me to some explanation how to do this.

Hartmut <hardy>
Wed 25 Jan 2023 01:56:02 PM UTC, comment #4: 

Here is my output from _opengl_info_:

>> __opengl_info__
   version: 4.6.0 - Build 27.20.100.9171
    vendor: Intel
  renderer: Intel(R) UHD Graphics 620
extensions:
  GL_3DFX_texture_compression_FXT1
  GL_AMD_depth_clamp_separate
  GL_AMD_vertex_shader_layer
  GL_AMD_vertex_shader_viewport_index
  GL_ARB_ES2_compatibility
  GL_ARB_ES3_1_compatibility
  GL_ARB_ES3_compatibility
  GL_ARB_arrays_of_arrays
  GL_ARB_base_instance
  GL_ARB_bindless_texture
  GL_ARB_blend_func_extended
  GL_ARB_buffer_storage
  GL_ARB_cl_event
  GL_ARB_clear_buffer_object
  GL_ARB_clear_texture
  GL_ARB_clip_control
  GL_ARB_color_buffer_float
  GL_ARB_compatibility
  GL_ARB_compressed_texture_pixel_storage
  GL_ARB_compute_shader
  GL_ARB_conditional_render_inverted
  GL_ARB_conservative_depth
  GL_ARB_copy_buffer
  GL_ARB_copy_image
  GL_ARB_cull_distance
  GL_ARB_debug_output
  GL_ARB_depth_buffer_float
  GL_ARB_depth_clamp
  GL_ARB_depth_texture
  GL_ARB_derivative_control
  GL_ARB_direct_state_access
  GL_ARB_draw_buffers
  GL_ARB_draw_buffers_blend
  GL_ARB_draw_elements_base_vertex
  GL_ARB_draw_indirect
  GL_ARB_draw_instanced
  GL_ARB_enhanced_layouts
  GL_ARB_explicit_attrib_location
  GL_ARB_explicit_uniform_location
  GL_ARB_fragment_coord_conventions
  GL_ARB_fragment_layer_viewport
  GL_ARB_fragment_program
  GL_ARB_fragment_program_shadow
  GL_ARB_fragment_shader
  GL_ARB_fragment_shader_interlock
  GL_ARB_framebuffer_no_attachments
  GL_ARB_framebuffer_object
  GL_ARB_framebuffer_sRGB
  GL_ARB_geometry_shader4
  GL_ARB_get_program_binary
  GL_ARB_get_texture_sub_image
  GL_ARB_gl_spirv
  GL_ARB_gpu_shader5
  GL_ARB_gpu_shader_fp64
  GL_ARB_half_float_pixel
  GL_ARB_half_float_vertex
  GL_ARB_indirect_parameters
  GL_ARB_instanced_arrays
  GL_ARB_internalformat_query
  GL_ARB_internalformat_query2
  GL_ARB_invalidate_subdata
  GL_ARB_map_buffer_alignment
  GL_ARB_map_buffer_range
  GL_ARB_multi_bind
  GL_ARB_multi_draw_indirect
  GL_ARB_multisample
  GL_ARB_multitexture
  GL_ARB_occlusion_query
  GL_ARB_occlusion_query2
  GL_ARB_pipeline_statistics_query
  GL_ARB_pixel_buffer_object
  GL_ARB_point_parameters
  GL_ARB_point_sprite
  GL_ARB_polygon_offset_clamp
  GL_ARB_post_depth_coverage
  GL_ARB_program_interface_query
  GL_ARB_provoking_vertex
  GL_ARB_query_buffer_object
  GL_ARB_robust_buffer_access_behavior
  GL_ARB_robustness
  GL_ARB_robustness_isolation
  GL_ARB_sample_shading
  GL_ARB_sampler_objects
  GL_ARB_seamless_cube_map
  GL_ARB_seamless_cubemap_per_texture
  GL_ARB_separate_shader_objects
  GL_ARB_shader_atomic_counter_ops
  GL_ARB_shader_atomic_counters
  GL_ARB_shader_bit_encoding
  GL_ARB_shader_draw_parameters
  GL_ARB_shader_group_vote
  GL_ARB_shader_image_load_store
  GL_ARB_shader_image_size
  GL_ARB_shader_objects
  GL_ARB_shader_precision
  GL_ARB_shader_stencil_export
  GL_ARB_shader_storage_buffer_object
  GL_ARB_shader_subroutine
  GL_ARB_shader_texture_image_samples
  GL_ARB_shading_language_100
  GL_ARB_shading_language_420pack
  GL_ARB_shading_language_packing
  GL_ARB_shadow
  GL_ARB_spirv_extensions
  GL_ARB_stencil_texturing
  GL_ARB_sync
  GL_ARB_tessellation_shader
  GL_ARB_texture_barrier
  GL_ARB_texture_border_clamp
  GL_ARB_texture_buffer_object
  GL_ARB_texture_buffer_object_rgb32
  GL_ARB_texture_buffer_range
  GL_ARB_texture_compression
  GL_ARB_texture_compression_bptc
  GL_ARB_texture_compression_rgtc
  GL_ARB_texture_cube_map
  GL_ARB_texture_cube_map_array
  GL_ARB_texture_env_add
  GL_ARB_texture_env_combine
  GL_ARB_texture_env_crossbar
  GL_ARB_texture_env_dot3
  GL_ARB_texture_filter_anisotropic
  GL_ARB_texture_float
  GL_ARB_texture_gather
  GL_ARB_texture_mirror_clamp_to_edge
  GL_ARB_texture_mirrored_repeat
  GL_ARB_texture_multisample
  GL_ARB_texture_non_power_of_two
  GL_ARB_texture_query_levels
  GL_ARB_texture_query_lod
  GL_ARB_texture_rectangle
  GL_ARB_texture_rg
  GL_ARB_texture_rgb10_a2ui
  GL_ARB_texture_stencil8
  GL_ARB_texture_storage
  GL_ARB_texture_storage_multisample
  GL_ARB_texture_swizzle
  GL_ARB_texture_view
  GL_ARB_timer_query
  GL_ARB_transform_feedback2
  GL_ARB_transform_feedback3
  GL_ARB_transform_feedback_instanced
  GL_ARB_transform_feedback_overflow_query
  GL_ARB_transpose_matrix
  GL_ARB_uniform_buffer_object
  GL_ARB_vertex_array_bgra
  GL_ARB_vertex_array_object
  GL_ARB_vertex_attrib_64bit
  GL_ARB_vertex_attrib_binding
  GL_ARB_vertex_buffer_object
  GL_ARB_vertex_program
  GL_ARB_vertex_shader
  GL_ARB_vertex_type_10f_11f_11f_rev
  GL_ARB_vertex_type_2_10_10_10_rev
  GL_ARB_viewport_array
  GL_ARB_window_pos
  GL_ATI_separate_stencil
  GL_EXT_abgr
  GL_EXT_bgra
  GL_EXT_blend_color
  GL_EXT_blend_equation_separate
  GL_EXT_blend_func_separate
  GL_EXT_blend_minmax
  GL_EXT_blend_subtract
  GL_EXT_clip_volume_hint
  GL_EXT_compiled_vertex_array
  GL_EXT_direct_state_access
  GL_EXT_draw_buffers2
  GL_EXT_draw_range_elements
  GL_EXT_fog_coord
  GL_EXT_framebuffer_blit
  GL_EXT_framebuffer_multisample
  GL_EXT_framebuffer_object
  GL_EXT_geometry_shader4
  GL_EXT_gpu_program_parameters
  GL_EXT_gpu_shader4
  GL_EXT_multi_draw_arrays
  GL_EXT_packed_depth_stencil
  GL_EXT_packed_float
  GL_EXT_packed_pixels
  GL_EXT_polygon_offset_clamp
  GL_EXT_rescale_normal
  GL_EXT_secondary_color
  GL_EXT_separate_specular_color
  GL_EXT_shader_framebuffer_fetch
  GL_EXT_shader_integer_mix
  GL_EXT_shadow_funcs
  GL_EXT_stencil_two_side
  GL_EXT_stencil_wrap
  GL_EXT_texture3D
  GL_EXT_texture_array
  GL_EXT_texture_compression_s3tc
  GL_EXT_texture_edge_clamp
  GL_EXT_texture_env_add
  GL_EXT_texture_env_combine
  GL_EXT_texture_filter_anisotropic
  GL_EXT_texture_integer
  GL_EXT_texture_lod_bias
  GL_EXT_texture_rectangle
  GL_EXT_texture_sRGB
  GL_EXT_texture_sRGB_decode
  GL_EXT_texture_shared_exponent
  GL_EXT_texture_snorm
  GL_EXT_texture_storage
  GL_EXT_texture_swizzle
  GL_EXT_timer_query
  GL_EXT_transform_feedback
  GL_IBM_texture_mirrored_repeat
  GL_INTEL_conservative_rasterization
  GL_INTEL_fragment_shader_ordering
  GL_INTEL_framebuffer_CMAA
  GL_INTEL_map_texture
  GL_INTEL_multi_rate_fragment_shader
  GL_INTEL_performance_query
  GL_KHR_blend_equation_advanced
  GL_KHR_blend_equation_advanced_coherent
  GL_KHR_context_flush_control
  GL_KHR_debug
  GL_KHR_no_error
  GL_KHR_shader_subgroup
  GL_KHR_shader_subgroup_arithmetic
  GL_KHR_shader_subgroup_ballot
  GL_KHR_shader_subgroup_basic
  GL_KHR_shader_subgroup_clustered
  GL_KHR_shader_subgroup_quad
  GL_KHR_shader_subgroup_shuffle
  GL_KHR_shader_subgroup_shuffle_relative
  GL_KHR_shader_subgroup_vote
  GL_KHR_texture_compression_astc_hdr
  GL_KHR_texture_compression_astc_ldr
  GL_NV_blend_square
  GL_NV_conditional_render
  GL_NV_primitive_restart
  GL_NV_texgen_reflection
  GL_SGIS_generate_mipmap
  GL_SGIS_texture_edge_clamp
  GL_SGIS_texture_lod
  GL_SUN_multi_draw_arrays
  GL_WIN_swap_hint
  WGL_EXT_swap_control
>>


Hartmut <hardy>
Wed 25 Jan 2023 01:16:59 PM UTC, comment #3: 

Hm. If you can reproduce, maybe you could attach `gdb` to the Octave process while it is hanging and get the backtrace from all threads at that point with `thread apply all bt`.
Maybe, that could help finding where in the code the deadlock is happening (and if it is a deadlock).

What does `__opengl_info__` return for you?

I've mostly seen the crash from bug #63553 with the software OpenGL renderer.
Does it also deadlock for you with the software OpenGL renderer?

Markus Mützel <mmuetzel>
Group administrator
Wed 25 Jan 2023 01:10:08 PM UTC, comment #2: 

I used the (installation default) "system OpenGL" from my computer, and not the "software OpenGL".

Are there any useful tests or checks I could do on my machine, that would help to further narrow down this issue?

Hartmut <hardy>
Wed 25 Jan 2023 10:53:30 AM UTC, comment #1: 

I haven't seen this when running the unit tests here.

It might be related to the issue described in bug #63553. There might be something off with unlocking/locking the threads when printing. Maybe, that leads to the crash in that report and the deadlock for you.

Are you using the software or the system OpenGL drivers?
It looks like that makes a difference for me for the crash in the other report. Maybe, the timing is a bit different when the renderer is faster or slower...

Markus Mützel <mmuetzel>
Group administrator
Wed 25 Jan 2023 10:02:44 AM UTC, original submission:  

I have installed Octave 8.0.90 on a Win10 machine (official installer from alpha.gnu.org). When running _run_test_suite_ inside the Octave GUI, I get a frozen Octave GUI after some time. The last line in the file fntest.log is "processing C:\Octave\Octave-8.0.90\mingw64\share\octave\8.0.90\etc\tests\fixed\jupyter-notebook\jupyter-notebook.tst". The GUI window of Octave is not responding any more at this point. (I have not seem this problem before under linux OS.)
Does anyone else see this?

Hartmut <hardy>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #54294:  intel.patch added by lostbard (3KiB - text/x-patch)
file #54262:  jupytercrash_W32.txt added by nrjank (14KiB - text/plain - crash when running jupyter-notebook.tst in 8.0.90 w32 with system opengl)

 

Digest:
   bug dependencies.

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 lostbard (Updated the item)
  • -email is unavailable- added by mmuetzel
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by nrjank (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by hardy (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 12 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-26 nrjank StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
        Dependencies- Depends on bugs #64362
    2024-04-26 nrjank StatusNone Confirmed
    2024-04-26 nrjank SummaryOctave GUI freezes during unit test &quot;jupyter-notebook.tst&quot; with system opengl drivers Octave GUI freezes when printing to svg with system opengl drivers
    2024-04-25 nrjank SummaryOctave GUI (8.0.90) freezes during unit test &quot;jupyter-notebook.tst&quot; Octave GUI freezes during unit test "jupyter-notebook.tst" with system opengl drivers
    2023-02-01 lostbard Attached File- Added intel.patch, #54294
    2023-01-31 mmuetzel Carbon-Copy- Added lostbard
    2023-01-25 nrjank Attached File- Added jupytercrash_W32.txt, #54262
    2023-01-25 hardy Attached File- Added bdg@backtrace@of@stuck@Octave@CLI.txt, #54261
    2023-01-25 mmuetzel CategoryNone Plotting with OpenGL
        Item GroupNone Segfault, Bus Error, etc.

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code