Hi,
I have the feeling that version 8.0.4 crashes very often. No matter if you save in between or not. It feels like many traces have been moved. Automatic report generation is active, I hope that enough data is collected for this. As far as I know, the previous versions did not crash.
How can I view the report?
Without registering anywhere.
Can you see the automatically generated reports?
Win 11
Ryzen 9 5950X
2x 32GB RAM
MSI MPG X570S CARBON MAX WIF
dsa-t
August 11, 2024, 12:33am
2
Share your Unique Id and we’ll be able to find them.
mikrocoder:
Ryzen 9 5950X
What is your graphics card?
I have Win 11 on a Ryzen 7 2700X with an AMD RX 6500 XT graphics card and its stable.
Are you overclocking?
Hi,
ID: 6f45cceb-9e73-4612-aec2-733704db5d58
I have a GeForce GTX 1060.
Nothing was and is overclocked. All standard settings.
Edit:
I can narrow it down a bit. After working in the PCB Editor for a longer time, I just have to make a mouse click in the upper left area of the menu bar and the PCB Editor crashed. When I open it again, the crash message appears, asking what I want to do, etc.
dsa-t
August 11, 2024, 5:24pm
5
I see two crashes at:
Aug 11, 2024 4:04:41 PM UTC
Aug 9, 2024 6:53:41 PM UTC
which happens when you have action plugins with non-24x24px icons. It was a wxWidgets bug and is resolved for 8.0.5:
opened 07:54AM - 14 Jul 24 UTC
closed 11:23PM - 21 Jul 24 UTC
high priority
MSW
### Description
Using this code will lead to exhaustion of GDI objects on Win… dows, causing a crash:
```cpp
#ifdef __WINDOWS__
::AttachConsole(ATTACH_PARENT_PROCESS) || ::AllocConsole();
if (::GetStdHandle(STD_INPUT_HANDLE) != INVALID_HANDLE_VALUE)
{
freopen("CONIN$", "r", stdin);
setvbuf(stdin, NULL, _IONBF, 0);
}
if (::GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE)
{
freopen("CONOUT$", "w", stdout);
setvbuf(stdout, NULL, _IONBF, 0);
}
if (::GetStdHandle(STD_ERROR_HANDLE) != INVALID_HANDLE_VALUE)
{
freopen("CONOUT$", "w", stderr);
setvbuf(stderr, NULL, _IONBF, 0);
}
#endif
wxBitmapBundle bb = wxBitmap(32, 32);
for (int i = 0;; i++) {
wxBitmap bmp = bb.GetBitmap(wxSize(24, 24));
std::cout << i << " " << bmp.GetHandle() << std::endl;
}
```
`minimal` sample stack trace:
```
vcruntime140d.dll!memcpy() Line 343 Unknown
> wxmsw330ud_core_vc_x64_custom.dll!wxBitmapRefData::wxBitmapRefData(const wxBitmapRefData & data) Line 246 C++
wxmsw330ud_core_vc_x64_custom.dll!wxBitmap::CloneGDIRefData(const wxGDIRefData * data) Line 401 C++
wxmsw330ud_core_vc_x64_custom.dll!wxGDIObject::CloneRefData(const wxRefCounter * data) Line 83 C++
wxbase330ud_vc_x64_custom.dll!wxObject::AllocExclusive() Line 330 C++
wxmsw330ud_core_vc_x64_custom.dll!wxGDIImage::SetScaleFactor(double scale) Line 354 C++
wxmsw330ud_core_vc_x64_custom.dll!wxBitmapBundle::GetBitmap(const wxSize & size) Line 593 C++
minimal.exe!MyFrame::MyFrame(const wxString & title) Line 204 C++
minimal.exe!MyApp::OnInit() Line 124 C++
wxbase330ud_vc_x64_custom.dll!wxAppConsoleBase::CallOnInit() Line 92 C++
wxbase330ud_vc_x64_custom.dll!wxEntryReal(int & argc, wchar_t * * argv) Line 569 C++
wxbase330ud_vc_x64_custom.dll!wxEntry(int & argc, wchar_t * * argv) Line 171 C++
wxmsw330ud_core_vc_x64_custom.dll!wxEntry(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * __formal, int nCmdShow) Line 232 C++
minimal.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 105 C++
minimal.exe!invoke_main() Line 107 C++
minimal.exe!__scrt_common_main_seh() Line 288 C++
minimal.exe!__scrt_common_main() Line 331 C++
minimal.exe!WinMainCRTStartup(void * __formal) Line 17 C++
kernel32.dll!BaseThreadInitThunk() Unknown
ntdll.dll!RtlUserThreadStart() Unknown
```
`memcpy` line:
https://github.com/wxWidgets/wxWidgets/blob/ba026c21d85a94e2e95034621b4c2b7b087decd6/src/msw/bitmap.cpp#L245
---
Stack trace in KiCad:
```
0 VCRUNTIME140.dll 0x7ff8171214f3 memcpy (memcpy.asm:338)
1 wxmsw32u_core_vc_custom.dll 0x7fff9eab5c0a wxBitmapRefData::wxBitmapRefData (bitmap.cpp:246)
2 wxmsw32u_core_vc_custom.dll 0x7fff9eab64d7 wxBitmap::CloneGDIRefData (bitmap.cpp:402)
3 wxbase32u_vc_custom.dll 0x7fffe1687d4f wxObject::AllocExclusive (object.cpp:386)
4 wxmsw32u_core_vc_custom.dll 0x7fff9eae5524 wxGDIImage::SetScaleFactor (gdiimage.cpp:351)
5 wxmsw32u_core_vc_custom.dll 0x7fff9eaa697a wxBitmapBundle::GetBitmap (bmpbndl.cpp:561)
6 _pcbnew.dll 0x7fff9cf7a77f WX_AUI_TOOLBAR_ART::DrawButton (wx_aui_art_providers.cpp:111)
7 wxmsw32u_aui_vc_custom.dll 0x7ff831b70293 wxAuiToolBar::OnPaint (auibar.cpp:2472)
8 wxbase32u_vc_custom.dll 0x7fffe15f60f3 wxAppConsoleBase::CallEventHandler (appbase.cpp:673)
9 wxbase32u_vc_custom.dll 0x7fffe16edfde wxEvtHandler::ProcessEventIfMatchesId (event.cpp:1431)
10 wxbase32u_vc_custom.dll 0x7fffe16edbbb wxEventHashTable::HandleEvent (event.cpp:1039)
11 wxbase32u_vc_custom.dll 0x7fffe16eee5c wxEvtHandler::TryHereOnly (event.cpp:1628)
12 wxbase32u_vc_custom.dll 0x7fffe16edf42 [inlined] wxEvtHandler::TryBeforeAndHere (event.h:4007)
13 wxbase32u_vc_custom.dll 0x7fffe16edf42 [inlined] wxEvtHandler::ProcessEventLocally (event.cpp:1561)
14 wxbase32u_vc_custom.dll 0x7fffe16edf42 wxEvtHandler::ProcessEvent (event.cpp:1534)
15 wxbase32u_vc_custom.dll 0x7fffe16eea59 wxEvtHandler::SafelyProcessEvent (event.cpp:1650)
16 wxmsw32u_core_vc_custom.dll 0x7fff9eb3d1f2 wxWindow::HandlePaint (window.cpp:5373)
17 wxmsw32u_core_vc_custom.dll 0x7fff9eb40807 wxWindow::MSWHandleMessage (window.cpp:3118)
18 wxmsw32u_core_vc_custom.dll 0x7fff9eb43ee7 wxWindow::MSWWindowProc (window.cpp:3906)
19 wxmsw32u_core_vc_custom.dll 0x7fff9eb48f15 wxWndProc (window.cpp:2948)
20 USER32.dll 0x7ff837e18240 UserCallWinProcCheckWow
21 USER32.dll 0x7ff837e17efb DispatchClientMessage
22 USER32.dll 0x7ff837e2302c _fnDWORD
23 ntdll.dll 0x7ff8396b33b3 KiUserCallbackDispatch
24 win32u.dll 0x7ff83698c853 NtUserUpdateWindow
25 wxmsw32u_core_vc_custom.dll 0x7fff9eb46099 wxWindow::Update (window.cpp:1729)
26 wxmsw32u_aui_vc_custom.dll 0x7ff831b7151c wxAuiToolBar::SetHoverItem (auibar.cpp:1485)
27 wxmsw32u_aui_vc_custom.dll 0x7ff831b70020 wxAuiToolBar::OnMotion (auibar.cpp:2887)
28 wxbase32u_vc_custom.dll 0x7fffe15f60f3 wxAppConsoleBase::CallEventHandler (appbase.cpp:673)
...
```
---
In KiCad, the plugin icons are drawn in the toolbar. Some plugins use 32x32 icons, which is scaled down to 24x24 via [`WX_AUI_TOOLBAR_ART`](https://gitlab.com/kicad/code/kicad/-/blob/d933a8d6a94aa0e93af51fea976f4de8d1357151/common/widgets/wx_aui_art_providers.cpp#L111).
The toolbar is redrawn at every mouse motion over it, so eventually the GDI object count exceeds the 10000 limit, and due to insufficient checking in https://github.com/wxWidgets/wxWidgets/blob/ba026c21d85a94e2e95034621b4c2b7b087decd6/src/msw/bitmap.cpp#L245, the program crashes.
---
This issue is the cause of 1.3k crash events with at least 215 affected users in the last 90 days.
Would be great to not leak GDI object when using `wxBitmapBundle::GetBitmap`, and even not allocate so much ref data for performance reasons also.
### Platform and version information
- wxWidgets version you use: 3.2.5 / master
- wxWidgets port you use: wxMSW
- OS and its version: Windows 11
Also I see 3 debug reports on close (usually of memory leaks), but they shouldn’t matter for normal operation:
Aug 8, 2024 9:59:44 PM UTC
Aug 1, 2024 8:24:00 PM UTC
Jun 21, 2024 9:39:33 PM UTC
Application Specific Information:
Fatal Error: EXCEPTION_BREAKPOINT / 0x7ffaefea7b12
Thread 19084 Crashed:
0 KERNELBASE.dll 0x7ffaefea7b12 wil::details::DebugBreak
1 D2D1Debug3.dll 0x7ffad76835cd DebugLayer::OutputGlobalErrorMessage
2 D2D1Debug3.dll 0x7ffad7682bee DebugLayer::GlobalCleanup
3 D2D1Debug3.dll 0x7ffad7676f21 DllMain
4 D2D1Debug3.dll 0x7ffad76dab88 _DllMainCRTStartup
5 ntdll.dll 0x7ffaf25b8b7e LdrpCallInitRoutine
6 ntdll.dll 0x7ffaf25e1585 LdrShutdownProcess
7 ntdll.dll 0x7ffaf25e117c RtlExitUserProcess
8 KERNEL32.DLL 0x7ffaf0d67faa ExitProcessImplementation
9 ucrtbase.dll 0x7ffaf018bed7 exit_or_terminate_process
10 ucrtbase.dll 0x7ffaf018c098 common_exit
11 kicad.exe 0x7ff6c3b93e9b __scrt_common_main_seh (exe_common.inl:295)
12 KERNEL32.DLL 0x7ffaf0d6257c BaseThreadInitThunk
13 ntdll.dll 0x7ffaf25eaf27 RtlUserThreadStart
1 Like
Hi,
I have removed a few plugins and is stable again.
2 Likes
system
Closed
November 10, 2024, 8:38pm
8
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.