Segfault when rotating footprint and then undoing

Bug #1785605 reported by Jorge Neiva
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Seth Hillbrand

Bug Description

Hi,

In Pcbnew on legacy toolset, rotate a footprint, then did CTL+Z to undo the modification.
When did that kicad disappears, on the command line it appears "Segmentation fault".

Version:

Application: kicad
Version: 5.0.0-fee4fd1~66~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-128-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Jeff Young (jeyjey) wrote :

I can't reproduce in 5.1 on OSX....

Jeff Young (jeyjey)
summary: - Pcbnew: disapear when doing CTRL+Z
+ Segfault when rotating footprint and then undoing
Revision history for this message
Nick Østergaard (nickoe) wrote :

Is it easy ro reproduce?

Please provide a backtrace.

Revision history for this message
Seth Hillbrand (sethh) wrote :

I am unable to reproduce on Linux

Application: pcbnew
Version: (5.0.1-dev-26-gedbf34c2b), release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-7-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.52.1
    Compiler: GCC 6.3.0 with C++ ABI 1010

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_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Cannot reproduce on windows in either stand alone or unified (launched from kicad) mode.

Application: pcbnew
Version: (5.0.1-dev-26-gedbf34c2b), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.61.0 OpenSSL/1.0.2o (WinSSL) zlib/1.2.11 brotli/1.0.5 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.5) nghttp2/1.32.0
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.0
    Compiler: GCC 7.3.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=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Jorge Neiva (jo-joven) wrote :

Hi,

It's difficult do reproduce, time to time it happen to do segmental fault.
Today have happened again.

On dmesg appears this mensage:

kicad[7225]: segfault at 8997dc0 ip 0000000008997dc0 sp 00007ffc6e85b908 error 15

Can give you some hint, what can i do the next time it happens?

Revision history for this message
Jorge Neiva (jo-joven) wrote :

Now its happen more today, the messages in dmesg are:

[24497.852387] kicad[18538]: segfault at 7f5cb53fe178 ip 00007f5cb53fe178 sp 00007ffc57b7dce8 error 15 in _pcbnew.kiface[7f5cb536d000+9a000]
[25962.805730] kicad[22428]: segfault at 4da5a90 ip 0000000004da5a90 sp 00007ffe65ee7468 error 15
[26184.025780] kicad[23241]: segfault at 668dcd0 ip 000000000668dcd0 sp 00007ffd27c6fc68 error 15

I don't know if it is usefull the message given by dmesg.

Revision history for this message
Jeff Young (jeyjey) wrote :

Do we have a debug build of the released 5.0 that we can have customers run for stuff like this?

Revision history for this message
Nick Østergaard (nickoe) wrote :

@Jorge, do you have coredumpctl on your system? If yes, then you might be able to get the backtrace after it crashed.

Is this a ubuntu?

Changed in kicad:
importance: Undecided → Critical
Revision history for this message
Jorge Neiva (jo-joven) wrote :

Hi,

My OS is Linux Mint 19 XFCE.
I don't have coredumpctl installed on that time.
When it happens again is only runninf the coredumpctl command?

The next 2 weeks i will not have access to the computer when Segmentation fault.

It is not easy to reproduce, is totaly random.

Revision history for this message
Nick Østergaard (nickoe) wrote :

Yes, usually. Maybe the coredumpctl service needs to be enabled, I am not entierely sure. It works on my system by default.

Revision history for this message
Jorge Neiva (jo-joven) wrote :
Download full text (5.0 KiB)

I have the same version of Kicad in my home laptop, did try to force Segmentation fault.

Kicad version:

dmesg:

kicad[17149]: segfault at 40 ip 00007f1aba9d435b sp 00007ffed5bb21e0 error 4 in _pcbnew.kiface[7f1aba06b000+10ab000]

$coredumpctl
TIME PID UID GID SIG COREFILE EXE
Fri 2018-08-17 20:30:15 WEST 17149 1000 1000 11 present /usr/bin/kicad

