board+filled zones crashes 3d-viewer

Bug #1801188 reported by Thomas Pointhuber
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
High
Seth Hillbrand

Bug Description

# HowTo reproduce

1. importing https://github.com/rad1o/hardware into KiCad
2. loading 3d-view, starting raytracer
3. while doing raytracing fill the zones

# Stacktrace

```
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Core was generated by `kicad'.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
#0 0x00007fd67aea36a1 in ?? () from /usr/lib/libwx_baseu-3.1.so.1
[Current thread is 1 (Thread 0x7fd6149f3700 (LWP 15411))]
(gdb) bt full
#0 0x00007fd67aea36a1 in () at /usr/lib/libwx_baseu-3.1.so.1
#1 0x00007fd67ae9f294 in wxOnAssert(char const*, int, char const*, char const*, char const*) () at /usr/lib/libwx_baseu-3.1.so.1
#2 0x00007fd64f0505d9 in CFILLEDCIRCLE2D::CFILLEDCIRCLE2D(glm::vec<2, float, (glm::qualifier)0> const&, float, BOARD_ITEM const&) (this=0x7fd63015d2b0, aCenter=..., aRadius=0, aBoardItem=...)
    at /home/thomas/Projekte/Kicad/kicad-source-mirror/3d-viewer/3d_rendering/3d_render_raytracing/shapes2D/cfilledcircle2d.cpp:39
#3 0x00007fd64f016d4f in CINFO3D_VISU::AddSolidAreasShapesToContainer(ZONE_CONTAINER const*, CGENERICCONTAINER2D*, PCB_LAYER_ID)
    (this=0x55a2eb450bf8, aZoneContainer=0x55a2f0fa4130, aDstContainer=0x55a2e74d6af0, aLayerId=PCB_LAYER_ID::PCBNEW_LAYER_ID_START)
    at /home/thomas/Projekte/Kicad/kicad-source-mirror/3d-viewer/3d_canvas/create_3Dgraphic_brd_items.cpp:873
        a = @0x7fd63002e348: {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183321131, y = 88132350}
        b = @0x7fd63002e350: {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183326531, y = 88131968}
        start3DU = {{x = 11.3336096, r = 11.3336096, s = 11.3336096}, {y = -5.44867706, g = -5.44867706, t = -5.44867706}}
        end3DU = {{x = 11.3339434, r = 11.3339434, s = 11.3339434}, {y = -5.4486537, g = -5.4486537, t = -5.4486537}}
        j = 1
        pathOutline =
              @0x7fd630163c20: {<SHAPE> = {_vptr$SHAPE = 0x7fd64fc86600 <vtable for SHAPE_LINE_CHAIN+16>, m_type = SH_LINE_CHAIN}, m_points = std::vector of length 3, capacity 3 = {{static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183955931, y = 88899368}, {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183321131, y = 88132350}, {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183326531, y = 88131968}}, m_closed = true, m_bbox = {m_Pos = {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 0, y = 0}, m_Size = {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 0, y = 0}}}
        i = 0
        polyList =
            {<SHAPE> = {_vptr$SHAPE = 0x7fd64fc866a0 <vtable for SHAPE_POLY_SET+16>, m_type = SH_POLY_SET}, m_polys = std::vector of length 1, capacity 1 = {std::vector of length 1, capacity 1 = {{<SHAPE> = {_vptr$SHAPE = 0x7fd64fc86600 <vtable for SHAPE_LINE_CHAIN+16>, m_type = SH_LINE_CHAIN}, m_points = std::vector of length 3, capacity 3 = {{static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183955931, y = 88899368}, {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183321131, y = 88132350}, {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 183326531, y = 88131968}}, m_closed = true, m_bbox = {m_Pos = {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 0, y = 0}, m_Size = {static ECOORD_MAX = 9223372036854775807, static ECOORD_MIN = -9223372036854775808, x = 0, y = 0}}}}}, m_triangulatedPolys = std::vector of length 1, capacity 1 = {std::unique_ptr<SHAPE_POLY_SET::TRIANGULATED_POLYGON> = {get() = 0x7fd63001b270}}, m_triangulationValid = true, m_hash = {m_valid = true, m_ctx = {data = "\001\000\000\000\001\000\000\000\003\000\000\000\333\361\366\n(\177L\005+B\355\n\376\312@\005CW\355\n\200\311@\005\200", '\000' <repeats 19 times>, " \001\000\000\000\000\000", datalen = 36, bitlen = {288, 0}, state = {710717565, 2701996702, 1501632333, 1968256566}}, m_hash = "}\260\\*\236\062\r\241M\027\201Y66Qu"}}
