eeschema crash when mirroring more than one item at a time (eemodern)

Bug #1829833 reported by Dino Ghilardi on 2019-05-21
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Critical
Jeff Young

Bug Description

Trying to mirror a polyline in eeschema crashes (SIGABRT).

To reproduce the bug:

-Create a new project/schematic
-Draw "connected graphic lines", two or more segments/lines.
-Select the lines with a block operation
-press Y or X or use pop-up menu "mirror around vertical/horizontal axis"

and eeschema crashes.

Trying to mirror a single segment does not crash but does not work also (nothing happens).

Also crashes if in the selected block there are two segments and other items.

gdb message:
--------------------
Thread 1 "kicad" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: File o directory non esistente.
(gdb)

-----------------------------------
backtrace:
(gdb) backtrace
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff34ca42a in __GI_abort () at abort.c:89
#2 0x00007ffff34c1e67 in __assert_fail_base (fmt=<optimized out>,
    assertion=assertion@entry=0x7fffda781d39 "this->is_initialized()",
    file=file@entry=0x7fffda781cf0 "/home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp",
    line=line@entry=1206,
    function=function@entry=0x7fffda781d60 <boost::optional<VECTOR2<int> >::get() const::__PRETTY_FUNCTION__> "boost::optional<T>::reference_const_type boost::optional<T>::get() const [with T = VECTOR2<int>; boost::optional<T>::reference_const_type = const VECTOR2<int>&]") at assert.c:92
#3 0x00007ffff34c1f12 in __GI___assert_fail (assertion=0x7fffda781d39 "this->is_initialized()",
    file=0x7fffda781cf0 "/home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp", line=1206,
    function=0x7fffda781d60 <boost::optional<VECTOR2<int> >::get() const::__PRETTY_FUNCTION__> "boost::optional<T>::reference_const_type boost::optional<T>::get() const [with T = VECTOR2<int>; boost::optional<T>::reference_const_type = const VECTOR2<int>&]")
    at assert.c:101
#4 0x00007fffda47ae27 in boost::optional<VECTOR2<int> >::get (this=0x5555570e6878)
    at /home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp:1206
#5 0x00007fffda47aca6 in boost::optional<VECTOR2<int> >::operator*() const & (this=0x5555570e6878)
    at /home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp:1223
#6 0x00007fffda47ac38 in SELECTION::GetReferencePoint (this=0x5555570e6848)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/include/tool/selection.h:205
#7 0x00007fffda48ac5a in SCH_EDIT_TOOL::Mirror (this=0x55555756faa0, aEvent=...)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/eeschema/tools/sch_edit_tool.cpp:735
#8 0x00007fffda49495c in std::__invoke_impl<int, int (SCH_EDIT_TOOL::* const&)(TOOL_EVENT const&), SCH_EDIT_TOOL*&, TOOL_EVENT const&> (__f=
    @0x55555919af10: (int (SCH_EDIT_TOOL::*)(SCH_EDIT_TOOL * const, const TOOL_EVENT &)) 0x7fffda48a5cc <SCH_EDIT_TOOL::Mirror(TOOL_EVENT const&)>, __t=@0x55555919af20: 0x55555756faa0, __args#0=...) at /usr/include/c++/6/functional:227
#9 0x00007fffda4947ad in std::__invoke<int (SCH_EDIT_TOOL::* const&)(TOOL_EVENT const&), SCH_EDIT_TOOL*&, TOOL_EVENT const&> (
    __fn=
    @0x55555919af10: (int (SCH_EDIT_TOOL::*)(SCH_EDIT_TOOL * const, const TOOL_EVENT &)) 0x7fffda48a5cc <SCH_EDIT_TOOL::Mirror(TOOL_EVENT const&)>, __args#0=@0x55555919af20: 0x55555756faa0, __args#1=...) at /usr/include/c++/6/functional:251
#10 0x00007fffda4945d7 in std::_Mem_fn_base<int (SCH_EDIT_TOOL::*)(TOOL_EVENT const&), true>::operator()<SCH_EDIT_TOOL*&, TOOL_EVENT const&> (this=0x55555919af10, __args#0=@0x55555919af20: 0x55555756faa0, __args#1=...) at /usr/include/c++/6/functional:604
#11 0x00007fffda494361 in std::_Bind<std::_Mem_fn<int (SCH_EDIT_TOOL::*)(TOOL_EVENT const&)> (SCH_EDIT_TOOL*, std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x55555919af10,

---------------------------------------
kicad info:

Thread 1 "kicad" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51 ../sysdeps/unix/sysv/linux/raise.c: File o directory non esistente.
(gdb)
(gdb) backtrace
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007ffff34ca42a in __GI_abort () at abort.c:89
#2 0x00007ffff34c1e67 in __assert_fail_base (fmt=<optimized out>,
    assertion=assertion@entry=0x7fffda781d39 "this->is_initialized()",
    file=file@entry=0x7fffda781cf0 "/home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp",
    line=line@entry=1206,
    function=function@entry=0x7fffda781d60 <boost::optional<VECTOR2<int> >::get() const::__PRETTY_FUNCTION__> "boost::optional<T>::reference_const_type boost::optional<T>::get() const [with T = VECTOR2<int>; boost::optional<T>::reference_const_type = const VECTOR2<int>&]") at assert.c:92
