KiCad segfault.

Bug #1427803 reported by Wayne Stambaugh
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Unassigned

Bug Description

I am seeing intermittent segfaults of KiCad. I'm not sure what the specific actions are to make this happen but there doesn't seem to be a pattern. This is as of product branch r5468. Here is the code that causes the segfault:

#0 0x0000000009c9798c in PNS_NODE::isRoot (this=0xfeeefeeefeeefeee)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_node.h:414
#1 0x00000000099743d9 in PNS_NODE::KillChildren (this=0xfeeefeeefeeefeee)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_node.cpp:1141
#2 0x000000000994d6cd in PNS_ROUTER::ClearWorld (this=0x548ff6c0)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_router.cpp:391
#3 0x000000000994d551 in PNS_ROUTER::~PNS_ROUTER (this=0x548ff6c0,
    __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_router.cpp:379
#4 0x00000000099512d3 in PNS_TOOL_BASE::~PNS_TOOL_BASE (this=0x548eaa90,
    __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_tool_base.cpp:72
#5 0x0000000009949fdb in LENGTH_TUNER_TOOL::~LENGTH_TUNER_TOOL (
    this=0x548eaa90, __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/length_tuner_tool.cpp:104
#6 0x000000000994a027 in LENGTH_TUNER_TOOL::~LENGTH_TUNER_TOOL (
    this=0x548eaa90, __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/length_tuner_tool.cpp:107
#7 0x00000000099f1e31 in TOOL_MANAGER::~TOOL_MANAGER (this=0x548d8d40,
    __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/common/tool/tool_manager.cpp:217
#8 0x000000000989da3b in PCB_BASE_FRAME::~PCB_BASE_FRAME (this=0x52d1dc80,
    __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/basepcbframe.cpp:123
#9 0x0000000009b0b686 in PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME (
    this=0x52d1dc80, __in_chrg=<optimized out>)
    at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/pcb_base_edit_frame.h:43

It appears that PNS_NODEs are being used after they have been freed.

Tags: cern pcbnew pns

Related branches

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

Here's the build info:

Application: kicad
Version: (after 2015-jan-16 BZR unknown)-product Debug build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.9.2,wx containers,compatible with 2.8)
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Boost version: 1.57.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON
         KICAD_USE_WEBKIT=ON

Changed in kicad:
importance: Undecided → Critical
Revision history for this message
Nick Østergaard (nickoe) wrote :

This looks like it is related to the new CERN contributions, so I will tag it as such for their convience.

tags: added: cern pns
tags: added: pcbnew
Revision history for this message
Nick Østergaard (nickoe) wrote :

I get something similar, but not quite the same. Sorry for not being a debug build.

This is when having routed a diff pair, then use the single trace length tuner on one trace, and clicking a lot on the second trace after the first one has been tuned.

(gdb) bt
#0 0x00007fffe9062405 in ?? () from /usr/bin/_pcbnew.kiface
#1 0x00007fffe9022244 in ?? () from /usr/bin/_pcbnew.kiface
#2 0x00007fffe905be66 in ?? () from /usr/bin/_pcbnew.kiface
#3 0x00007fffe90226cf in ?? () from /usr/bin/_pcbnew.kiface
#4 0x00007fffe901f55c in LENGTH_TUNER_TOOL::performTuning() () from /usr/bin/_pcbnew.kiface
#5 0x00007fffe902001d in LENGTH_TUNER_TOOL::mainLoop(PNS_ROUTER_MODE) () from /usr/bin/_pcbnew.kiface
#6 0x00007fffe9020ea8 in LENGTH_TUNER_TOOL::TuneSingleTrApplication: pcbnew
Version: (2015-03-03 BZR 5469)-kicad Release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.9.2,wx containers,compatible with 2.8)
Platform: Linux 3.18.6-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.57.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON
         KICAD_USE_WEBKIT=OFF
ace(TOOL_EVENT const&) () from /usr/bin/_pcbnew.kiface
#7 0x00007fffe9156371 in ?? () from /usr/bin/_pcbnew.kiface
#8 0x00007fffe6a2c731 in make_fcontext () from /usr/lib/libboost_context.so.1.57.0
#9 0x0000000000000000 in ?? ()

With:
Application: pcbnew
Version: (2015-03-03 BZR 5469)-kicad Release build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.9.2,wx containers,compatible with 2.8)
Platform: Linux 3.18.6-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.57.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=ON
         KICAD_SCRIPTING_MODULES=ON
         KICAD_SCRIPTING_WXPYTHON=ON
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON
         KICAD_USE_WEBKIT=OFF

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

