Sometimes testing OpenGL compatibility crashes

Bug #1676915 reported by Chris Pavlina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Won't Fix
Medium
Chris Pavlina

Bug Description

Due to general quirkiness in various libraries (this spans OpenGL itself, X11, wxWidgets, GTK, possibly other platforms' libs as well), sometimes it isn't possible to test OpenGL support without crashing KiCad.

My planned fix for this is to write an executable "kicad-ogltest" that performs the test itself. Any crashes will be contained in this process, and KiCad can watch whether it exits cleanly. It will be necessary to disable crash reporting in this executable on various platforms so the OS doesn't "helpfully" tell the user a program crashed...this can probably be done by intercepting SIGSEGV and SIGABRT on Linux and macOS, though I have to test this, and can be done directly via the Windows API there.

Application: kicad
Version: (2017-03-27 revision 731b2b8a6)-master, debug build
Libraries: wxWidgets 3.0.2
           libcurl/7.53.1 OpenSSL/1.0.2k zlib/1.2.11 libpsl/0.17.0 (+libicu/58.2) libssh2/1.8.0
Platform: Linux 4.10.5-1-ARCH x86_64, 64 bit, Little endian, wxGTK
- Build Info -
wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.63.0
Curl: 7.53.1
KiCad - Compiler: GCC 6.3.1 with C++ ABI 1010
        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=OFF
                  BUILD_GITHUB_PLUGIN=ON
                  KICAD_USE_OCE=ON

Tags: opengl
Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

I've pushed a tool "kicad-ogltest" to master under utils/, which contains some preliminary tests to determine OpenGL compatibility. Once this tool has propagated to nightlies, I'm going to seek out KiCad users with unusual graphics configurations to run it and report its response.

Changed in kicad:
status: Triaged → In Progress
Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Hi Chris,

Nice, thank you very much for the tool. It should catch the problems that could not be handled due to early initalization errors.

I wonder whether you want to check for all OpenGL extensions used by the renderer. It could be done simply by displaying an OPENGL_GAL instance. Previously it has been done in pcbnew (see revert of 88eb648cb).

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Oh, good point, I should see if I can get an OPENGL_GAL instance up in the test binary.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Okay, I made it use OPENGL_GAL. Kept my existing version check even though OPENGL_GAL::init does its own, mainly because I want to see the versions in the output from users...

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Turns out testing for OpenGL issues in a truly solid, crash-proof way is, uh, difficult.

I'm thinking of reframing this: what if I wrote a crash monitor that made KiCad handle crashes a bit more gracefully? Offer to help the user collect some information to file a bug report, offer to set GAL to Cairo for them, restore the autosave backups and so on. Then we at least have a graceful way to handle crashes that do happen, and I don't think I'll ever be able to eliminate all of them.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1676915] Re: Sometimes testing OpenGL compatibility crashes

I'm comfortable with this. I'm sure users will prefer it to crashing
and potentially loosing work.

On 7/17/2017 3:05 PM, Chris Pavlina wrote:
> Turns out testing for OpenGL issues in a truly solid, crash-proof way
> is, uh, difficult.
>
> I'm thinking of reframing this: what if I wrote a crash monitor that
> made KiCad handle crashes a bit more gracefully? Offer to help the user
> collect some information to file a bug report, offer to set GAL to Cairo
> for them, restore the autosave backups and so on. Then we at least have
> a graceful way to handle crashes that do happen, and I don't think I'll
> ever be able to eliminate all of them.
>

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Great. As someone who has to deal with vague bug reports I've wanted this sort of thing for a while, to be honest, completely separately from the OpenGL problem. I'm going to do research into good ways to get usable stack traces from such a thing. I have some ideas that could be really valuable to the dev team.

This is something worth some real discussion, so I'm going to gather information and make a more detailed post to the mailing list. I'm going to close this specific bug since I'm going about fixing it a different way.

Changed in kicad:
status: In Progress → Won't Fix
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

wxDebugReport may or may not be useful but it's available.

On 7/17/2017 4:52 PM, Chris Pavlina wrote:
> Great. As someone who has to deal with vague bug reports I've wanted
> this sort of thing for a while, to be honest, completely separately from
> the OpenGL problem. I'm going to do research into good ways to get
> usable stack traces from such a thing. I have some ideas that could be
> really valuable to the dev team.
>
> This is something worth some real discussion, so I'm going to gather
> information and make a more detailed post to the mailing list. I'm going
> to close this specific bug since I'm going about fixing it a different
> way.
>
> ** Changed in: kicad
> Status: In Progress => Won't Fix
>

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

It's got some issues.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.