User forums > General (but related to Code::Blocks)

TDM-Gcc is discontinued

<< < (8/10) > >>

TobiasA:
So I'll revive that thread in the hope it pops to the start.

I'm having the same and can reproduce it by compiling wxWidgets 3.1.4 in 64bit, compiling any app with a wxTextCtrl in it and destroying that textctrl. I have some applications with a textctrl in it, and each of them crashes with the stack pointing to the destructor of locale.


--- Code: ---The stack is:
#0 0x76f8f230    ntdll!RtlUnhandledExceptionFilter() (C:\Windows\SYSTEM32\ntdll.dll:??)
#1 0x76f8f836    ntdll!EtwEnumerateProcessRegGuids() (C:\Windows\SYSTEM32\ntdll.dll:??)
#2 0x76f90452    ntdll!RtlQueryProcessLockInformation() (C:\Windows\SYSTEM32\ntdll.dll:??)
#3 0x76f92564    ntdll!RtlLogStackBackTrace() (C:\Windows\SYSTEM32\ntdll.dll:??)
#4 0x76efa232    ntdll!RtlFreeHeap() (C:\Windows\SYSTEM32\ntdll.dll:??)
#5 0x7fefee710c8    msvcrt!free() (C:\Windows\system32\msvcrt.dll:??)
#6 0x12a44bd    std::locale::_Impl::~_Impl() () (C:\wxGccTDM314\lib\gcc_dll64\wxmsw314ud_core_gcc_cb.dll:??)
#7 0x12a4920    std::locale::~locale() () (C:\wxGccTDM314\lib\gcc_dll64\wxmsw314ud_core_gcc_cb.dll:??)
#8 0x1153e0f    wxTextCtrlBase::~wxTextCtrlBase(this=0xc01dc70, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/textctrl.h:693)
#9 0xe49951    wxTextCtrl::~wxTextCtrl(this=0xc01dc70, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/textctrl.cpp:354)
#10 0xe49991    wxTextCtrl::~wxTextCtrl(this=0xc01dc70, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/textctrl.cpp:365)
#11 0xf45f26    wxWindowBase::Destroy(this=0xc01dc70) (C:\wxGccTDM314_64\build\msw/../../src/common/wincmn.cpp:578)
#12 0xf46085    wxWindowBase::DestroyChildren(this=0xc0178d0) (C:\wxGccTDM314_64\build\msw/../../src/common/wincmn.cpp:610)
#13 0xdb68ec    wxWindow::~wxWindow(this=0xc0178d0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/window.cpp:483)
#14 0x117bdd8    wxNavigationEnabled<wxWindow>::~wxNavigationEnabled(this=0xc0178d0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/containr.h:189)
#15 0x1135e4a    wxPanelBase::~wxPanelBase(this=0xc0178d0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/panel.h:30)
#16 0x11c0d26    wxPanel::~wxPanel(this=0xc0178d0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/msw/panel.h:19)
#17 0x11c0ce5    wxPanel::~wxPanel(this=0xc0178d0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/msw/panel.h:19)
#18 0xf45f26    wxWindowBase::Destroy(this=0xc0178d0) (C:\wxGccTDM314_64\build\msw/../../src/common/wincmn.cpp:578)
#19 0xf46085    wxWindowBase::DestroyChildren(this=0xbfddae0) (C:\wxGccTDM314_64\build\msw/../../src/common/wincmn.cpp:610)
#20 0xdb68ec    wxWindow::~wxWindow(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/window.cpp:483)
#21 0xe85fb8    wxControlBase::~wxControlBase(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/common/ctrlcmn.cpp:48)
#22 0x11e7c8c    wxControl::~wxControl(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/msw/control.h:17)
#23 0x114d347    wxBookCtrlBase::~wxBookCtrlBase(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/bookctrl.h:55)
#24 0x1152aa3    wxNotebookBase::~wxNotebookBase(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../include/wx/notebook.h:103)
#25 0xe2552d    wxNotebook::~wxNotebook(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/notebook.cpp:296)
#26 0xe25553    wxNotebook::~wxNotebook(this=0xbfddae0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/notebook.cpp:302)
#27 0xf45f26    wxWindowBase::Destroy(this=0xbfddae0) (C:\wxGccTDM314_64\build\msw/../../src/common/wincmn.cpp:578)
#28 0xf46085    wxWindowBase::DestroyChildren(this=0xbfdd1e0) (C:\wxGccTDM314_64\build\msw/../../src/common/wincmn.cpp:610)
#29 0xdb68ec    wxWindow::~wxWindow(this=0xbfdd1e0, __in_chrg=<optimized out>) (C:\wxGccTDM314_64\build\msw/../../src/msw/window.cpp:483)
--- End code ---

