Skip to content

Crash in `SCHEMATIC::SCHEMATIC'::`2'::<T>::operator() when editing text properties via Properties panel

Description

Schematic Editor intermittently hangs and crashes when a Symbol's text object (e.g., Reference or Value) is edited directly via Properties Manager.

Steps to reproduce

  1. Open a demo project (I used "pic_programmer").
  2. Click directly on a reference designator or value (not the parent symbol, but the specific text object).
  3. In the Properties Manager panel, under the "Text Properties" section, click in the "Text" value field, change the value, and press 'Enter'.
  4. Sometimes the app will hang and ungracefully crash. If not, then close Schematic Editor, and repeat from Step 1. (For me, it happens after 2 or 3 attempts).

See attached screen recording.

eeschema crash after edit text property.mp4

KiCad Version

Application: KiCad x64 on x64

Version: 8.0.2, release build

Libraries:
	wxWidgets 3.2.4
	FreeType 2.12.1
	HarfBuzz 8.3.0
	FontConfig 2.14.2
	libcurl/8.5.0-DEV Schannel zlib/1.3

Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
	Date: Apr 27 2024 23:05:17
	wxWidgets: 3.2.4 (wchar_t,wx containers)
	Boost: 1.83.0
	OCC: 7.7.1
	Curl: 8.5.0-DEV
	ngspice: 42
	Compiler: Visual C++ 1936 without C++ ABI

Build settings:

Sentry Issue: KICAD-372

EXCEPTION_ACCESS_VIOLATION_READ / 0xffffffffffffffff: Fatal Error: EXCEPTION_ACCESS_VIOLATION_READ / 0xffffffffffffffff
  File "schematic.cpp", line 67, in `SCHEMATIC::SCHEMATIC'::`2'::<T>::operator()
    SCH_SHEET_PATH sheetPath = CurrentSheet();
  File "functional", line 861, in std::_Func_class<T>::operator()
    return _Impl->_Do_call(_STD forward<_Types>(_Args)...);
  File "property_mgr.cpp", line 443, in `PROPERTY_MANAGER::PropertyChanged'::`2'::<T>::operator()
    listener( aObject, aProperty, m_managedCommit );
  File "property_mgr.cpp", line 449, in PROPERTY_MANAGER::PropertyChanged
    callListeners( objectClass.m_id );
  File "inspectable.h", line 69, in INSPECTABLE::Set
    propMgr.PropertyChanged( this, aProperty );