#4 0x00007fd64f00cb36 in CINFO3D_VISU::createLayers(REPORTER*)::$_0::operator()() const (this=0x55a2f0d25948)
    at /home/thomas/Projekte/Kicad/kicad-source-mirror/3d-viewer/3d_canvas/create_layer_items.cpp:814
        zone = 0x55a2f0fa4130
        layerContainer = {first = PCB_LAYER_ID::PCBNEW_LAYER_ID_START, second = 0x55a2e74d6af0}
        areaId = 12
#5 0x00007fd64f00c8dd in std::__invoke_impl<void, CINFO3D_VISU::createLayers(REPORTER*)::$_0>(std::__invoke_other, CINFO3D_VISU::createLayers(REPORTER*)::$_0&&) (__f=...)
    at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/invoke.h:60
#6 0x00007fd64f00c86d in std::__invoke<CINFO3D_VISU::createLayers(REPORTER*)::$_0>(CINFO3D_VISU::createLayers(REPORTER*)::$_0&&) (__fn=...)
    at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/bits/invoke.h:95
#7 0x00007fd64f00c845 in _ZNSt6thread8_InvokerISt5tupleIJZN12CINFO3D_VISU12createLayersEP8REPORTERE3$_0EEE9_M_invokeIJLm0EEEEDTclsr3stdE8__invokespcl10_S_declvalIXT_EEEEESt12_Index_tupleIJXspT_EEE
    (this=0x55a2f0d25948) at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/thread:244
#8 0x00007fd64f00c815 in std::thread::_Invoker<std::tuple<CINFO3D_VISU::createLayers(REPORTER*)::$_0> >::operator()() (this=0x55a2f0d25948)
    at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/thread:253
#9 0x00007fd64f00c6f9 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<CINFO3D_VISU::createLayers(REPORTER*)::$_0> > >::_M_run() (this=0x55a2f0d25940)
    at /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/8.2.1/../../../../include/c++/8.2.1/thread:196
#10 0x00007fd679923063 in std::execute_native_thread_routine(void*) (__p=0x55a2f0d25940) at /build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc:80
        __t = std::unique_ptr<std::thread::_State> = {get() = 0x55a2f0d25940}
#11 0x00007fd6796aca9d in start_thread () at /usr/lib/libpthread.so.0
#12 0x00007fd6795dcb23 in clone () at /usr/lib/libc.so.6
```

# System Information

Application: kicad
Version: (6.0.0-rc1-dev-1108-g8be3471ba), debug build
Libraries:
    wxWidgets 3.1.1
    libcurl/7.61.1 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.1.1 (wchar_t,wx containers) GTK+ 2.24
    Boost: 1.68.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.61.1
    Compiler: Clang 7.0.0 with C++ ABI 1002

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    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

tags: added: 3d-viewer
Seth Hillbrand (sethh)
Changed in kicad:
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Seth Hillbrand (sethh) wrote :

@Thomas- Does this throw the assert when just raytracing?

Revision history for this message
Thomas Pointhuber (pointhi) wrote :

@sethh

The crash seems to appear when loading the imported board into 3d-view after filling the zones. So it seems to be not a raytracing error, but a 3d-viewer error in general.

I attached the board which causes the crash reproducible on my system. Just try to open the 3d-viewer.

summary: - Fillling Zone while Raytrace crashes KiCad
+ board+filled zones crashes 3d-viewer
Revision history for this message
Seth Hillbrand (sethh) wrote :

Agreed. It's also not a crash but an assert when trying to create a zero-radius circle in the tracer. We import Eagle files with zone width 0 but use that value in the tracer for a filled circle radius.

Thanks for checking! I'll fix this shortly

Changed in kicad:
importance: Critical → High
milestone: none → 5.0.2
assignee: nobody → Seth Hillbrand (sethh)
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

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

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