[Solved] PCBNew crashing [Linux][v5.02]


I recently made major changes to my schematics and today when I finally got to use “Update PCB from schematic” in PCBNew, KiCad hang for 20 minutes with no apparent progress so I decided to kill it. Normally that process takes a second or two.

Now, whenever I try to open the PCB, KiCad crashes. This is happens for any project.

As such, there has to be something outside of my projects that causes the KiCad to crash.

So, where does KiCad store its temporary files? Is there a log I can get some information out of to determine what’s going on?

Realized that I installed some plugins today too - after removing them PCBNew opens. I’ll have to dig deeper to see which one.

For clarification - I had PCBNew open while installing the plugins so the crash didn’t happen until I wanted to update the PCB from the schematics/reopen PCBNew.

Are you using Ubuntu 18.04?

I do, yes. Known issue?

Opened an issue for the plugin: https://github.com/MitjaNemec/Kicad_action_plugins/issues/30

Yes. It is the main reason for v5.1. Ubuntu doesn’t ship wx scripting for gtk2. So it loads gtk3 on top of gtk2. This crashes.


Oh, I see. Is there a nightly of 5.1 available for Linux (with KICAD_SCRIPTING_WXPYTHON enabled) available?

Edit: Found it 15 seconds later: https://kicad.org/download/ubuntu/

Hm, turns out the nightly is v6 - is there a nightly 5.1 somewhere?

Nightly that is labeled v6 is actually v5.1. Or to be pedantic, 5.1 release will be cut from master branch which is tagged as v6 right now.
But either way I don’t think ubuntu 18 nightlies have scripting enabled right now. There was talk on mailing list to provide one with gtk3 and scripting enabled, not sure if that ever materialized.

1 Like

Yes, KICAD_SCRIPTING_WXPYTHON is off in that build.

I’m curious - if 6/5.1 is meant to adress the issue of gtk3, then why is scripting disabled?

Because scripting is tied to gtk3 support which is still experimental. It will be enabled at some point before 5.1 is released.


Here’s the relevant discussion: https://lists.launchpad.net/kicad-developers/msg39010.html


So the easiest way seems to be to run KiCad on Windows, just to run the script. That is, if there is an available build with scripting enabled?

The more correct way would be that the plugin authors would check the required versions.

As long as import wx[$something] is used in the files of a plugin (which is happen in every plugin with some UI) it will use than the package python-wxgtk3.0. And this package is currently build against GTK+3 only on Debian and all the derivates like Ubuntu.
So if the plugin would simply check if the linked GTK+ version is equal for the pcbnew Python package with the python-wxgtk3.0 version this all wouldn’t happen. There are some sanity checks missing.

It’s not KiCad to blame here, it’s the responsibility of the plugin authors to ensure the usability.

It might be possible that some version strings are currently missing in the pcbnew Python module to make this functional right now. I’ve no knowledge about these internals. But should be fixable. python-wxgtk3.0 is providing such information in wx/build/build_options.py.

I believe the author of the particular script is already doing that to prevent crashes, but that still won’t let me run it. So the way for me is to run it on Windows where it apparently works.

It’s not that simple. KiCad itself uses wxpython when scripting is enabled. I think for scripting console, maybe not just that. Pcbnew will crash even without plugins if you try enabling scripting on a system that doesn’t have wxpython linked against gtk2.

Alternatively you can compile kicad with gtk3 if you are familiar with basic build tools

1 Like

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