...
(51 additional frame(s) were not displayed)
Thread 28700 Crashed:
0   _eeschema.dll                   0x7ff8b82ee3c8      `SCHEMATIC::SCHEMATIC'::`2'::<T>::operator() (schematic.cpp:67)
1   _eeschema.dll                   0x7ff8b85284e5      [inlined] std::_Func_class<T>::operator() (functional:861)
2   _eeschema.dll                   0x7ff8b85284e5      `PROPERTY_MANAGER::PropertyChanged'::`2'::<T>::operator() (property_mgr.cpp:443)
3   _eeschema.dll                   0x7ff8b85292e9      PROPERTY_MANAGER::PropertyChanged (property_mgr.cpp:449)
4   _eeschema.dll                   0x7ff8b8193cc1      [inlined] INSPECTABLE::Set (inspectable.h:69)
5   _eeschema.dll                   0x7ff8b8193cc1      SCH_PROPERTIES_PANEL::valueChanged (sch_properties_panel.cpp:199)
6   wxbase32u_vc_custom.dll         0x7ff98b7360f3      wxAppConsoleBase::CallEventHandler (appbase.cpp:673)
7   wxbase32u_vc_custom.dll         0x7ff98b82dfde      wxEvtHandler::ProcessEventIfMatchesId (event.cpp:1431)
8   wxbase32u_vc_custom.dll         0x7ff98b82eaf2      wxEvtHandler::SearchDynamicEventTable (event.cpp:1901)
9   wxbase32u_vc_custom.dll         0x7ff98b82ee41      wxEvtHandler::TryHereOnly (event.cpp:1624)
10  wxbase32u_vc_custom.dll         0x7ff98b82df42      [inlined] wxEvtHandler::TryBeforeAndHere (event.h:4007)
11  wxbase32u_vc_custom.dll         0x7ff98b82df42      [inlined] wxEvtHandler::ProcessEventLocally (event.cpp:1561)
12  wxbase32u_vc_custom.dll         0x7ff98b82df42      wxEvtHandler::ProcessEvent (event.cpp:1534)
13  wxmsw32u_core_vc_custom.dll     0x7ff8d4730164      wxWindowBase::TryAfter (wincmn.cpp:3536)
14  wxbase32u_vc_custom.dll         0x7ff98b82df61      wxEvtHandler::ProcessEvent (event.cpp:1547)
15  wxmsw32u_core_vc_custom.dll     0x7ff8d4768fbf      wxScrollHelperEvtHandler::ProcessEvent (scrlwing.cpp:192)
16  wxbase32u_vc_custom.dll         0x7ff98b82ea59      wxEvtHandler::SafelyProcessEvent (event.cpp:1650)
17  wxmsw32u_propgrid_vc_custom.dll 0x7ff9a9768938      wxPropertyGrid::SendEvent (propgrid.cpp:4730)
18  wxmsw32u_propgrid_vc_custom.dll 0x7ff9a97608c0      wxPropertyGrid::DoPropertyChanged (propgrid.cpp:3443)
19  wxmsw32u_propgrid_vc_custom.dll 0x7ff9a975d7b2      wxPropertyGrid::CommitChangesFromEditor (propgrid.cpp:2962)
20  _eeschema.dll                   0x7ff8b84afd4c      PROPERTIES_PANEL::onCharHook (properties_panel.cpp:434)
21  wxbase32u_vc_custom.dll         0x7ff98b7360f3      wxAppConsoleBase::CallEventHandler (appbase.cpp:673)
22  wxbase32u_vc_custom.dll         0x7ff98b82dfde      wxEvtHandler::ProcessEventIfMatchesId (event.cpp:1431)
23  wxbase32u_vc_custom.dll         0x7ff98b82eaf2      wxEvtHandler::SearchDynamicEventTable (event.cpp:1901)
24  wxbase32u_vc_custom.dll         0x7ff98b82ee41      wxEvtHandler::TryHereOnly (event.cpp:1624)
25  wxbase32u_vc_custom.dll         0x7ff98b82df42      [inlined] wxEvtHandler::TryBeforeAndHere (event.h:4007)
26  wxbase32u_vc_custom.dll         0x7ff98b82df42      [inlined] wxEvtHandler::ProcessEventLocally (event.cpp:1561)
27  wxbase32u_vc_custom.dll         0x7ff98b82df42      wxEvtHandler::ProcessEvent (event.cpp:1534)
28  wxmsw32u_core_vc_custom.dll     0x7ff8d4730164      wxWindowBase::TryAfter (wincmn.cpp:3536)
29  wxbase32u_vc_custom.dll         0x7ff98b82df61      wxEvtHandler::ProcessEvent (event.cpp:1547)
30  wxmsw32u_core_vc_custom.dll     0x7ff8d4768fbf      wxScrollHelperEvtHandler::ProcessEvent (scrlwing.cpp:192)
31  wxmsw32u_core_vc_custom.dll     0x7ff8d4730164      wxWindowBase::TryAfter (wincmn.cpp:3536)
32  wxbase32u_vc_custom.dll         0x7ff98b82df61      wxEvtHandler::ProcessEvent (event.cpp:1547)
33  wxbase32u_vc_custom.dll         0x7ff98b82ea59      wxEvtHandler::SafelyProcessEvent (event.cpp:1650)
34  wxmsw32u_core_vc_custom.dll     0x7ff8d48b875b      wxKeyboardHook (window.cpp:7230)
35  USER32.dll                      0x7ff9e0721991      DispatchHookW
36  USER32.dll                      0x7ff9e071ee38      CallHookWithSEH
37  USER32.dll                      0x7ff9e071ed2d      _fnHkINDWORD
38  ntdll.dll                       0x7ff9e1970e63      KiUserCallbackDispatch
39  win32u.dll                      0x7ff9df7b1063      ZwUserPeekMessage
40  USER32.dll                      0x7ff9e070a2f2      PeekMessage
41  USER32.dll                      0x7ff9e070a252      PeekMessageW
42  wxbase32u_vc_custom.dll         0x7ff98b842ce6      wxMSWEventLoopBase::GetNextMessageTimeout (evtloopconsole.cpp:109)
43  wxbase32u_vc_custom.dll         0x7ff98b842c7e      wxMSWEventLoopBase::GetNextMessage (evtloopconsole.cpp:99)
44  wxmsw32u_core_vc_custom.dll     0x7ff8d48c41d7      wxGUIEventLoop::Dispatch (evtloop.cpp:171)
45  wxbase32u_vc_custom.dll         0x7ff98b767bb2      [inlined] wxEventLoopManual::ProcessEvents (evtloopcmn.cpp:234)
46  wxbase32u_vc_custom.dll         0x7ff98b767bb2      wxEventLoopManual::DoRun (evtloopcmn.cpp:288)
47  wxbase32u_vc_custom.dll         0x7ff98b767e39      wxEventLoopBase::Run (evtloopcmn.cpp:87)
48  wxbase32u_vc_custom.dll         0x7ff98b738606      wxAppConsoleBase::MainLoop (appbase.cpp:381)
49  kicad.exe                       0x7ff7f738d559      APP_KICAD::OnRun (kicad.cpp:490)
50  wxbase32u_vc_custom.dll         0x7ff98b7b4e9b      wxEntryReal (init.cpp:497)
51  wxbase32u_vc_custom.dll         0x7ff98b88c827      wxEntry (main.cpp:175)
52  kicad.exe                       0x7ff7f75c56c9      [inlined] invoke_main (exe_common.inl:102)
53  kicad.exe                       0x7ff7f75c56c9      __scrt_common_main_seh (exe_common.inl:288)
54  KERNEL32.DLL                    0x7ff9e1757343      BaseThreadInitThunk
55  ntdll.dll                       0x7ff9e19226b0      RtlUserThreadStart
Edited by dsa-t