My locale is german.
32bit is fine, been using it for quite some time, apps are running fine and stable in both win7 and win10.

ollydbg:
@TobiasA

For those days, I mainly use the GCC compiler inside the MSYS2 suite.

But someone mention other compilers in this thread.

I can't reply to you in the wx-user Google Group Application crashes on exit in 64bit (My message always get deleted automatically), so I reply it here.

reckless:
Msys2 mingw-w64 has had some interresting development lately as it added hardening (ASLR / DEP) to pretty much the entire compiler. This has had the benefit that most AV solutions no longer complain about malicious code in the compiled executables.
But it is still early days and the hardening may not work for every project (some projects will crash outright if ASLR is on) and wxwidgets is one of them. This might be because we push the image base high by default on 64 bit builds (does not work with everything) DEP usually works without any problem though. TDM's gcc unfortunatly is wholly incompatible with this and cannot be built with ASLR or DEP at all, probably due to how it handles throwing exceptions from statically linked executables.
Still we are very much still in experimental territory and a more stable implementation might come with the next binutils release.
Atm we rely on a rather substantial patchset for binutils-2.35 but there are plans to make it a feature of upcomming binutils on windows.

reckless:
Well i managed to get a TDM version of gcc-10.2.0 built with ASLR and DEP.
I had to rearrange a few things in the eh_shmem.patch also getting rid of a few of the trap calls which seems to be the problem with it on x86_64.
still it is not completly safe to use ASLR with it as some packages who do not exhibit any failures on standard msys2 mingw-w64 will segfault,
but it is far less than what it has been so it is up to the developer if he wants to try his hand at it.

Atm im building the various make tools (cmake meson ninja) which has turned out to be a massive pain in the butt
since many of the tools over the years have picked up a lot of circular dependencies (freetype fontconfig etc.).

when done i will provide a link for those who want to experiment with it.

AndrewCot:
Posting this followup as this is THE TDM wxTextCtrl/locale crash thread.

I have successfully built wxWidget 3.1.5 and CB SVN 12487 from source (batch_build_all_31_64.bat) with TDM 10.3 (github release). The build has then successfully rebuilt CB again and it runs and can load the CodeBlocks_wx31_64.cbp and the CodeBlocks_wx31_64.workspace and successfully did a build again.

As such TDM 10.3 has no issues building CB from source.

My testing results so far as of 31-July-2021 with the CB built follows:

1) I have not seen issues with GetTickCount64() after doing a clean build of wxwidget and CB. I seen this with mixing TDM wxwidget DLL's and the CB exe/dll's.

2) Crash with a wxTextCtrl when destroying that textctrl:
    a) I have been able to verify that CB still crashes at the end of the new wxWidgets project wizard. See below for debug backtrace of a crash.
    b) I have been able to build and run the wxwidget samples\text program without any crashes. This effectively uses a number of wxTextCtrl controls (inherited wxTextCtrl).
    c) I have been able to build and run the wxwidget samples\internat program without any crashes. This effectively uses a number of wxTextCtrl controls and locale.