#3 0x00007ffff34c1f12 in __GI___assert_fail (assertion=0x7fffda781d39 "this->is_initialized()",
    file=0x7fffda781cf0 "/home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp", line=1206,
    function=0x7fffda781d60 <boost::optional<VECTOR2<int> >::get() const::__PRETTY_FUNCTION__> "boost::optional<T>::reference_const_type boost::optional<T>::get() const [with T = VECTOR2<int>; boost::optional<T>::reference_const_type = const VECTOR2<int>&]")
    at assert.c:101
#4 0x00007fffda47ae27 in boost::optional<VECTOR2<int> >::get (this=0x5555570e6878)
    at /home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp:1206
#5 0x00007fffda47aca6 in boost::optional<VECTOR2<int> >::operator*() const & (this=0x5555570e6878)
    at /home/dinoghi/SANDBOXKICAD5/usr/boost_1_69_0/boost/optional/optional.hpp:1223
#6 0x00007fffda47ac38 in SELECTION::GetReferencePoint (this=0x5555570e6848)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/include/tool/selection.h:205
#7 0x00007fffda48ac5a in SCH_EDIT_TOOL::Mirror (this=0x55555756faa0, aEvent=...)
    at /home/dinoghi/SANDBOXKICAD5/src/kicad/eeschema/tools/sch_edit_tool.cpp:735
#8 0x00007fffda49495c in std::__invoke_impl<int, int (SCH_EDIT_TOOL::* const&)(TOOL_EVENT const&), SCH_EDIT_TOOL*&, TOOL_EVENT const&> (__f=
    @0x55555919af10: (int (SCH_EDIT_TOOL::*)(SCH_EDIT_TOOL * const, const TOOL_EVENT &)) 0x7fffda48a5cc <SCH_EDIT_TOOL::Mirror(TOOL_EVENT const&)>, __t=@0x55555919af20: 0x55555756faa0, __args#0=...) at /usr/include/c++/6/functional:227
#9 0x00007fffda4947ad in std::__invoke<int (SCH_EDIT_TOOL::* const&)(TOOL_EVENT const&), SCH_EDIT_TOOL*&, TOOL_EVENT const&> (
    __fn=
    @0x55555919af10: (int (SCH_EDIT_TOOL::*)(SCH_EDIT_TOOL * const, const TOOL_EVENT &)) 0x7fffda48a5cc <SCH_EDIT_TOOL::Mirror(TOOL_EVENT const&)>, __args#0=@0x55555919af20: 0x55555756faa0, __args#1=...) at /usr/include/c++/6/functional:251
#10 0x00007fffda4945d7 in std::_Mem_fn_base<int (SCH_EDIT_TOOL::*)(TOOL_EVENT const&), true>::operator()<SCH_EDIT_TOOL*&, TOOL_EVENT const&> (this=0x55555919af10, __args#0=@0x55555919af20: 0x55555756faa0, __args#1=...) at /usr/include/c++/6/functional:604
#11 0x00007fffda494361 in std::_Bind<std::_Mem_fn<int (SCH_EDIT_TOOL::*)(TOOL_EVENT const&)> (SCH_EDIT_TOOL*, std::_Placeholder<1>)>::__call<int, TOOL_EVENT const&, 0ul, 1ul>(std::tuple<TOOL_EVENT const&>&&, std::_Index_tuple<0ul, 1ul>) (this=0x55555919af10,

The same happens if in the selection there are two components.

summary: - eeschema crash on "two lines mirror"
+ eeschema crash when mirroring more than one item at a time
Changed in kicad:
importance: Undecided → Critical
milestone: none → 6.0.0-rc1
status: New → Triaged
tags: added: eeschema
Dino Ghilardi (dino-ghilardi) wrote :

using git bisect:

5ea46e8b783becfde589d52e3a9bbab70ef55305 is the first bad commit
commit 5ea46e8b783becfde589d52e3a9bbab70ef55305
Author: Tomasz Włostowski <email address hidden>
Date: Mon May 20 20:51:24 2019 +0200

    eemodern: initial attempt at inline drag/move actions

:040000 040000 e9aa041796867b42ad9ff6ea3e3e27e2457c6b19 d7f6bcc564094f4d82fe7563a81639930d042db3 M eeschema

Dino Ghilardi (dino-ghilardi) wrote :

it seems that in sch_edit_tool.cpp, the line

mirrorPoint = (wxPoint)selection.GetReferencePoint();

crashes if in the selection contains more than one object.

summary: - eeschema crash when mirroring more than one item at a time
+ eeschema crash when mirroring more than one item at a time (eemodern)
Jeff Young (jeyjey) on 2019-05-22
Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
status: Triaged → In Progress
KiCad Janitor (kicad-janitor) wrote :

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

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

Duplicates of this bug

Other bug subscribers