3d-viewer segfaults when raytracing if OpenGL 2.1 is not available

Bug #1797500 reported by Seth Hillbrand on 2018-10-12
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
High
Wayne Stambaugh

Bug Description

backtrace:
#0 0x0000000000000000 in ?? ()
#1 0x00007fffe1f71a8c in C3D_RENDER_RAYTRACING::Redraw (this=0x55555c629590, aIsMoving=false, aStatusTextReporter=0x7fffffffd6f0)
    at /home/seth/code/kicad/kicad-launchpad/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_raytracing.cpp:251
#2 0x00007fffe1f556bd in EDA_3D_CANVAS::OnPaint (this=0x55555c6274b0, event=...)
    at /home/seth/code/kicad/kicad-launchpad/3d-viewer/3d_canvas/eda_3d_canvas.cpp:392
#3 0x00007ffff634440e in wxAppConsoleBase::CallEventHandler (this=0x5555559bb1e0, handler=0x55555c6274b0, functor=..., event=...)
    at ../src/common/appbase.cpp:623
#4 0x00007ffff64c9ea5 in wxEvtHandler::ProcessEventIfMatchesId (entry=..., handler=<optimized out>, event=...)
    at ../src/common/event.cpp:1392
#5 0x00007ffff64c9f9b in wxEventHashTable::HandleEvent (this=<optimized out>, event=..., self=self@entry=0x55555c6274b0)
    at ../src/common/event.cpp:998
#6 0x00007ffff64ca34b in wxEvtHandler::TryHereOnly (this=0x55555c6274b0, event=...) at ../src/common/event.cpp:1589
#7 0x00007ffff64ca3d3 in wxEvtHandler::TryBeforeAndHere (event=..., this=0x55555c6274b0) at ../include/wx/event.h:3671
#8 wxEvtHandler::ProcessEventLocally (this=0x55555c6274b0, event=...) at ../src/common/event.cpp:1522
#9 0x00007ffff64ca435 in wxEvtHandler::ProcessEvent (this=0x55555c6274b0, event=...) at ../src/common/event.cpp:1495
#10 0x00007ffff64caef3 in wxEvtHandler::ProcessPendingEvents (this=0x55555c6274b0) at ../src/common/event.cpp:1359
#11 0x00007ffff6346bff in wxAppConsoleBase::ProcessPendingEvents (this=0x5555559bb1e0) at ../src/common/appbase.cpp:520
#12 0x00007ffff6c21e0a in wxApp::DoIdle (this=0x5555559bb1e0) at ../src/gtk/app.cpp:136
#13 0x00007ffff6c21ef3 in wxapp_idle_callback () at ../src/gtk/app.cpp:107
#14 0x00007ffff24006aa in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff2400a60 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff2400d82 in g_main_loop_run () from /lib/x86_64-linux-gnu/libglib-2.0.so.0

Application: kicad
Version: (6.0.0-rc1-dev-880-g92758ea4e), debug build
Libraries:
    wxWidgets 3.0.2
Platform: Linux 4.9.0-8-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    OpenCASCADE Community Edition: 6.8.0
    Compiler: GCC 6.3.0 with C++ ABI 1010

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=OFF
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Wayne Stambaugh (stambaughw) wrote :

@Seth, I'm surprised the 3D viewer doesn't crash when there is no openGL. AFAIK, the 3D viewer requires opengl for rendering and does not use cairo or any other device context. Is there some way to disable the ray tracing if opengl is missing?

Changed in kicad:
status: New → Incomplete
Seth Hillbrand (sethh) wrote :

I should have been more clear. It doesn't do the OpenGL version check. So rendering works with some artifacts (depending on what's available) but raytracing requires something that is not available.

We could utilize the OpenGL check before launching the 3d-viewer. That will catch most issues.

summary: - 3d-viewer segfaults when raytracing if OpenGL is not available
+ 3d-viewer segfaults when raytracing if OpenGL 2.1 is not available
tags: added: 3d-viewer
Wayne Stambaugh (stambaughw) wrote :

It should be enough to just disable the ray tracing button when opengl isn't new enough to support it.

Launchpad Janitor (janitor) wrote :

[Expired for KiCad because there has been no activity for 60 days.]

Changed in kicad:
status: Incomplete → Expired
Wayne Stambaugh (stambaughw) wrote :

@Seth, I finally found some time to take a look at this. I don't have a version of OpenGL to test this but I simulated by changing the minimum OpenGL version to something higher than the version I am using. Please test this on whatever platform you used to generate this bug report when you get a chance so I can get this fixed for 5.1.

Changed in kicad:
status: Expired → Triaged
importance: Undecided → High
assignee: nobody → Wayne Stambaugh (stambaughw)
status: Triaged → In Progress
milestone: none → 5.1.0
Seth Hillbrand (sethh) wrote :

Hi Wayne-

Works nicely. Thanks!

Wayne Stambaugh (stambaughw) wrote :

@Seth, thank for testing this.

Maciej Suminski (orsonmmz) wrote :

(Replacing Janitor today)

Fixed in commit 75f18cfe62d84be0a2f997b5f61274f15a3c6170
https://git.launchpad.net/kicad/commit/?id=75f18cfe62d84be0a2f997b5f61274f15a3c6170

Frank Severinsen (shack) wrote :

Orson/Janitor you forgot to set this bug as fix committed

Seth Hillbrand (sethh) on 2019-01-22
Changed in kicad:
status: In Progress → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers