Nightly PCBNEW crash at open

Bug #1851703 reported by Michele Giorato
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Critical
Jeff Young

Bug Description

In the last two versions nightly, opening a project and starting pcbnew you get a kicad crash.

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

michele@fx-8350-fc30 ~]$ kicad
19:47:33: Debug: Adding duplicate image handler for 'PNG file'
19:47:33: Debug: Adding duplicate image handler for 'JPEG file'
19:47:33: Debug: Adding duplicate image handler for 'TIFF file'
19:47:33: Debug: Adding duplicate image handler for 'GIF file'
19:47:33: Debug: Adding duplicate image handler for 'PNM file'
19:47:33: Debug: Adding duplicate image handler for 'PCX file'
19:47:33: Debug: Adding duplicate image handler for 'IFF file'
19:47:33: Debug: Adding duplicate image handler for 'Windows icon file'
19:47:33: Debug: Adding duplicate image handler for 'Windows cursor file'
19:47:33: Debug: Adding duplicate image handler for 'Windows animated cursor file'
19:47:33: Debug: Adding duplicate image handler for 'TGA file'
19:47:33: Debug: Adding duplicate image handler for 'XPM file'
19:47:34: Debug: Loading project '/home/michele/Documenti/pcb/kicad/MqttControl/MqttControl/MqttControl.pro' settings.
kicad: /builddir/build/BUILD/kicad-r17042-a60fb9a4/pcbnew/connectivity/connectivity_items.cpp:116: virtual const VECTOR2I CN_ITEM::GetAnchor(int) const: Assertion `false' failed.
kicad: /builddir/build/BUILD/kicad-r17042-a60fb9a4/pcbnew/connectivity/connectivity_items.cpp:116: virtual const VECTOR2I CN_ITEM::GetAnchor(int) const: Assertion `false' failed.
Aborted (core dumped)

Application: KiCad
Version: 5.99.0-unknown-r17042-a60fb9a4, debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.3 OpenSSL/1.1.1d-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.9.0/openssl/zlib nghttp2/1.39.2
Platform: Linux 5.3.8-200.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    Build date: Nov 6 2019 23:57:05
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.65.3
    Compiler: GCC 9.2.1 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

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

If I downgrade to kicad-100:r17012-9bccbaf4.fc30.x86_64 version everything works correctly.

Application: KiCad
Version: 5.99.0-unknown-r17012-9bccbaf4, debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.3 OpenSSL/1.1.1d-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.9.0/openssl/zlib nghttp2/1.39.2
Platform: Linux 5.3.8-200.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    Build date: Nov 2 2019 02:00:48
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.65.3
    Compiler: GCC 9.2.1 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

Tags: pcbnew
Changed in kicad:
milestone: none → 6.0.0-rc1
importance: Undecided → Critical
Revision history for this message
Seth Hillbrand (sethh) wrote :

Please attach the board file that exhibits this issue.

Changed in kicad:
status: New → Incomplete
Revision history for this message
Michele Giorato (mr-miky64) wrote :

I'm a bit perplexed because the same pcb is loaded correctly in the windows, always nightly, version of kicad.
It must be said that it is not clear if the two nightly are aligned with each other because the windows file reports a versioning
kicad-r14420.a60fb9a4b, so apparently 14420 while that for fedora 30 kicad-r17047-6182133a.fc30.x86_64.rpm or r17047.
What is certain is that aligning the way of indicating the version, even in the info menu, would not hurt ....

tags: added: pcbnew
Revision history for this message
Michele Giorato (mr-miky64) wrote :

News...

actually kicad on windows loads the pcb and lets you work on it then at the close pcbnew crashes miserably.

Application: Pcbnew
Version: (5.99.0-319-g6182133a4), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.66.0 OpenSSL/1.1.1d (Schannel) zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.1.1) nghttp2/1.39.2
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    Build date: Nov 7 2019 22:08:39
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.71.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.66.0
    Compiler: GCC 9.2.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=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
Nick Østergaard (nickoe) wrote :

Please provide the backtrace or build the same version as on windows.

Revision history for this message
Ian McInerney (imcinerney) wrote :

There was a bug introduced yesterday that caused a crash in Pcbnew when exiting. It has been fixed now, and the fix should be in the next nightly. Please test with that one to see if any of the crashes still occur.

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

OK, but the original post said that pcbnew was asserting in the connectivity calc on a custom pad.

That report doesn't happen now?

Revision history for this message
Michele Giorato (mr-miky64) wrote :

@sethh

