Skip to content

[7.99] pcbnew crash when hiding all layers

Description

With a pcb open in pcbnew, first clicking 'hide all layers but active':

grafik

Then clicking the 'eye' icon of the last active layer causes KiCad to crash every time (doesn't seem to happen on an empty canvas):

grafik

(495c.2eb0): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
_pcbnew!EDA_ITEM::IsBrightened [inlined in _pcbnew!KIGFX::PCB_RENDER_SETTINGS::GetColor+0x2c1]:
00007ff8`90fe0ee1 440f104150      movups  xmm8,xmmword ptr [rcx+50h] ds:00000224`9ff59d30=????????????????????????????????

Stack trace:

[0x0]   _pcbnew!EDA_ITEM::IsBrightened   0x32f2deda00   0x7ff890fe7d9a   
[0x1]   _pcbnew!KIGFX::PCB_RENDER_SETTINGS::GetColor+0x2c1   0x32f2deda00   0x7ff890fe7d9a   
[0x2]   _pcbnew!KIGFX::PCB_PAINTER::draw+0x7a   0x32f2dedbc0   0x7ff890fe0931   
[0x3]   _pcbnew!KIGFX::PCB_PAINTER::Draw+0x261   0x32f2dedd70   0x7ff891142fcc   
[0x4]   _pcbnew!KIGFX::VIEW::updateItemGeometry+0x11c   0x32f2dedf20   0x7ff8911422db   
[0x5]   _pcbnew!KIGFX::VIEW::invalidateItem+0xbb   0x32f2dedf60   0x7ff891141a50   
[0x6]   _pcbnew!KIGFX::VIEW::UpdateItems+0x510   0x32f2dee810   0x7ff891319138   
[0x7]   _pcbnew!EDA_DRAW_PANEL_GAL::DoRePaint+0x7a8   0x32f2def1b0   0x7ff891319a4e   
[0x8]   _pcbnew!EDA_DRAW_PANEL_GAL::Refresh+0xe   0x32f2def5a0   0x7ff890ae52ba   
[0x9]   _pcbnew!APPEARANCE_CONTROLS::onLayerVisibilityToggled+0xca   0x32f2def5d0   0x7ff8a8fc5962   
[0xa]   _pcbnew!APPEARANCE_CONTROLS::rebuildLayers::__l2::<lambda_1>::()::__l2::<lambda_1>::operator()+0xce   0x32f2def5d0   0x7ff8a8fc5962   
[0xb]   _pcbnew!wxEventFunctorFunctor<wxEventTypeTag<wxCommandEvent>,``APPEARANCE_CONTROLS::rebuildLayers'::`2'::<lambda_1>::operator()'::`2'::<lambda_1> >::operator()+0xea   0x32f2def5d0   0x7ff8a8fc5962   
[0xc]   wxbase32u_vc_custom!wxAppConsoleBase::CallEventHandler+0x62   0x32f2def620   0x7ff8a90b8e0f   
[0xd]   wxbase32u_vc_custom!wxEvtHandler::ProcessEventIfMatchesId+0x4f   0x32f2def660   0x7ff8a90b9923   
[0xe]   wxbase32u_vc_custom!wxEvtHandler::SearchDynamicEventTable+0x83   0x32f2def690   0x7ff8a90b9c72   
[0xf]   wxbase32u_vc_custom!wxEvtHandler::TryHereOnly+0x22   0x32f2def6e0   0x7ff8a90b8d73   
[0x10]   wxbase32u_vc_custom!wxEvtHandler::ProcessEvent+0xe3   0x32f2def710   0x7ff8a90b92c5   
[0x11]   wxbase32u_vc_custom!wxEvtHandler::ProcessPendingEvents+0x425   0x32f2def750   0x7ff8a8fc8cc1   
[0x12]   wxbase32u_vc_custom!wxAppConsoleBase::ProcessPendingEvents+0x71   0x32f2def880   0x7ff8a8ff6ee4   
[0x13]   wxbase32u_vc_custom!wxEventLoopManual::DoRun+0x74   0x32f2def8d0   0x7ff8a8ff717a   
[0x14]   wxbase32u_vc_custom!wxEventLoopBase::Run+0x6a   0x32f2def900   0x7ff8a8fc7e67   
[0x15]   wxbase32u_vc_custom!wxAppConsoleBase::MainLoop+0x67   0x32f2def960   0x7ff7a798a71a   
[0x16]   kicad!APP_KICAD::OnRun+0xa   0x32f2def9b0   0x7ff8a904301c   
[0x17]   wxbase32u_vc_custom!wxEntry+0x16c   0x32f2def9f0   0x7ff8a91163c8   
[0x18]   wxbase32u_vc_custom!wxEntry+0x28   0x32f2defa30   0x7ff7a7b8890a   
[0x19]   kicad!invoke_main+0x21   0x32f2defa60   0x7ff9033f26ad   
[0x1a]   kicad!__scrt_common_main_seh+0x106   0x32f2defa60   0x7ff9033f26ad   
[0x1b]   KERNEL32!BaseThreadInitThunk+0x1d   0x32f2defaa0   0x7ff903f8aa68   
[0x1c]   ntdll!RtlUserThreadStart+0x28   0x32f2defad0   0x0   

Steps to reproduce

  1. open a pcb with e.g. two CU-layers.
  2. go into the right side menu, click 'hide all layers but active' on e.g. the first entry of the list
  3. click to hide the last remaining layer.
  4. watch pcbnew and kicad crash.

KiCad Version

Application: KiCad x64 on x64

Version: 7.99.0-1823-ga38875d6dd, release build

Libraries:
	wxWidgets 3.2.2
	FreeType 2.12.1
	HarfBuzz 6.0.0
	FontConfig 2.14.1
	libcurl/7.88.1-DEV Schannel zlib/1.2.13

Platform: Windows 11 (build 22621), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
	Date: Jul 11 2023 07:18:29
	wxWidgets: 3.2.2 (wchar_t,wx containers)
	Boost: 1.81.0
	OCC: 7.7.1
	Curl: 7.88.1-DEV
	ngspice: 40
	Compiler: Visual C++ 1936 without C++ ABI

Build settings: