pcbnew crashes on start compiled with KICAD_SCRIPTING_WXPYTHON=ON
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| KiCad |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
pcbnew crashes on start compiled with KICAD_SCRIPTING
Hi,
Operating system is Linux Kubuntu 13.10
I compiled kicad 2014-03-27 BZR 4770 with different options:
KICAD_SCRIPTING
KICAD_SCRIPTING
1) Start KiCAD
2) Start Pcbnew
pcbnew *crashes* on start when it is compiled with KICAD_SCRIPTING
Application: kicad
Version: (2014-03-27 BZR 4770)-product Release build
wxWidgets: Version 2.8.12 (release,
Platform: Linux 3.11.0-18-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
pcbnew *crashes not* on start when it is compiled with KICAD_SCRIPTING
Application: kicad
Version: (2014-03-27 BZR 4770)-product Release build
wxWidgets: Version 2.8.12 (release,
Platform: Linux 3.11.0-18-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
The kicad version downloaded from ppa on 27.03.14 and installed with the package managent has the same problem, pcbnew *crashes* on start.
I installed on two different computers.
If I start pcbnew with the console, I get the following messages:
~$ /usr/bin/pcbnew
Traceback (most recent call last):
File "/usr/lib/
from wx._core import *
File "/usr/lib/
import _core_
ImportError: /usr/lib/
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/
from apport.report import Report
File "/usr/lib/
from xml.parsers.expat import ExpatError
File "/usr/lib/
from pyexpat import *
ImportError: /usr/lib/
Original exception was:
Traceback (most recent call last):
File "/usr/lib/
from wx._core import *
File "/usr/lib/
import _core_
ImportError: /usr/lib/
Fontconfig warning: "/etc/fonts/
Segmentation fault (core dumped)
Ruediger
Thav (thavilden) wrote : | #1 |
Nick Østergaard (nickoe) wrote : | #2 |
Please retry, I think this is already fixed. http://
Please report back if it works now.
Ruediger Kluge (ruediger-kluge) wrote : | #3 |
I made the update of ppa:js-
In the Kubuntu package management it is called 0.201403281856+
pcbnew still crashes if I start with click from Kicad GUI.
The information from help -- copy version information is:
Application: kicad
Version: (2014-jan-
wxWidgets: Version 2.8.12 (release,
Platform: Linux 3.11.0-18-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
I compiled the version 4776 and installed this time in the default installation path (not in /opt/kicad) CMAKE_INSTALL_
pcbnew still crashes if I start with click from Kicad GUI.
The information from help -- copy version information is:
Application: kicad
Version: (2014-03-29 BZR 4776)-product Release build
wxWidgets: Version 2.8.12 (release,
Platform: Linux 3.11.0-18-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
Nick Østergaard (nickoe) wrote : | #4 |
It does not crashere on my ubuntu 13.10. Do you have python-lxml installed?
Application: kicad
Version: (2014-03-29 BZR 4775)-product Release build
wxWidgets: Version 2.8.12 (release,
Platform: Linux 3.11.0-18-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
Thav (thavilden) wrote : | #5 |
No change for me running 0.201403291813+
Nick Østergaard (nickoe) wrote : | #6 |
Ok, the python-lxml was also a wild shot. There is that undefined symbol: PyExc_ValueError that nags me.
Are you able to do "from pyexpat import *" in your python2 interpreter without the quotes succesfully?
Thav (thavilden) wrote : | #7 |
I am, I get no errors importing that.
Some additional info, output of 'dpkg -l | grep -i python'
http://
and output of 'dpkg -l | grep -i wx'
http://
In case those help at all. I'm more than happy to provide any more information you think might be useful. Thanks!
Ruediger Kluge (ruediger-kluge) wrote : | #8 |
I also can do "from pyexpat import *" succesfully.
Nick Østergaard (nickoe) wrote : | #9 |
I just noticed that I did not enable scripting in my build on ubuntu, so the claim that it worked for me is invalid. But I can't build with the options enabled on my ubuntu machine.
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.5", required is "2.6")
-- Check for installed Python Interpreter -- found
-- Python module install path: /usr/lib/
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_
-- Bazaar version control system version found.
-- Kicad Bazaar build version: (2014-03-29 BZR 4777)
CMake Error at /usr/share/
Could NOT find SWIG (missing: SWIG_EXECUTABLE SWIG_DIR)
Call Stack (most recent call first):
/usr/
/usr/
pcbnew/
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
PYTHON_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/foo/
>>bla bla bla more of theese lines<<
-- Configuring incomplete, errors occurred!
Thav (thavilden) wrote : | #10 |
A github issue on an unrelated project discusses a way to make cmake see swig
`cmake -DSWIG_
Hope that helps.
Thav (thavilden) wrote : | #11 |
https:/
^ forgot to post the URL in my last comment.
Dick Hollenbeck (dickelbeck) wrote : | #12 |
I am offering to fix this bug as part of milestone C) of modular-kicad blueprint, but not before I get to that point.
Your options now are:
a) revert to the tagged revision "pre-kiway" and build that version.
b) disable wxPython at newer version.
c) hope someone else fixes it sooner than I intend to.
Francesco Del Degan (pr0gg3d) wrote : | #13 |
Looking at it, seems that is just missing python library linking issue, because with:
LD_PRELOAD=
it works for me (r4805) . Anyone can confirm?
Aurabindo J (jay-aurabind) wrote : | #14 |
Yepp. I confirm.
I'm on a 64 bit Ubuntu 14.04, so its
LD_PRELOAD=
Aurabindo J (jay-aurabind) wrote : | #15 |
But How do I make pcbnew to launch properly when invoking from Kicad ? Is it safe to export LD_PRELOAD in /etc/profiles.
Nils Peter Hesse (nphesse) wrote : | #16 |
Hi,
quick fix for being able to launch pcbnew properly using the KiCAD GUI (this is for Ubuntu using sudo. If you're not on Ubuntu you may have to adapt the paths and/or the usage of the sudo command):
$ PCBNEW="$(which pcbnew)"
$ sudo mv ${PCBNEW} ${PCBNEW}.bin
$ sudo gedit $PCBNEW
Replace "gedit" with your preferred text editor.
Paste the following snippet into the editor and save (please make sure the first line in the file reads "#!/bin/bash"!):
#!/bin/bash
if [ "$(uname -p)" == "x86_64" ]; then
LD_
else
LD_
fi
# END OF SNIPPET
$ sudo chmod +x $PCBNEW
What does this do?
First, you get the full path to the current "pcbnew" executable (which pcbnew) and save it into a variable called "PCBNEW".
Then the executable is renamed to pcbnew.bin within the same directory ("mv $PCBNEW ${PCBNEW}.bin").
After that you create a new file with the same path & name as the original pcbnew executable and write a small bash script to it which does nothing else than to execute the pcbnew.bin file (which, if you remember, is the renamed original executable) using the LD_PRELOAD environment variable to make sure the shared library gets loaded.
The last command sets the executable flag on the newly created script which enables one to execute the script as if it were a binary executable program.
After that you've renamed the original pcbnew executable and replaced it with a small script which spawns the original executable with LD_PRELOAD.
Please remember upon the next update that you may have to re-do these steps - or remove the old pcbnew.bin if the issue was fixed.
Nils Peter Hesse (nphesse) wrote : | #17 |
I'm very sorry, there is a bug in the shell script. One should use this shell script instead:
#!/bin/bash
if [ "$(uname -p)" == "x86_64" ]; then
LD_
else
LD_
fi
# END OF SNIPPET
Please note the now appended "$@" when executing pcbnew and the now appended ".bin" for the 32bit command.
The first one is needed for forwarding command line parameters to the pcbnew executable (this is needed for e.g. loading files directly on startup).
The second one is needed for 32bit systems (sorry, I'm on x86_64 and didn't test this part) to execute the renamed pcbnew executable - not including this would cause an endless loop.
Sorry for this, I would love if one could edit comments on LP...
Nick Østergaard (nickoe) wrote : | #18 |
I just built 4830 with the three python options ON and now scripting works for me. I have no crash on start and the wizarads works.
I did have problems building with more than -j1, something with:
src/kicad/
that cmake apparently did not create. But that is probably for another bug report, so that I will not discuss further here.
Application: kicad
Version: (2014-04-25 BZR 4830)-kicad Release build
wxWidgets: Version 3.0.0 (debug,
Platform: Linux 3.14.1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.55.0
Nick Østergaard (nickoe) wrote : | #19 |
Ok, when I start i.e. pcbnew or eeschema direftly it do not crash, but when I start them from the kicad thing, then it segfaults.
Thav (thavilden) wrote : | #20 |
This is fixed for me in PPA version 0.201404290133+
Changed in kicad: | |
status: | New → Fix Committed |
Dick Hollenbeck (dickelbeck) wrote : | #21 |
http://
fixed by Jean-Samuel in rev. 4939.
Changed in kicad: | |
status: | Fix Committed → Fix Released |
I get the same crash on start when running packages from the PPA https:/ /code.launchpad .net/~js- reynaud/ +archive/ ppa-kicad
Linux Mint 14 (Uses Ubuntu 12.10 packages) +4774~12~ ubuntu12. 10.1) as well as others from up to five days ago when I first tried the PPA.
I get this trouble with a package that I got today (0.201403281856
The only other reference to this kind of error appears to be this thread: /groups. google. com/forum/ #!topic/ wxpython- users/cWBabXCeE wU
https:/
which suggests a mismatch between wxWidgets and wxPython. However, I see no mismatch:
tony@olympus /usr/share/ kicad/modules $ sudo dpkg -l | grep libwx 8-0:amd64 2.8.12. 1-11ubuntu3. 1 amd64 wxBase library (runtime) - non-GUI support classes of wxWidgets toolkit 1-11ubuntu3. 1 amd64 wxBase library (development) - non-GUI support classes of wxWidgets toolkit 1-11ubuntu3. 1 amd64 wxWidgets Cross-platform C++ GUI toolkit (GTK+ runtime) 1-11ubuntu3. 1 amd64 wxWidgets Cross-platform C++ GUI toolkit (GTK+ development) kicad/modules $ sudo dpkg -l | grep python-wxgtk 1-11ubuntu3. 1 amd64 wxWidgets Cross-platform C++ GUI toolkit (wxPython binding)
ii libwx-perl 1:0.9909-1 amd64 interface to wxWidgets cross-platform GUI toolkit
ii libwxbase2.
ii libwxbase2.8-dev 2.8.12.
ii libwxgtk2.8-0:amd64 2.8.12.
ii libwxgtk2.8-dev 2.8.12.
tony@olympus /usr/share/
ii python-wxgtk2.8 2.8.12.