3) CB built with TDM crashes on exit depending on the plugins enabled/disabled. I do not have a call stack or RPT file.
    3a) I have disabled just the lib_finder plugin and the crash still occurs
    3b) Disabling compiler plugin causes a crash when pressing the disable button.
    3c) I have disabled all plugins and the crashes stop. There are a number of plugins that cause CB to crash on exit and they appear (only checked 20 plugins and 3 caused crashes))
   

4) Debugging CB (CodeBlocks_wx31_64.cbp, not workspace) built with "-g -O0 -ggdb" (debugging overkill) does not help w.r.t. giving any extra info.

5)  The crash backtrace show that the issue is as per previous post and my investigations also came to the same conclusions.
"The problem happens when one of the wxTextCtrl destructors triggers a std::locale::~locale() destructor, which I'm not familiar with and don't see the dependency yet in wxWidgets' code.
I'm generally suspicious of double-deletion in cases like this but I don't see anything in lib_finder triggering a deletion when it shouldn't."

6) I have not been able to produce a simple app that crashes yet. Does anyone have a "simple" app or an example that crashes?

7) Based on the testing done with the sample apps and CB I have come to the current conclusion that CB is doing something that when built with TDM 10.3 (GCC 10.3) causes the crash. There have been two other CB source code changes due to GCC 10.3 compilation crashes when using MSYS2 and as such I think there is may be another one lurking in the Cb code or potentially wxwidget.

GDB debugger back trace after the wxWidget wizard crash:

> bt
#0  0x00007ffd28fcf1e3 in ntdll!RtlIsZeroMemory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffd28fd7fa2 in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffd28fd828a in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ffd28fddf11 in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x00007ffd28ef5bf0 in ntdll!RtlGetCurrentServiceSessionId () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x00007ffd28ef47b1 in ntdll!RtlFreeHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x00007ffd28989c9c in msvcrt!free () from C:\WINDOWS\System32\msvcrt.dll
#7  0x00007ffca4c5765d in std::locale::_Impl::~_Impl() () from F:\Andrew_Development\TDM\AC-WindowsInstaller\src\devel31_64\wxmsw315ud_gcc_cb.dll
#8  0x00007ffca4c57bb0 in std::locale::~locale() () from F:\Andrew_Development\TDM\AC-WindowsInstaller\src\devel31_64\wxmsw315ud_gcc_cb.dll
#9  0x00007ffca4a28f9f in wxTextCtrlBase::~wxTextCtrlBase (this=0x1e027147ee0, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\include\wx\textctrl.h:693
#10 0x00007ffca43430b1 in wxTextCtrl::~wxTextCtrl (this=0x1e027147ee0, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\msw\textctrl.cpp:376
#11 0x00007ffca43430f1 in wxTextCtrl::~wxTextCtrl (this=0x1e027147ee0, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\msw\textctrl.cpp:387
#12 0x00007ffca443e9fa in wxWindowBase::Destroy (this=0x1e027147ee0) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\common\wincmn.cpp:568
#13 0x00007ffca443eb57 in wxWindowBase::DestroyChildren (this=0x1e027187d00) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\common\wincmn.cpp:600
#14 0x00007ffca42a0ede in wxWindow::~wxWindow (this=0x1e027187d00, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\msw\window.cpp:481
#15 0x00007ffcbd91d65c in wxNavigationEnabled<wxWindow>::~wxNavigationEnabled (this=0x1e027187d00, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\include\wx\containr.h:189
#16 0x00007ffcbd912f2a in wxPanelBase::~wxPanelBase (this=0x1e027187d00, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\include\wx\panel.h:30
#17 0x00007ffcbd91f87a in wxPanel::~wxPanel (this=0x1e027187d00, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\include\wx\msw\panel.h:19
#18 0x00007ffcbd8db04e in ProjectPathPanel::~ProjectPathPanel (this=0x1e027187d00, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\AC-WindowsInstaller\src\plugins\scriptedwizard\projectpathpanel.cpp:86
#19 0x00007ffcbd8db06b in ProjectPathPanel::~ProjectPathPanel (this=0x1e027187d00, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\AC-WindowsInstaller\src\plugins\scriptedwizard\projectpathpanel.cpp:88
#20 0x00007ffca443e9fa in wxWindowBase::Destroy (this=0x1e027187d00) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\common\wincmn.cpp:568
<CUT>


