Crash when starting the 3D Viewer

Hello,
I’m using the nightlies (just compiled a new one), but I’ve had this issue for the past week or so.

When I run anything that invokes the 3D viewer “subsystem”, KiCad crashes.

Here’s a backtrace of the issue…I start kicad, load a PCB and start the 3D viewer:

(kicad:40703): Gtk-CRITICAL **: 11:07:03.996: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkNotebook

(kicad:40703): Gtk-CRITICAL **: 11:07:04.003: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(kicad:40703): Gdk-ERROR **: 11:07:04.129: The program 'kicad' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadValue (integer parameter out of range for operation)'.
  (Details: serial 158874 error_code 2 request_code 151 (GLX) minor_code 0)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the GDK_SYNCHRONIZE environment
   variable to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Thread 1 "kicad" received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff65ce104 in g_log_writer_default () from /usr/lib/libglib-2.0.so.0
(gdb) b gdk_x_error
Function "gdk_x_error" not defined.
(gdb) bt
#0  0x00007ffff65ce104 in g_log_writer_default () at /usr/lib/libglib-2.0.so.0
#1  0x00007ffff65cb959 in g_log_structured_array () at /usr/lib/libglib-2.0.so.0
#2  0x00007ffff65cbeb1 in g_log_structured_standard () at /usr/lib/libglib-2.0.so.0
#3  0x00007ffff5f44577 in  () at /usr/lib/libgdk-3.so.0
#4  0x00007ffff5c1daa5 in _XError () at /usr/lib/libX11.so.6
#5  0x00007fffe1e43ffc in  () at /usr/lib/libGLX_mesa.so.0
#6  0x00007fffc2cadc20 in EDA_3D_CANVAS::initializeOpenGL() () at /usr/lib/kicad-nightly/bin/_pcbnew.kiface
#7  0x00007fffc2cb2a10 in EDA_3D_CANVAS::DoRePaint() () at /usr/lib/kicad-nightly/bin/_pcbnew.kiface
#8  0x00007ffff74af4c1 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#9  0x00007ffff74af5c4 in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
    at /usr/lib/libwx_baseu-3.0.so.0
#10 0x00007ffff74af90e in wxEvtHandler::TryHereOnly(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#11 0x00007ffff74af994 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#12 0x00007ffff74afa32 in wxEvtHandler::ProcessEvent(wxEvent&) () at /usr/lib/libwx_baseu-3.0.so.0
#13 0x00007ffff74b0441 in wxEvtHandler::ProcessPendingEvents() () at /usr/lib/libwx_baseu-3.0.so.0
#14 0x00007ffff7329cf0 in wxAppConsoleBase::ProcessPendingEvents() () at /usr/lib/libwx_baseu-3.0.so.0
#15 0x00007ffff78132fa in wxApp::DoIdle() () at /usr/lib/libwx_gtk3u_core-3.0.so.0
#16 0x00007ffff7813424 in  () at /usr/lib/libwx_gtk3u_core-3.0.so.0
#17 0x00007ffff65c48f4 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#18 0x00007ffff6618821 in  () at /usr/lib/libglib-2.0.so.0
#19 0x00007ffff65c3e43 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#20 0x00007ffff6a9b22f in gtk_main () at /usr/lib/libgtk-3.so.0
#21 0x00007ffff7830856 in wxGUIEventLoop::DoRun() () at /usr/lib/libwx_gtk3u_core-3.0.so.0
#22 0x00007ffff7365e0e in wxEventLoopBase::Run() () at /usr/lib/libwx_baseu-3.0.so.0#23 0x00007ffff732af27 in wxAppConsoleBase::MainLoop() () at /usr/lib/libwx_baseu-3.0.so.0
#24 0x00005555557358ca in  ()
#25 0x00007ffff73b97f9 in wxEntry(int&, wchar_t**) () at /usr/lib/libwx_baseu-3.0.so.0
#26 0x000055555570eaa9 in  ()
#27 0x00007ffff5fda152 in __libc_start_main () at /usr/lib/libc.so.6
#28 0x000055555572052e in _start ()
(gdb) 

I don’t know how to follow the instructions about breaking on gdk_x_error() , so if that would help, I would need a little guidance on how to enable that, but otherwise, I’m not sure where to start looking to get to the bottom of a GDK issue like this…

Thanks!

First I would try a completely clean build.

i’ve cleaned my build directory with rm -rf kicad-nightly/ and then trizen -Sl kicad-nightly…Is that what you mean?

Would you like to create a gitlab bug report for that?
with details about your OS, GPU, etc
Are you able to use pcbnew with accelerated graphics?

you may have somewhere logs from X

Yes, if that includes all cmake configs etc. so that you start from scratch.

I have seen this problem myself but can’t remember what it was about.

Hello,

Yes…I have submitted an issue here: https://gitlab.com/kicad/code/kicad/-/issues/6719

Thank you!

1 Like

I don’t know if this matters…I’m somewhat new to CMake since I’ve always used handspun makefiles, but I did ccache --clear as well.

Issue persists.

For those following along at home, the issue was with my vdeo drivers!
Check the dramatic conclusion here:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.