Assert triggered in eeschema when trying to edit components

Bug #1468604 reported by Jon Neal
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Chris Pavlina

Bug Description

When I hover over a component and press e some times the properties window does not open. When this happens if I left click anywhere I get the following assertion:
/home/jon/dev/kicad-source-mirror/eeschema/schframe.cpp(581): assert "m_undoItem != __null" failed in SaveUndoItemInUndoList(): Cannot swap undo item structures. Bad programmer!.

I haven't done extensive testing, but so far it only seems to happen when I try to edit rescued components.

Here is a quick video that shows what is going on (sorry for the terrible quality, click the open button and it should show in a local viewer in much higher quality).
https://www.dropbox.com/s/rk6yupeimoi94ts/Screencast%20from%2006-25-2015%2012%3A06%3A50%20AM.webm

Here is the backtrace:
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff3a92309 in raise () from /lib64/libpthread.so.0
(gdb) bt
#0 0x00007ffff3a92309 in raise () at /lib64/libpthread.so.0
#1 0x00007ffff6c3bf48 in wxGUIAppTraits::ShowAssertDialog(wxString const&) ()
    at /lib64/libwx_gtk2u_core-3.0.so.0
#2 0x00007ffff62fd5a2 in ShowAssertDialog(wxString const&, int, wxString const&, wxString const&, wxString const&, wxAppTraits*) [clone .constprop.70] () at /lib64/libwx_baseu-3.0.so.0
#3 0x00007ffff62fdfc0 in wxAppConsoleBase::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*) () at /lib64/libwx_baseu-3.0.so.0
#4 0x00007ffff6bf9350 in wxApp::OnAssertFailure(wchar_t const*, int, wchar_t const*, wchar_t const*, wchar_t const*) () at /lib64/libwx_gtk2u_core-3.0.so.0
#5 0x00007ffff62fda3b in wxDefaultAssertHandler(wxString const&, int, wxString const&, wxString const&, wxString const&) () at /lib64/libwx_baseu-3.0.so.0
#6 0x00007ffff62fb8e1 in wxOnAssert(char const*, int, char const*, char const*, wchar_t const*) ()
    at /lib64/libwx_baseu-3.0.so.0
#7 0x00007fffdec99a6c in SCH_EDIT_FRAME::SaveUndoItemInUndoList(SCH_ITEM*) (this=0x7b5e10, aItem=
    0x2054fd0) at /home/jon/dev/kicad-source-mirror/eeschema/schframe.cpp:580
#8 0x00007fffdec9d6c4 in SCH_EDIT_FRAME::addCurrentItemToList(wxDC*) (this=0x7b5e10, aDC=0x7fffffffd0b0) at /home/jon/dev/kicad-source-mirror/eeschema/schframe.cpp:1274
#9 0x00007fffdec2fa3b in SCH_EDIT_FRAME::OnLeftClick(wxDC*, wxPoint const&) (this=0x7b5e10, aDC=0x7fffffffd0b0, aPosition=...) at /home/jon/dev/kicad-source-mirror/eeschema/onleftclick.cpp:86
#10 0x00007fffded611ed in EDA_DRAW_PANEL::OnMouseEvent(wxMouseEvent&) (this=0x825270, event=...)
    at /home/jon/dev/kicad-source-mirror/common/draw_panel.cpp:1103
#11 0x00007ffff62f7b6e in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () at /lib64/libwx_baseu-3.0.so.0
#12 0x00007ffff648f4a8 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#13 0x00007ffff648f5ab in wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) ()
    at /lib64/libwx_baseu-3.0.so.0
#14 0x00007ffff648f968 in wxEvtHandler::TryHereOnly(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#15 0x00007ffff648f9f3 in wxEvtHandler::ProcessEventLocally(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#16 0x00007ffff648fa55 in wxEvtHandler::ProcessEvent(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#17 0x00007ffff6eaa1cb in wxScrollHelperEvtHandler::ProcessEvent(wxEvent&) ()
    at /lib64/libwx_gtk2u_core-3.0.so.0