Tonight instead of sleeping I set up a pc with win10 and compiled kicad taking the source with git.
Result: the pcb that crashes pcbnew on fedora opens correctly on windows.
Not happy I compiled the same source on fedora 30.
Well when I open the same pcb on linux pcbnew crashes.
I did further tests under linux and only some pcb crash pcbnew. Practically I noticed that it happens on a bit complex pcb. The fact remains that until a few days ago I worked on both of them.
Unfortunately I can't give you the "explosive" pcb file but I'm trying to create one that causes the same effects ...
Tonight I try to compile with active debug options ....

Revision history for this message
Michele Giorato (mr-miky64) wrote :

Pcbnew crashes here:

        case PAD_SHAPE_CUSTOM:
        {
            switch( n )
            {
            case 1: pt1.y = m_bbox.GetTop(); break; // North
            case 2: pt1.y = m_bbox.GetBottom(); break; // South
            case 3: pt1.x = m_bbox.GetLeft(); break; // East
            case 4: pt1.x = m_bbox.GetRight(); break; // West
            default: break; // Wicked witch
            }

            if( pad->GetOrientation() )
                RotatePoint( pt1, pad->ShapePos(), pad->GetOrientation() );

            SHAPE_POLY_SET padPolySet;
            pad->BuildPadShapePolygon( padPolySet, wxSize( 0, 0 ), ARC_LOW_DEF );
            const SHAPE_LINE_CHAIN& padOutline = padPolySet.COutline( 0 );
            SHAPE_LINE_CHAIN::INTERSECTIONS intersections;

            padOutline.Intersect( SEG( pt0, pt1 ), intersections );

            if( intersections.empty() )
            {
                // There should always be at least some copper outside the hole
 >>>>>>>> assert( false );
                return pt0;
            }

            return intersections[ intersections.size() - 1 ].p;
        }

in kicad/pcbnew/connectivity/connectivity_items.cpp

it seems to be the assertion, the crash happens before the return.

Revision history for this message
Michele Giorato (mr-miky64) wrote :

I confirm. by removing the assert() the pcb is loaded correctly.
It would be interesting to understand which footprint triggers the problem.

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

That is what the original report indicated but without a board that triggers this issue, we cannot determine why it happens.

The assertion exists to point out a programming error.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Michele, if you are comfortable modifying the code some more, I think you should be able to find the module that contains the problematic pad. I believe you can add the following right before the assert statement:

wxLogDebug( pad->GetParent()->GetFPID().GetUniStringLibId() );

This should print out the FPID of the module that contains the pad that throws the assert. That should contain the footprint library name and the footprint name.

