Pcbnew: lockup entering new custom pad shape

Bug #1766602 reported by Reece Pollack
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Expired
Critical
Unassigned

Bug Description

While creating a new custom pad shape, at least the second of this session, KiCad locked up (non-responsive to any buttons) after clicking on "Add primitive". A screenshot is attached. I can move windows, including the four KiCad windows (Project, Eeschema, Footprint Editor, Pad Properties) and the contents of the windows is properly displayed even if portions that were obscured are now displayed, though resizing a window causes loss of display content so that may be the window manager at work. A "top" display shows one CPU at 100% running "kicad".

I'd been running KiCad for quite a while, viewing schematics and boards from several projects. I launched the footprint editor from the project manager to create a couple of custom footprints. Creation of the first custom footprint went well. When creating the second custom footprint I tested the ability to delete multiple primitives (Bug #1766120). I then began entering the primitives for the second pad. Upon clicking "Add primitive" to enter the 8th primitive, the expected dialog box did not appear and KiCad stopped responding.

Neither strace nor ltrace show any activity. The strace output is attached.

I forced a core dump. At 2.0 GB it's far too large to attach to this bug report, though I will retain it should someone want to copy it or have me probe it. The gdb backtrace output is attached.

After forcing the termination of the process I restarted KiCad. The version dump is below. This was built from sources on a private branch based on this git commit:

    4302394 Consistency between dialog titles and menu items.

Application: kicad
Version: (5.0.0-rc2-dev-493-g489b85b), debug build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 GnuTLS/3.4.10 zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.13.0-38-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
    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=ON
    KICAD_SCRIPTING_ACTION_MENU=OFF
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_SPICE=ON

Revision history for this message
Reece Pollack (reece-pollack) wrote :
Revision history for this message
Reece Pollack (reece-pollack) wrote :

The xz-compressed core dump file is 55 MB. I'll be happy to push that somewhere.

The xz-compressed tarball of the sources and build directory, which might help when using gdb to analyze the core dump, would be 558 MB.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Hi Reece,

I think for now, the most useful and easy to provide information would be the stacktrace. A reliable way to reproduce the crash would be even better, but I suppose it is not so simple.

Changed in kicad:
milestone: none → 5.0.0-rc2
Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Reece, did you find a way to reproduce the bug by any chance? If no, would you post the stacktrace for analysis?

Revision history for this message
Reece Pollack (reece-pollack) wrote :

@orsonmmz: There is a stack backtrace in the Zip file attached to Comment #1.

Revision history for this message
jean-pierre charras (jp-charras) wrote :

The backtrace shows a possible issue (hang) in Fracture()

I remember we had (a long time ago, and in rare cases) a similar issue in zone fill calculations.
It was due to a possible hang in SHAPE_POLY_SET::fractureSingle() code.

It was fixed by using SHAPE_POLY_SET::PM_STRICTLY_SIMPLE instead of SHAPE_POLY_SET::PM_FAST option when creating the polygon before fracturing.

If this is the case here:
In pad_custom_shape_functions.cpp, lines 253 and 254:
replace
        aMergedPolygon->BooleanAdd( aux_polyset, SHAPE_POLY_SET::PM_FAST );
        aMergedPolygon->Fracture( SHAPE_POLY_SET::PM_FAST );
by
        aMergedPolygon->BooleanAdd( aux_polyset, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );
        aMergedPolygon->Fracture( SHAPE_POLY_SET::PM_STRICTLY_SIMPLE );

and see if Pcbnew still hangs.

Of course fixing the Fracture() code could be good (or at least adding a wxASSERT).

Jeff Young (jeyjey)
Changed in kicad:
importance: Undecided → Critical
Revision history for this message
jean-pierre charras (jp-charras) wrote :

@Reece,
I am guessing you are buildind Kicad yourself.

Have you a chance to test the fix I suggested in #6?

I am unable to reproduce your issue.

Changed in kicad:
status: New → Incomplete
Changed in kicad:
milestone: 5.0.0-rc2 → 5.0.0-rc3
Revision history for this message
jean-pierre charras (jp-charras) wrote :

@Orson,

FYI, I committed some time ago the patch I proposed in #6
However I never encountered this bug, so I do not really know if the patch fixed this issue.

Revision history for this message
Maciej Suminski (orsonmmz) wrote :

Thank you Jean-Pierre. Let's leave the bug report marked as 'Incomplete' in the 5.0rc3 list, so we may give it another trial later.

Seth Hillbrand (sethh)
Changed in kicad:
milestone: 5.0.0-rc3 → none
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for KiCad because there has been no activity for 60 days.]

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.