$coredumpctl dump
           PID: 17149 (kicad)
           UID: 1000 (xathar)
           GID: 1000 (xathar)
        Signal: 11 (SEGV)
     Timestamp: Fri 2018-08-17 20:30:13 WEST (2min 17s ago)
  Command Line: kicad
    Executable: /usr/bin/kicad
 Control Group: /user.slice/user-1000.slice/session-c2.scope
          Unit: session-c2.scope
         Slice: user-1000.slice
       Session: c2
     Owner UID: 1000 (xathar)
       Boot ID: 9204054e9b2f4490a2f5f6f950cb7dd3
    Machine ID: 48988a50738e4c2a8caac722dd87aac6
      Hostname: S510
       Storage: /var/lib/systemd/coredump/core.kicad.1000.9204054e9b2f4490a2f5f6f950cb7dd3.17149.1534534213000000.lz4
       Message: Process 17149 (kicad) of user 1000 dumped core.

                Stack trace of thread 17149:
                #0 0x00007f1aba9d435b n/a (_pcbnew.kiface)
                #1 0x00007f1aba9d471c n/a (_pcbnew.kiface)
                #2 0x00007f1aba9d4e60 n/a (_pcbnew.kiface)
                #3 0x00007f1aba9d5115 n/a (_pcbnew.kiface)
                #4 0x00007f1aba9d516d n/a (_pcbnew.kiface)
                #5 0x00007f1aba9dd99a n/a (_pcbnew.kiface)
                #6 0x00007f1aba611e97 n/a (_pcbnew.kiface)
                #7 0x00007f1aba656204 n/a (_pcbnew.kiface)
                #8 0x00007f1aba656920 n/a (_pcbnew.kiface)
                #9 0x00007f1ad257b4be _ZN12wxEvtHandler23ProcessEventIfMatchesIdERK21wxEventTableEntryBasePS_R7wxEvent (libwx_baseu-3.0.so.0)
                #10 0x00007f1ad257b5c3 _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler (libwx_baseu-3.0.so.0)
                #11 0x00007f1ad257b98b _ZN12wxEvtHandler11TryHereOnlyER7wxEvent (libwx_baseu-3.0.so.0)
                #12 0x00007f1ad257ba13 _ZN12wxEvtHandler19ProcessEventLocallyER7wxEvent (libwx_baseu-3.0.so.0)
                #13 0x00007f1ad257ba75 _ZN12wxEvtHandler12ProcessEventER7wxEvent (libwx_baseu-3.0.so.0)
                #14 0x00007f1abab9123b n/a (_pcbnew.kiface)
                #15 0x00007f1ad257cbe2 _ZN12wxEvtHandler20ProcessPendingEventsEv (libwx_baseu-3.0.so.0)
                #16 0x00007f1ad23fd9e7 _ZN16wxAppConsoleBase20ProcessPendingEventsEv (libwx_baseu-3.0.so.0)
                #17 0x00007f1ad2ca8bbd _ZN5wxApp6DoIdleEv (libwx_gtk2u_core-3.0.so.0)
                #18 0x00007f1ad2ca8cc3 n/a (libwx_gtk2u_core-3.0.so.0)
                #19 0x00007f1ad02dd0f5 g_main_context_dispatch (libglib-2.0.so.0)
                #20 0x00007f1ad02dd4c0 n/a (libglib-2.0.so.0)
                #21 0x00007f1ad02dd7d2 g_main_loop_run (libglib-2.0.so.0)
                #22 0x00007f1ad1050a37 gtk_main (libgtk-x11-2.0.so.0)
                #23 0x00007f1ad2cc8b05 _ZN14wxGUIEventLoop5DoRunEv (libwx_gtk2u_core-3.0.so.0)
                #24 0x00007f1ad2437a93 _ZN15wxEventLoopBase3RunEv (libwx_baseu-3.0.so.0)
...

Read more...

Revision history for this message
Franck78 (fbourdonnec) wrote :

You have the debug symbols build here

https://launchpad.net/~js-reynaud/+archive/ubuntu/kicad-5/+packages

install, try as you did
Maybe better

Use GDB :

gdb pcbnew
r (=run)
-provoke your segfault then examine stack
backtrace