(disclaimer, I haven't tested this or compiled it, but I think it should work :) ).

Revision history for this message
Ian McInerney (imcinerney) wrote :

Note that you will need to be compiling in debug mode and launch from a terminal to view the output of that statement.

Revision history for this message
Michele Giorato (mr-miky64) wrote :

and the winner is .......

Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels.

I have the impression that pcbnew crashes only for assert(false).

Revision history for this message
Michele Giorato (mr-miky64) wrote :
Download full text (4.1 KiB)

I noticed that there are modules called Jumper: SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm but they are different from each other.
If I remember correctly the first version of the pcb was made with the V5 version or even V4, then 2 months ago it was revised with the future V6 adding some solder jumper.
Actually there are 2 types of solder jumpers, I exported them and they are attached.

Another oddity is that there are 40 lines of "assert (false) but there are only 11 solder jumper of 3 pads. I would expect a multiple number of 3.

12:10:06: Debug: Loading project '/home/michele/Documenti/PCB/kicad/MqttControl/MqttControl.pro' settings.
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged12_RoundedPad1.0x1.5mm_NumberLabels
12:10:07: Debug: Jumper:SolderJumper-3_P1.3mm_Bridged...

Read more...

Revision history for this message
Michele Giorato (mr-miky64) wrote :

even another pcb has problems with solder jumpers, it just can't digest them.

13:21:26: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:26: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:26: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:26: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:26: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:26: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:27: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:27: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:27: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:27: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:27: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm
13:21:27: Debug: Jumper:SolderJumper-2_P1.3mm_Open_RoundedPad1.0x1.5mm

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

I've tried to generate the assert using this footprint but I cannot. Can you create a test board with the footprint that generates the assert on your machine and upload it?

Revision history for this message
Michele Giorato (mr-miky64) wrote :

is something absolutely related to the solder jumper because I removed them from the pcb and there are no more assert ()

Revision history for this message
Jeff Young (jeyjey) wrote : Re: [Bug 1851703] Re: Nightly PCBNEW crash at open
Download full text (4.5 KiB)

I *think* I just got it by rotating the footprint — but my build was stale and so my debugger wigged out on me.

Rebuilding now….

> On 10 Nov 2019, at 13:48, Seth Hillbrand <email address hidden> wrote:
>
> I've tried to generate the assert using this footprint but I cannot. Can
> you create a test board with the footprint that generates the assert on
> your machine and upload it?
>
> --
> You received this bug notification because you are a member of KiCad Bug
> Squad, which is subscribed to KiCad.
> https://bugs.launchpad.net/bugs/1851703
>
> Title:
> Nightly PCBNEW crash at open
>
> Status in KiCad:
> Incomplete
>
> Bug description:
>
> In the last two versions nightly, opening a project and starting pcbnew you get a kicad crash.
>
> ------------------------------------------------------------
>
> michele@fx-8350-fc30 ~]$ kicad
> 19:47:33: Debug: Adding duplicate image handler for 'PNG file'
> 19:47:33: Debug: Adding duplicate image handler for 'JPEG file'
> 19:47:33: Debug: Adding duplicate image handler for 'TIFF file'
> 19:47:33: Debug: Adding duplicate image handler for 'GIF file'
> 19:47:33: Debug: Adding duplicate image handler for 'PNM file'
> 19:47:33: Debug: Adding duplicate image handler for 'PCX file'
> 19:47:33: Debug: Adding duplicate image handler for 'IFF file'
> 19:47:33: Debug: Adding duplicate image handler for 'Windows icon file'
> 19:47:33: Debug: Adding duplicate image handler for 'Windows cursor file'
> 19:47:33: Debug: Adding duplicate image handler for 'Windows animated cursor file'
> 19:47:33: Debug: Adding duplicate image handler for 'TGA file'
> 19:47:33: Debug: Adding duplicate image handler for 'XPM file'
> 19:47:34: Debug: Loading project '/home/michele/Documenti/pcb/kicad/MqttControl/MqttControl/MqttControl.pro' settings.
> kicad: /builddir/build/BUILD/kicad-r17042-a60fb9a4/pcbnew/connectivity/connectivity_items.cpp:116: virtual const VECTOR2I CN_ITEM::GetAnchor(int) const: Assertion `false' failed.
> kicad: /builddir/build/BUILD/kicad-r17042-a60fb9a4/pcbnew/connectivity/connectivity_items.cpp:116: virtual const VECTOR2I CN_ITEM::GetAnchor(int) const: Assertion `false' failed.
> Aborted (core dumped)
>
>
> Application: KiCad
> Version: 5.99.0-unknown-r17042-a60fb9a4, debug build
> Libraries:
> wxWidgets 3.0.4
> libcurl/7.65.3 OpenSSL/1.1.1d-fips zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh/0.9.0/openssl/zlib nghttp2/1.39.2
> Platform: Linux 5.3.8-200.fc30.x86_64 x86_64, 64 bit, Little endian, wxGTK
> Build Info:
> Build date: Nov 6 2019 23:57:05
> wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
> Boost: 1.69.0
> OpenCASCADE Community Edition: 6.9.1
> Curl: 7.65.3
> Compiler: GCC 9.2.1 with C++ ABI 1013
>
> Build settings:
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_PYTHON3=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_USE_OCC=OFF
> KICAD_SPICE=ON
> KICAD_STDLIB_DEBUG=OFF
> ...

Read more...

Revision history for this message
Michele Giorato (mr-miky64) wrote :

I locked all the solder jumpers and then I selected everything and deleted.
Only the 11 solder jumpers are left. Under these conditions there are 14 assert ().
I did the DRC and 7 of them (type 1) report a strange error ....
Attached is the depopulated pcb that generates assert ().

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

Fixed in revision c29a0b19664aa2fe6ec2aa1da07e3673d9980393
https://git.launchpad.net/kicad/patch/?id=c29a0b19664aa2fe6ec2aa1da07e3673d9980393

Changed in kicad:
status: Incomplete → Fix Committed
assignee: nobody → Jeff Young (jeyjey)
Revision history for this message
Jeff Young (jeyjey) wrote :

When determining connectivity we need to know the outside 4 points of the pad where thermal spokes will connect.

For a custom shape we were doing this using and intersection between the pad's edge polygon and a vector from the shape center to the 4 sides of the bounding-box.

However, the bouding box is centered on the position, rather than the shapePos. That's no good because thermal spokes are centered on the shapePos, so there's a mismatch.

But we don't really need to solve that, as the intersection only needs cardinal points that are "out there". So I changed it to use MAX_INT / 2, rather than the bounding-box sides.

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.