#18 0x00007ffff648f7b7 in wxEvtHandler::SafelyProcessEvent(wxEvent&) () at /lib64/libwx_baseu-3.0.so.0
#19 0x00007ffff6c4490b in gtk_window_button_release_callback () at /lib64/libwx_gtk2u_core-3.0.so.0
#20 0x00007ffff317d83d in _gtk_marshal_BOOLEAN__BOXED () at /lib64/libgtk-x11-2.0.so.0
#21 0x00007ffff2b31cd5 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
#22 0x00007ffff2b43539 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
#23 0x00007ffff2b4bae2 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
#24 0x00007ffff2b4c29f in g_signal_emit () at /lib64/libgobject-2.0.so.0
#25 0x00007ffff32ad83c in gtk_widget_event_internal () at /lib64/libgtk-x11-2.0.so.0
#26 0x00007ffff317bb24 in gtk_propagate_event () at /lib64/libgtk-x11-2.0.so.0
#27 0x00007ffff317beeb in gtk_main_do_event () at /lib64/libgtk-x11-2.0.so.0
#28 0x00007ffff2dd47ac in gdk_event_dispatch () at /lib64/libgdk-x11-2.0.so.0
#29 0x00007ffff1de2a8a in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#30 0x00007ffff1de2e20 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#31 0x00007ffff1de3142 in g_main_loop_run () at /lib64/libglib-2.0.so.0
#32 0x00007ffff317af37 in gtk_main () at /lib64/libgtk-x11-2.0.so.0
#33 0x00007ffff6c16485 in wxGUIEventLoop::DoRun() () at /lib64/libwx_gtk2u_core-3.0.so.0
#34 0x00007ffff633cb13 in wxEventLoopBase::Run() () at /lib64/libwx_baseu-3.0.so.0
#35 0x00007ffff62fbd86 in wxAppConsoleBase::MainLoop() () at /lib64/libwx_baseu-3.0.so.0
#36 0x000000000041ff69 in APP_SINGLE_TOP::OnRun() (this=0x6f00a0)
    at /home/jon/dev/kicad-source-mirror/common/single_top.cpp:157
#37 0x00007ffff63923b0 in wxEntry(int&, wchar_t**) () at /lib64/libwx_baseu-3.0.so.0
---Type <return> to continue, or q <return> to quit---
#38 0x000000000041bcd8 in main(int, char**) (argc=1, argv=0x7fffffffdf28)
    at /home/jon/dev/kicad-source-mirror/common/single_top.cpp:189

Changed in kicad:
assignee: nobody → Chris Pavlina (pavlina-chris)
Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Patch attached.

Changed in kicad:
status: New → In Progress
importance: Undecided → Medium
Revision history for this message
Nick Østergaard (nickoe) wrote :

Fixed in 5820.

Changed in kicad:
status: In Progress → Fix Committed
Jon Neal (reportingsjr)
Changed in kicad:
status: Fix Committed → Fix Released
Revision history for this message
pipe (pipatron) wrote :

Sorry to spoil your fix, but I just got this assertion which looks like almost the same problem:

ASSERT INFO:
/home/pipe/src/kicad/kicad.bzr/eeschema/schframe.cpp(588): assert "aItem->Type() == m_undoItem->Type()" failed in SaveUndoItemInUndoList(): Cannot swap undo item structures. Bad programmer!.

I'm not exactly sure what caused it, but I did try to edit the properties of a gate in an LM324 package using the 'E' hotkey.

The component was placed on a hierarchical sheet a couple of levels down, and it had been placed there by a paste operation. I did not immediately try to edit it though, but I wen back to other sheets and did some other operations in between.

BACKTRACE:
[1] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[2] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[3] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[4] wxEvtHandler::TryHereOnly(wxEvent&)
[5] wxEvtHandler::ProcessEventLocally(wxEvent&)
[6] wxEvtHandler::ProcessEvent(wxEvent&)
[7] wxScrollHelperEvtHandler::ProcessEvent(wxEvent&)
[8] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[9] g_closure_invoke
[10] g_signal_emit_valist
[11] g_signal_emit
[12] gtk_propagate_event
[13] gtk_main_do_event
[14] g_main_context_dispatch
[15] g_main_loop_run
[16] gtk_main
[17] wxGUIEventLoop::DoRun()
[18] wxEventLoopBase::Run()
[19] wxAppConsoleBase::MainLoop()
[20] APP_KICAD::OnRun() /home/pipe/src/kicad/kicad.bzr/kicad/kicad.cpp:288
[21] wxEntry(int&, wchar_t**)
[22] main /home/pipe/src/kicad/kicad.bzr/kicad/kicad.cpp:320
[23] __libc_start_main
[24] _start

Application: kicad
Version: (2015-10-02 BZR 6241)-product debug build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1009,GCC 5.2.1,wx containers,compatible with 2.8)
Platform: Linux 4.1.0-2-amd64 x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.58.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=OFF
         KICAD_SCRIPTING_MODULES=OFF
         KICAD_SCRIPTING_WXPYTHON=OFF
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

Almost certainly a different problem, though the same symptom. This was specifically related to the 'rescue' functionality. You should probably file a separate report.

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.