BTW, does not happen to me.
Application: pcbnew
Version: 5.0.0, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.37.0 OpenSSL/1.0.2j zlib/1.2.8 libidn/1.28 libssh2/1.4.3
Platform: Linux 4.4.143-65-default x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,STL containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.61.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.37.0
    Compiler: GCC 4.8.5 with C++ ABI 1002

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

Revision history for this message
Jorge Neiva (jo-joven) wrote :

Did try again to provoke the bug with gdb.

after the pcbnew started, the first thing i did was open a board.
choose a random footprint and only did rotate "r" and next "ctrl+z"

This is what gbd showed in command line:

$ gdb pcbnew
GNU gdb (Ubuntu 8.1-0ubuntu3) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from pcbnew...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/bin/pcbnew
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffdd907700 (LWP 3178)]
[New Thread 0x7fffdd106700 (LWP 3179)]
[New Thread 0x7fffd5cde700 (LWP 3180)]
[New Thread 0x7fffd54dd700 (LWP 3181)]
[New Thread 0x7fffd4cdc700 (LWP 3182)]
[Thread 0x7fffd4cdc700 (LWP 3182) exited]
[Thread 0x7fffd5cde700 (LWP 3180) exited]
[New Thread 0x7fffd4cdc700 (LWP 3183)]
[New Thread 0x7fffd5cde700 (LWP 3184)]
[Thread 0x7fffd54dd700 (LWP 3181) exited]
[Thread 0x7fffd5cde700 (LWP 3184) exited]
[New Thread 0x7fffd5cde700 (LWP 3185)]
[New Thread 0x7fffd54dd700 (LWP 3186)]
[New Thread 0x7fffc3fff700 (LWP 3187)]
[New Thread 0x7fffc37fe700 (LWP 3188)]
[New Thread 0x7fffc2ffd700 (LWP 3189)]
[New Thread 0x7fffc27fc700 (LWP 3190)]
[New Thread 0x7fffc1ffb700 (LWP 3191)]
[New Thread 0x7fffc17fa700 (LWP 3192)]
[New Thread 0x7fffc0ff9700 (LWP 3193)]
[Thread 0x7fffc27fc700 (LWP 3190) exited]
[Thread 0x7fffd5cde700 (LWP 3185) exited]
[Thread 0x7fffd4cdc700 (LWP 3183) exited]
[Thread 0x7fffc37fe700 (LWP 3188) exited]
[Thread 0x7fffc1ffb700 (LWP 3191) exited]
[Thread 0x7fffc0ff9700 (LWP 3193) exited]
[Thread 0x7fffc17fa700 (LWP 3192) exited]
[Thread 0x7fffc2ffd700 (LWP 3189) exited]
[Thread 0x7fffc3fff700 (LWP 3187) exited]
[New Thread 0x7fffc3fff700 (LWP 3194)]
[Thread 0x7fffc3fff700 (LWP 3194) exited]
[New Thread 0x7fffc3fff700 (LWP 3195)]
[Thread 0x7fffc3fff700 (LWP 3195) exited]
[New Thread 0x7fffc3fff700 (LWP 3196)]
[New Thread 0x7fffc0ff9700 (LWP 3197)]
[Thread 0x7fffc0ff9700 (LWP 3197) exited]
[Thread 0x7fffc3fff700 (LWP 3196) exited]
[New Thread 0x7fffc3fff700 (LWP 3198)]
[Thread 0x7fffd54dd700 (LWP 3186) exited]

Thread 1 "pcbnew" received signal SIGSEGV, Segmentation fault.
0x0000555559653af0 in ?? ()
(gdb)

Revision history for this message
Seth Hillbrand (sethh) wrote :

At that prompt, can you type: bt

And post the results? I am still unable to reproduce this.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Oh, wait, nevermind. Just triggered it.

Changed in kicad:
assignee: nobody → Seth Hillbrand (sethh)
milestone: none → 5.0.1
status: New → Confirmed
Revision history for this message
Seth Hillbrand (sethh) wrote :
Changed in kicad:
status: Confirmed → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
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.