PCBNew segfault

Hi folks,

I’m using the latest (nightly) Kicad since the end of the 2017. I usually upgrade my system every day and since some (2 or 3) weeks I cannot open the layout of my project anymore.

Launching kicad from command line I have only this message:

•100% ➜ kicad
[1]    12015 segmentation fault (core dumped)  kicad

The same for pcbnew

•100% ➜ pcbnew 
[1]    14103 segmentation fault (core dumped)  pcbnew

My layout (kicad_pcb) has this version on the header
(kicad_pcb (version 20171130) (host pcbnew no-vcs-found-bf44d39~61~ubuntu17.10.1)

How can I debug the problem?
How can I verify my kicad_pcb file which was fine some builds ago?
Has anything fundamental changed on pcbnew recently which makes something break like that?

Kicad version:

Application: kicad
Version: no-vcs-found-d08f19a~61~ubuntu17.10.1, release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.55.1 OpenSSL/1.0.2g zlib/1.2.11 libidn2/2.0.2 libpsl/0.18.0 (+libidn2/2.0.2) librtmp/2.3
Platform: Linux 4.13.0-32-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    Curl: 7.55.1
    Compiler: GCC 7.2.0 with C++ ABI 1011

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=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Possibly related to an issue with OpenGL https://bugs.launchpad.net/kicad/+bug/1748614

1 Like

I found this on my the logs of the system:

kicad[6567]: segfault at 0 ip 00007f87d50c8d5d sp 00007ffc68a527f0 error 4 in _pcbnew.kiface[7f87d46cf000+107e000]

I also found a this thread about kiface, I don’t know if my problem is related with it but… any suggestion to fix/debug is welcome.

Hey @bobc, do you know how to get the this crash dump?

Sorry no. I would file a bug report, segfaults are often given a high priority, especially if they are reproducible.

Right, thanks. I will do that! Actually, I was expecting to find a way to debug something before file the bug report.

Because you’re on Linux you could try to read the core dump. First you have to enable saving it, then open with the debugger (gdb or some GUI).

In a terminal shell:
ulimit -c unlimited
kicad

Now when it crashes with a segmentation fault the core file is in the same directory where you started it. Then you can open it with gdb:

gdb kicad core

But you have to know how to use gdb.

You can also use valgrind which may be easier:

valgrind kicad

See also https://wiki.ubuntu.com/DebuggingProgramCrash, although kicad crash seems not to be caught by apport.

1 Like

Also install kicad-dbg package.

After reading https://wiki.ubuntu.com/Valgrind I suppose Valgrind is the best way to go if you want to find something useful. Even if you can’t interpret the log you can give it to the developers. It’s especially valuable because others can’t reproduce your situation - otherwise it would have been fixed already.

Edit: I mean, others haven’t experienced this same situation and it’s possible that they can’t reproduce it even when you can.

I deduce from your version that you are using Ubuntu 17.10.1 64 bit.
Can you tell us a bit about the PC and its graphics card?

Reproducible crashes are treated as the highest priority bug, so get this posted as @bobc said

Does the crash happen with a new test project?

Guys, thanks a lot for the help.

Is it possible that this issue is related with UEFI’s secure boot? I don’t know how this thing works and recently something just upgraded my system and showed me something about this saying that I programs could experience issues accessing hardware resources.

I also have filed a bug this report.

@eelik, I posted on launchpad the output of the kicad running with gdb. I just added the kicad-dbg and valgrind info right now.

@davidsrsb, Sure, I am running on:

➜ nvidia-smi 
Sun Feb 18 18:32:02 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 384.111                Driver Version: 384.111                   |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 960M    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   54C    P0    N/A /  N/A |    312MiB /  2002MiB |     10%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1010      G   /usr/lib/xorg/Xorg                            71MiB |
|    0      1135      G   /usr/bin/gnome-shell                          49MiB |
|    0      1309      G   /usr/lib/xorg/Xorg                            82MiB |
|    0      1500      G   /usr/bin/gnome-shell                         104MiB |
|    0     11368      G   /usr/bin/nvidia-settings                       2MiB |
+-----------------------------------------------------------------------------+


➜ lspci -nnk | grep -i vga -A3 | grep 'in use'
	Kernel driver in use: i915

➜ sudo lshw -c video
[sudo] password for lheck: 
  *-display                 
       description: 3D controller
       product: GM107M [GeForce GTX 960M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:135 memory:dc000000-dcffffff memory:b0000000-bfffffff memory:c0000000-c1ffffff ioport:e000(size=128) memory:dd000000-dd07ffff
  *-display
       description: VGA compatible controller
       product: HD Graphics 530
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 06
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:126 memory:db000000-dbffffff memory:70000000-7fffffff ioport:f000(size=64) memory:c0000-dffff

➜ uname -a      
Linux rock 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
 
➜ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 17.10
Release:	17.10
Codename:	artful

Hi Leandro, thanks for updating the bug report with the backtrace with debugging symbols, this is helpful. For the moment, this backtrace looks to me like there might be a bug in KiCad here, not something having to do with your hardware. I’ll follow up over on the bug tracker. This looks like it might have something to do with zone fills, so consider making a backup copy of your board and then using an older version of KiCad to delete everything except the zones, and see if that still crashes. If so, and you can share this stripped-down version of your board with the developers, it would make it a lot easier to fix.

2 Likes

I can see three graphics items in that:
Kernel driver in use: i915
product: GM107M [GeForce GTX 960M]
product: HD Graphics 530 (Intel on board type Skylake)

So I guess that this is a dual graphics PC?
These are notorious for graphics crashes

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