Pretty easy to replicate my use case:

1. Draw track between two pads
2. Select tune track pair
3. Click a few time on a track fast.

Also, I note that I get a gray box in the 0,0 in screencoordinates. Some gray as that hovering info box. Maybe it has something to do with that.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1427803] Re: KiCad segfault.

I just committed the fix for the problem I was seeing. If this doesn't
fix your problem, please file a separate bug report so it doesn't get lost.

On 3/3/2015 3:08 PM, Nick Østergaard wrote:
> Pretty easy to replicate my use case:
>
> 1. Draw track between two pads
> 2. Select tune track pair
> 3. Click a few time on a track fast.
>
> Also, I note that I get a gray box in the 0,0 in screencoordinates. Some
> gray as that hovering info box. Maybe it has something to do with that.
>

Changed in kicad:
status: New → Fix Committed
Revision history for this message
Nick Østergaard (nickoe) wrote :
Download full text (3.1 KiB)

Sure. I am just recompiling.

2015-03-03 21:15 GMT+01:00 Wayne Stambaugh <email address hidden>:
> I just committed the fix for the problem I was seeing. If this doesn't
> fix your problem, please file a separate bug report so it doesn't get lost.
>
> On 3/3/2015 3:08 PM, Nick Østergaard wrote:
>> Pretty easy to replicate my use case:
>>
>> 1. Draw track between two pads
>> 2. Select tune track pair
>> 3. Click a few time on a track fast.
>>
>> Also, I note that I get a gray box in the 0,0 in screencoordinates. Some
>> gray as that hovering info box. Maybe it has something to do with that.
>>
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1427803
>
> Title:
> KiCad segfault.
>
> Status in KiCad EDA Software Suite:
> Fix Committed
>
> Bug description:
> I am seeing intermittent segfaults of KiCad. I'm not sure what the
> specific actions are to make this happen but there doesn't seem to be
> a pattern. This is as of product branch r5468. Here is the code that
> causes the segfault:
>
> #0 0x0000000009c9798c in PNS_NODE::isRoot (this=0xfeeefeeefeeefeee)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_node.h:414
> #1 0x00000000099743d9 in PNS_NODE::KillChildren (this=0xfeeefeeefeeefeee)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_node.cpp:1141
> #2 0x000000000994d6cd in PNS_ROUTER::ClearWorld (this=0x548ff6c0)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_router.cpp:391
> #3 0x000000000994d551 in PNS_ROUTER::~PNS_ROUTER (this=0x548ff6c0,
> __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_router.cpp:379
> #4 0x00000000099512d3 in PNS_TOOL_BASE::~PNS_TOOL_BASE (this=0x548eaa90,
> __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/pns_tool_base.cpp:72
> #5 0x0000000009949fdb in LENGTH_TUNER_TOOL::~LENGTH_TUNER_TOOL (
> this=0x548eaa90, __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/length_tuner_tool.cpp:104
> #6 0x000000000994a027 in LENGTH_TUNER_TOOL::~LENGTH_TUNER_TOOL (
> this=0x548eaa90, __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/router/length_tuner_tool.cpp:107
> #7 0x00000000099f1e31 in TOOL_MANAGER::~TOOL_MANAGER (this=0x548d8d40,
> __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/common/tool/tool_manager.cpp:217
> #8 0x000000000989da3b in PCB_BASE_FRAME::~PCB_BASE_FRAME (this=0x52d1dc80,
> __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/basepcbframe.cpp:123
> #9 0x0000000009b0b686 in PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME (
> this=0x52d1dc80, __in_chrg=<optimized out>)
> at C:/msys64/home/wstambaugh/src/kicad/product/pcbnew/pcb_base_edit_frame.h:43
>
> It appears that PNS_NODEs are being used after they have been freed.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1427803/+sub...

Read more...

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

You may want to stop your build and update your source branch. I just committed another P&S router segfault fix which might be what you are seeing.

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

The commit in 5471 fixed the segfault from my description, but I still have the issue with the gray box appearing on top of every thing on the screencoordinates origin. This happens as soon as I click the track with the tune track lenght tool. It is important not to move the cursor after this is done, otherwise the box will dissapear (and I guess turn into the correct info box near the cursor).

[I have not created a new bug on this, but I can do that tomorrow if not fixed before.]

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

Just FYI regarding the description in #8, it has been reported and it has been fixed. So lets leave it here.

Jon Neal (reportingsjr)
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.