I have received a segmentation fault on app close on version 3.3.3

32 views
Skip to first unread message

Erkam Murat Bozkurt

unread,
Jul 15, 2026, 11:13:44 AM (yesterday) Jul 15
to wx-u...@googlegroups.com
I am testing a fully automatic C++ build system generator and the platform produces the necessary "CMakeLists.txt" and the other configuration files automatically for both kernel and GUI. Previously, I could not produce an executable for GUI and there was a linking problem. Now, I can overcome the linking problem that I have mentioned previously and the app can successfully generate its own configuration files automatically. On the current version of the GUI, I have used the wxWidgets version 3.3.1 and MinGW-w64 13.0.0  as compiler and the GUI is closing without any crash. 

Every wxWidgets configuration is performed automatically by the CMAKE with the following CMAKE command.

include(FetchContent)

FetchContent_Declare(
   wxWidgets
   GIT_TAG v3.3.1
   GIT_PROGRESS TRUE
)

FetchContent_GetProperties(wxwidgets)
FetchContent_MakeAvailable(wxwidgets)

However, when I try to check whether the app can produce the configuration files without human intervention, the
platform produces "CMakeLists.txt" files for direct linking without using FetchContent property. Off course, it is possible to make
availably of wxWidgets library by default and in the future, I will add this property. But, I am trying to check direct linking
with automatically produced CMakeLists.txt files and therefore, I compile the app using the same compiler "MinGW-w64 13.0.0"  
for wxWidgets version 3.3.3 with direct linking. Unfortunately, the app crashes on close when I use wxWidgets version 3.3.3 with direct linking 
I have written the configuration codes which are produced automatically by the platform.

The GUI of the app works successfully and it crashy solely on close.

target_link_libraries(Pcynlitx PUBLIC
   
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_adv.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_xrc.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_stc.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_aui.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_core.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxpngd.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxlexillad.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_gl.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_richtext.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxscintillad.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxbase33ud_net.a
        C:/wxWidgets-3.3.3/lib/gcc_lib/libwxmsw33ud_webview.a
        imm32
        gcc
        stdc++
        wxtiffd
        wxjpegd
        wxpngd
        wxwebpd
        wxzlibd
        wxregexud
        wxexpatd
        kernel32
        user32
        gdi32
        gdiplus
        msimg32
        comdlg32
        winspool
        winmm
        shell32
        shlwapi
        comctl32
        ole32
        oleaut32
        uuid
        rpcrt4
        advapi32
        version
        ws2_32
        wininet
        oleacc
        uxtheme
   
)

I can not determine the reason why the app crashes. The gdb debugger gives the following back trace

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00007ffae64af6a3 in ntdll!RtlInitializeResource () from C:\WINDOWS\SYSTEM32\ntdll.dll
(gdb) bt
#0  0x00007ffae64af6a3 in ntdll!RtlInitializeResource () from C:\WINDOWS\SYSTEM32\ntdll.dll
#1  0x00007ffae64c016f in ntdll!RtlSleepConditionVariableCS () from C:\WINDOWS\SYSTEM32\ntdll.dll
#2  0x00007ffae64c13e2 in ntdll!RtlEnterCriticalSection () from C:\WINDOWS\SYSTEM32\ntdll.dll
#3  0x00007ff70105b986 in wxCriticalSection::Enter (
    this=0x7ff701bc7e00 <(anonymous namespace)::UntranslatedStringHolder::ms_criticalSection>)
    at ../../src/msw/thread.cpp:143
#4  0x00007ff7014711ca in wxCriticalSectionLocker::wxCriticalSectionLocker (this=0x5ffd40, cs=...)
    at C:/wxWidgets-3.3.3/include/wx/thread.h:299
#5  0x00007ff70102f251 in (anonymous namespace)::UntranslatedStringHolder::~UntranslatedStringHolder (
    this=0x29ed8f8) at ../../src/common/translation.cpp:1511
#6  0x00007ff70139b6ee in run_dtor_list ()
#7  0x00007ff70139b850 in tls_atexit_callback ()
#8  0x00007ff7013b6e3d in run_callback ()
#9  0x00007ffae585e88a in msvcrt!_initterm_e () from C:\WINDOWS\System32\msvcrt.dll
#10 0x00007ff700cd137d in __tmainCRTStartup ()
#11 0x00007ff700cd1038 in WinMainCRTStartup ()

I did not use wxThread anywhere and it still points to wxThread. Most probably, you don't have the time to check the code but I have 
added the related link for the codebase


Even Though I have written a class in order to use wxThread, I used std::thread on the threading for GUI.

Erkam Murat Bozkurt


Igor Korot

unread,
Jul 15, 2026, 12:59:22 PM (yesterday) Jul 15
to wx-u...@googlegroups.com
Hi,
Do you access any GUI class from the thread?

Thank you.


--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/wx-users/CAG1x5-OrF95s%3Dwzxv-qVaNVuLkYta%3DyA-nOR1AnkwjP3_%3D%2Bf7g%40mail.gmail.com.

PB

unread,
7:54 AM (15 hours ago) 7:54 AM
to wx-users
Hi,

it looks like this bug has resurfaced: https://github.com/wxWidgets/wxWidgets/issues/26195

I would try reverting the mingw64 version check added here https://github.com/wxWidgets/wxWidgets/pull/26587/changes to see if it helps.

You told us which version of mingw-w64 are you using but which compiler (GCC version, UCRT vs MSVCRT) from which source are you using?

Regards
PB

Maarten Bent

unread,
4:00 PM (7 hours ago) 4:00 PM
to wx-u...@googlegroups.com
Indeed, looks like that problem. The segfaults are only fixed for mingw64 >= 15.0.

Older mingw64 versions likely do not support native TLS (it also depends on if gcc16 is used, and its build options).
So they will still use the problematic UntranslatedStringHolder that was added in wx3.3.2 (pr 25928).

You could try changing the mingw64 version check that PB mention to '< 13', so your version will not use that UntranslatedStringHolder.
But then you might get non-zero exit codes that 25928 tried to fix.

Maarten
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wx-users+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages