pcbnew: ratsnest and DRC checker malfunctions in v6.0.0-rc1 but works fine in v5.0.0

Bug #1804691 reported by Gabriel Staples on 2018-11-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Undecided
Unassigned

Bug Description

Continued from this bug: https://bugs.launchpad.net/kicad/+bug/1803485

The board files in question (Bug1803485_DRC_good_with_missing_track_20181121-1843hrs.zip), have been previously emailed to @Seth, @Tom, and @Wayne.

-------------

@Seth, I just checked again too.

In this version it works fine. The ratsnest line is shown and the DRC fails with one missing connection:

Application: kicad
Version: 5.0.0-fee4fd1~66~ubuntu14.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Platform: Linux 4.4.0-112-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.54.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.35.0
    Compiler: GCC 4.8.4 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=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

---------------

In this version, however, it still fails. The ratsnest line is NOT shown, and the DRC passes with no errors.

Application: kicad
Version: 6.0.0-rc1-unknown-a5c892d~84~ubuntu14.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.35.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 librtmp/2.3
Platform: Linux 4.4.0-112-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.54.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.35.0
    Compiler: GCC 4.8.4 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
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

description: updated
Gabriel Staples (ercaguy) wrote :

I've recreated something that looks like a bug, and may be what's causing this bug. See here: https://github.com/ElectricRCAircraftGuy/KiCad6_DRC_bug_recreate. Read this pdf I made ("bug notes - Gabriel--20181122_1113hrs.pdf" in the github repo, and also attached).

For the same PCB:

Version: 6.0.0-rc1-unknown-a5c892d~84~ubuntu14.04.1, release build shows the board with 13 nets, 12 unrouted, and is missing a ratsnest line (looks buggy).

Version: 5.0.0-fee4fd1~66~ubuntu14.04.1, release build shows the board with 14 nets, 13 unrouted, and has the missing ratsnest line (looks good).

Gabriel Staples (ercaguy) wrote :

As shown in the PDF, this is on Linux. Is this somehow a Linux-version-only bug?

Gabriel Staples (ercaguy) wrote :

I just installed the latest nightly, and it works fine too! There are 295 commits (run `git log a5c892d..82f657 --pretty=oneline | wc -l`; see: https://stackoverflow.com/a/31998090/4561887) between the buggy nightly (commit hash a5c892d) and the good nightly I just tested (82f657). It appears one of them must have fixed the bug.

It looks like 5 of these commits deal with the ratsnest. Perhaps of of these is the fix. To see commits with the word "rats" in them between the nightly build with the bug and the one without it, run:

    git log a5c892d..82f657 | grep -B 4 -A 30 -i rats --color=always | less -R

Seth Hillbrand (sethh) wrote :

Thanks for reporting back. I'm glad that this is fixed.

Changed in kicad:
milestone: none → 5.1.0
status: New → Fix Committed
Gabriel Staples (ercaguy) wrote :

@Seth, I'd really like to be able to build from source so I can do a `git bisect` to figure out which commit fixed this issue, and why. Unfortunately, after ~6 hrs of trying, I am still unable to build.

I'm going to open a new issue, and hopefully I can get some guidance that will get me to where I can build.

Gabriel Staples (ercaguy) wrote :

Here is the issue I just opened up for this: https://bugs.launchpad.net/kicad/+bug/1804771.

Seth Hillbrand (sethh) wrote :

@Gabriel-

It looks like you have some good suggestions in the other thread for compiling. My guess would be that it was caused by 38c5b025c and fixed by e1f30a3b3

Gabriel Staples (ercaguy) wrote :

@Seth, thanks for taking a look. That seems plausible:

commit 38c5b025c8abdcab842587f54f2b64317d47ca34
Author: Seth Hillbrand
Date: Wed Oct 17 17:05:30 2018 -0700

    Ratsnest: iterate only over dirty nets

    Rather than forcing each thread to iterate over the full nets list to
    find the dirty items, we collect the dirty items first before asking the
    threads to address them. This prevents thread spinning. We also
    amortize the cost of calculating on an 8-net per thread basis rather
    than 2.

and about 1 day and 10 commits or so later:

commit e1f30a3b382f91f772483936b589c98b2bb67d6d
Author: Seth Hillbrand
Date: Thu Oct 18 17:11:58 2018 -0700

    pcbnew: Fix single-net connectivity

    Ensure that changes affecting fewer than 4 nets still get updates in the
    ratsnest.

If those are indeed the cause and fix of the bug, then I'm pretty unlucky to have pulled the nightly at just the right time to get that problem to build PCBs with for the last month. :)

Gabriel Staples (ercaguy) wrote :

Even more ironic: it was a single, single-digit number on a single line that caused the bug. See attached. Such small things with such big effects.

Gabriel Staples (ercaguy) wrote :

After a long long long process of getting my system able to build Kicad (https://bugs.launchpad.net/kicad/+bug/1804771), then running a `git bisect` (with some aliases in place [https://stackoverflow.com/a/17153598/4561887], since my mind couldn't handle the fact that "bad" was "good" and "good" was "bad"), I determined that this bug I am reporting was caused by and fixed by the following commits:

BUG CAUSED BY:
commit 38c5b025c8abdcab842587f54f2b64317d47ca34
Author: Seth Hillbrand
Date: Wed Oct 17 17:05:30 2018 -0700

    Ratsnest: iterate only over dirty nets

    Rather than forcing each thread to iterate over the full nets list to
    find the dirty items, we collect the dirty items first before asking the
    threads to address them. This prevents thread spinning. We also
    amortize the cost of calculating on an 8-net per thread basis rather
    than 2.

BUG FIXED BY:
commit 0f247264f80bfe8b5090e33fd3aab9a567266a78
Author: jean-pierre charras
Date: Sun Oct 21 16:31:07 2018 +0200

    Pcbnew: DRC ignores first net of list of nets to test.

    Fixes: lp:1798985
    https://bugs.launchpad.net/kicad/+bug/1798985

Therefore, it is a duplicate of https://bugs.launchpad.net/kicad/+bug/1798985, and obviously now they are both fixed. I wanted to be sure I tracked it down to better understand it.

Gabriel Staples (ercaguy) wrote :

For the heck of it, with meld as my difftool, here's the change:

`git difftool 38c5b025c8abdcab842587f54f2b64317d47ca34..0f247264f80bfe8b5090e33fd3aab9a567266a78 pcbnew/connectivity/connectivity_data.cpp`

See attached image.

Jeff Young (jeyjey) wrote :

We'll have you writing code in no time, Gabriel. ;)

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers