SHAPE_LINE_CHAIN::PathLength stuck

Bug #1802724 reported by Nick Østergaard
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Expired
Medium

Bug Description

I was trying to route the top layer on a six layer board. I had some trouble getting a pin routed out. Suddenly pcbnew seemed to get stuck, and I then tried to attach to it with gdb and it seemed to be stuck in:

SHAPE_LINE_CHAIN::PathLength(VECTOR2<int> const&)

I have attached a backtrace.

I did wait a couple of minutes or so before attaching gdb.

Application: kicad
Version: (6.0.0-rc1-dev-1168-gacfa13c03), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.62.0 OpenSSL/1.1.1 zlib/1.2.11 libidn2/2.0.5 libpsl/0.20.2 (+libidn2/2.0.4) libssh2/1.8.0 nghttp2/1.34.0
Platform: Linux 4.18.16-arch1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.62.0
    Compiler: GCC 8.2.1 with C++ ABI 1013

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

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

I don't have a PCB where I can reliably reproduce this.

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

@Tom, did you get a chance to take a look at this? Is it possible that some condition puts the SHAPE_LINE_CHAIN code into an infinite loop?

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

Hi Wayne,

There's no way for PathLength() to get stuck, but Nick's stack trace might also mean the infinite loop occurs somewhere in the walkaround code and just repeatedly calls PathLength().

Tom

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

@Tom, from a user perspective I not the difference is significant. If the walkaround code can get stuck in a loop and there is no way to exit out of the loop, then I see this as an issue because the process will have to be kill possibly causing loss of changes.

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

@Nick, do you have any PCB where this bug ever occurred? Maybe I'll try fuzzing the router a bit with random mouse events to see if it fails after a while...

Changed in kicad:
milestone: 5.1.0 → 6.0.0-rc1
assignee: nobody → Tomasz Wlostowski (twlostow)
status: New → Incomplete
Revision history for this message
Nick Østergaard (nickoe) wrote :

@Tom, I think this is the issue I mentioned at FOSDEM, I have the pcb file locally, and I will try to see if it still happens for master and report back.

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

@Nick, I really appreciate that. If you manage to freeze Kicad, could you send me a full coredump instead of just the stack trace? I suspect the freeze happens somewhere in the shove algorithm (PathLength() always exits in finite time).

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

@Tomasz, sorry for the slow response. But I can't seem to make it get stuck here at the moment.

Version: (5.1.0-rc1-90-g2dd653a32), release build

But I will attach the file that I tried to reproduce it in. But this file show the issue with the diff pairs not always connecting. Maybe I should create a new bug for that, please advise.

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

@Nick,

Do you remember which part/component/track were you routing when the freeze occured?

Thx,
Tom

PS. Register the diff pair bug in a separate report, it's easier to follow.

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

I was trying to route those diff pairs, and because they were "hard" to connect and it was not something I could reproduce consistently. I don't remember the pns settings. But I guess it was in walkaroud mode. Maybe it requires some more obstacles for the pns to get stuck. I guess we should close this bug for now.

Revision history for this message
Tomasz Wlostowski (twlostow) wrote :

@Nick ... and open a new one with an ugly diff pair routing bug causing difficulties drawing the pairs ;-) Thanks for a nice test case Nick!

T.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1789

Changed in kicad:
status: Incomplete → Expired
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.