GDB debugger back trace after the CB exit crash:

> bt
#0  0x00007ffd28fcf1e3 in ntdll!RtlIsZeroMemory () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffd28fd7fa2 in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffd28fd828a in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ffd28fddf11 in ntdll!RtlpNtSetValueKey () from C:\WINDOWS\SYSTEM32\ntdll.dll
#4  0x00007ffd28ef5bf0 in ntdll!RtlGetCurrentServiceSessionId () from C:\WINDOWS\SYSTEM32\ntdll.dll
#5  0x00007ffd28ef47b1 in ntdll!RtlFreeHeap () from C:\WINDOWS\SYSTEM32\ntdll.dll
#6  0x00007ffd28989c9c in msvcrt!free () from C:\WINDOWS\System32\msvcrt.dll
#7  0x00007ffca35d765d in std::locale::_Impl::~_Impl() () from F:\Andrew_Development\TDM\AC-WindowsInstaller\src\devel31_64\wxmsw315ud_gcc_cb.dll
#8  0x00007ffca35d7bb0 in std::locale::~locale() () from F:\Andrew_Development\TDM\AC-WindowsInstaller\src\devel31_64\wxmsw315ud_gcc_cb.dll
#9  0x00007ffca33a8f9f in wxTextCtrlBase::~wxTextCtrlBase (this=0x1d18684d710, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\include\wx\textctrl.h:693
#10 0x00007ffca2cc30b1 in wxTextCtrl::~wxTextCtrl (this=0x1d18684d710, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\msw\textctrl.cpp:376
#11 0x00007ffca2cc30f1 in wxTextCtrl::~wxTextCtrl (this=0x1d18684d710, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\msw\textctrl.cpp:387
#12 0x00007ffca2dbe9fa in wxWindowBase::Destroy (this=0x1d18684d710) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\common\wincmn.cpp:568
#13 0x00007ffca2f56c07 in wxAuiNotebook::DeletePage (this=0x1d1866e2d70, page_idx=0) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\aui\auibook.cpp:2057
#14 0x00007ffca2f56069 in wxAuiNotebook::~wxAuiNotebook (this=0x1d1866e2d70, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\aui\auibook.cpp:1764
#15 0x00007ffcb520806e in cbAuiNotebook::~cbAuiNotebook (this=0x1d1866e2d70, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\AC-WindowsInstaller\src\sdk\cbauibook.cpp:80
#16 0x00007ff6d1bcbf32 in InfoPane::~InfoPane (this=0x1d1866e2d70, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\AC-WindowsInstaller\src\src\infopane.cpp:65
#17 0x00007ff6d1bcbf5b in InfoPane::~InfoPane (this=0x1d1866e2d70, __in_chrg=<optimized out>) at F:\Andrew_Development\TDM\AC-WindowsInstaller\src\src\infopane.cpp:72
#18 0x00007ffca2dbe9fa in wxWindowBase::Destroy (this=0x1d1866e2d70) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\common\wincmn.cpp:568
#19 0x00007ff6d1be5704 in MainFrame::OnApplicationClose (this=0x1d186687100, event=...) at F:\Andrew_Development\TDM\AC-WindowsInstaller\src\src\main.cpp:3125
#20 0x00007ffca2aa38c5 in wxAppConsoleBase::HandleEvent (this=0x1d185dd2460, handler=0x1d186687100, func=(void (wxEvtHandler::*)(wxEvtHandler * const, wxEvent &)) 0x7ff6d1be5154 <MainFrame::OnApplicationClose(wxCloseEvent&)>, event=...) at F:\Andrew_Development\TDM\wxWidgets-3.1.5\src\common\appbase.cpp:654
<CUT>

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version