pcbnew assertion failed @ rtree.h:1643

Bug #1753218 reported by Petr Spilka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Critical
Tomasz Wlostowski

Bug Description

Sometimes, after netlist load in pcbnew, program will crash. Workaround for bug (in rtree implementation) have load netlist sucessfully is by step-by-step method:

Crash happens? -> Yes -> Remove some new added components in eeschema and generate new netlist -> Crashed again? Delete some components again...after sucessfull load in sequence (adding small amount of components in repeat).

Now - this mysterious state has been stored in my kicad_pcb file. So problem is now easy to reproduce. Oh ya, at last! I have tried to fix that problem by myself in code, but rtree structure is not easy to understand by me.

To reproduce:

pcbnew causes_assert.kicad_pcb
10:46:35: Debug: Adding locale lookup path: /usr/share/kicad/internat
10:46:36: Debug: Adding duplicate image handler for 'PNG file'
10:46:36: Debug: Adding duplicate image handler for 'JPEG file'
10:46:36: Debug: Adding duplicate image handler for 'TIFF file'
10:46:36: Debug: Adding duplicate image handler for 'GIF file'
10:46:36: Debug: Adding duplicate image handler for 'PNM file'
10:46:36: Debug: Adding duplicate image handler for 'PCX file'
10:46:36: Debug: Adding duplicate image handler for 'IFF file'
10:46:36: Debug: Adding duplicate image handler for 'Windows icon file'
10:46:36: Debug: Adding duplicate image handler for 'Windows cursor file'
10:46:36: Debug: Adding duplicate image handler for 'Windows animated cursor file'
10:46:36: Debug: Adding duplicate image handler for 'TGA file'
10:46:36: Debug: Adding duplicate image handler for 'XPM file'
10:46:37: Debug: Loading project '/tmp/causes_assert.pro' settings.
10:46:37: Debug: Skipping general section token 'links'
10:46:37: Debug: Skipping general section token 'area'
10:46:37: Debug: Skipping general section token 'drawings'
10:46:37: Debug: Skipping general section token 'tracks'
10:46:37: Debug: Skipping general section token 'zones'
10:46:37: Debug: Skipping general section token 'symbol'
pcbnew: /build/kicad-Z0yiN4/kicad-4.0.7+dfsg1/include/geometry/rtree.h:1643: void RTree<DATATYPE, ELEMTYPE, NUMDIMS, ELEMTYPEREAL, TMAXNODES, TMINNODES>::Classify(int, int, RTree<DATATYPE, ELEMTYPE, NUMDIMS, ELEMTYPEREAL, TMAXNODES, TMINNODES>::PartitionVars*) [with DATATYPE = KIGFX::VIEW_ITEM*; ELEMTYPE = int; int NUMDIMS = 2; ELEMTYPEREAL = float; int TMAXNODES = 8; int TMINNODES = 4]: Assertion `!a_parVars->m_taken[a_index]' failed.

Application: pcbnew
Version: 4.0.7+dfsg1-1 release build
wxWidgets: Version 3.0.3 (debug,wchar_t,compiler with C++ ABI 1011,GCC 7.2.0,wx containers,compatible with 2.8)
Platform: Linux 4.2.3 i686, 32 bit, Little endian, wxGTK
Boost version: 1.62.0
Curl version: libcurl/7.50.1 OpenSSL/1.0.2h zlib/1.2.8 libidn/1.33 libssh2/1.7.0 nghttp2/1.30.0 librtmp/2.3
         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

Tags: pcbnew
Revision history for this message
Petr Spilka (petabeda) wrote :
Jeff Young (jeyjey)
Changed in kicad:
importance: Undecided → Critical
milestone: none → 5.0.0-rc2
tags: removed: assert rtree
Revision history for this message
Seth Hillbrand (sethh) wrote :

@Jeff-

I'm not observing this issue with nightly on debian. Did you recreate it?

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

@Peter: Me neither, can't reproduce it with the file you've attached. Could you provide a stack trace leading to the assertion failure or an exact way to reproduce the issue?

Changed in kicad:
assignee: nobody → Tomasz Wlostowski (twlostow)
Revision history for this message
Jeff Young (jeyjey) wrote :

@Seth, no, afraid not. (FWIW I would have set it to Confirmed or Triaged if I had.)

Revision history for this message
Petr Spilka (petabeda) wrote :

Thank you for help - tested on Windows build now - file will be loaded well, thus problem is only on my linux setup.

Tomorrow I will send that stack trace.

So confirmed that this bug depends on system setup.

Canˇt reproduce on another build even:

Application: kicad
Version: 4.0.7 release build
wxWidgets: Version 3.0.3 (debug,wchar_t,compiler with C++ ABI 1011,GCC 7.1.0,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.60.0
Curl version: libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
         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

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

Hi,

I just realized you're using the 4 stable version. Could you check if the bug shows up in the nightlies?

Tom

Revision history for this message
Petr Spilka (petabeda) wrote :

Hi,

appologies for everybody here - I tested on the nightly version and file loaded sucessfully. So closing the case. My mistake.

Thank you all of you for this very well done open-source project!

Application: pcbnew
Version: (5.0.0-rc2-dev-101-gf7ef010fe), debug build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.58.0 OpenSSL/1.0.2h zlib/1.2.8 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) libssh2/1.7.0 nghttp2/1.30.0 librtmp/2.3
Platform: Linux 4.2.3 i686, 32 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.62.0
    Curl: 7.58.0
    Compiler: GCC 5.2.1 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

Petr

Changed in kicad:
status: New → Fix Committed
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.